kylin 的官网没有列出保存 cube 信息,model 信息,project等 rest api,这里通过查看源码对实际项目使用中有用到的 api 进行列举
官方文档
http://kylin.apache.org/docs16/howto/howto_use_restapi.html#build-cube
保存项目
POST /kylin/api/projects
ProjectController.java
Request Body
- name -
required
String
项目名 - description -
optional
String
项目描述
导入 hive table
POST /kylin/api/tables/{tables}/{project}
Request Parameters
- tables -
required
string
需要导入的表名,用 , 分隔 - project -
required
String
导入的目标项目
Response Sample
|
|
保存 model
POST /kylin/api/models
ModelController.java
Request Body
- project -
required
String
项目名 - modelName -
required
String
Model 名 - modelDescData -
required
String
model 描述字符串,json 中必须用字符串,即 “ 用 \” 表示,详见下面例子
post json 请求示例
|
|
Response Sample
|
|
保存 cube 详细配置
POST /kylin/api/cubes
CubeController.java
Request Body
- project -
required
String
项目名 - cubeName -
required
String
Cube 名 - cubeDescData -
required
String
cube 描述字符串,json 中必须用字符串,即 “ 用 \” 表示,详见下面例子
Curl Example
|
|
post json 示例
|
|
Response Sample
|
|
构建 Cube
PUT /kylin/api/cubes/{cubeName}/rebuild
Path Variable
cubeName -
required
string
Cube name.
Request BodystartTime -
required
long
Start timestamp of data to build, e.g. 1388563200000 for 2014-1-1- endTime -
required
long
End timestamp of data to build- - buildType -
required
string
Supported build type: ‘BUILD’, ‘MERGE’, ‘REFRESH’
获取 Cube (查看信息)
GET /kylin/api/cubes/{cubeName}
###Path Variable
- cubeName -
required
string
Cube name to find.
GET /kylin/api/cube_desc/{cubeName}
Get descriptor for specified cube instance.
Path Variable
- cubeName -
required
string
Cube name.
Response Sample
|
|
获取构建任务状态
GET /kylin/api/jobs/{jobId}
Path variable
jobId
- required
string Job id. 此处构建 cube 时返回的 uuid 即为任务 id
Response Sample
|
|