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 -
requiredString项目名 - description -
optionalString项目描述
导入 hive table
POST /kylin/api/tables/{tables}/{project}
Request Parameters
- tables -
requiredstring需要导入的表名,用 , 分隔 - project -
requiredString导入的目标项目
Response Sample
|
|
保存 model
POST /kylin/api/models
ModelController.java
Request Body
- project -
requiredString项目名 - modelName -
requiredStringModel 名 - modelDescData -
requiredStringmodel 描述字符串,json 中必须用字符串,即 “ 用 \” 表示,详见下面例子
post json 请求示例
|
|
Response Sample
|
|
保存 cube 详细配置
POST /kylin/api/cubes
CubeController.java
Request Body
- project -
requiredString项目名 - cubeName -
requiredStringCube 名 - cubeDescData -
requiredStringcube 描述字符串,json 中必须用字符串,即 “ 用 \” 表示,详见下面例子
Curl Example
|
|
post json 示例
|
|
Response Sample
|
|
构建 Cube
PUT /kylin/api/cubes/{cubeName}/rebuild
Path Variable
cubeName -
requiredstringCube name.
Request BodystartTime -
requiredlongStart timestamp of data to build, e.g. 1388563200000 for 2014-1-1- endTime -
requiredlongEnd timestamp of data to build- - buildType -
requiredstringSupported build type: ‘BUILD’, ‘MERGE’, ‘REFRESH’
获取 Cube (查看信息)
GET /kylin/api/cubes/{cubeName}
###Path Variable
- cubeName -
requiredstringCube name to find.
GET /kylin/api/cube_desc/{cubeName}
Get descriptor for specified cube instance.
Path Variable
- cubeName -
requiredstringCube name.
Response Sample
|
|
获取构建任务状态
GET /kylin/api/jobs/{jobId}
Path variable
jobId - required string Job id. 此处构建 cube 时返回的 uuid 即为任务 id
Response Sample
|
|
