官网API文档
补充API文档
Project API
project base url:
http://{host}:{port}/kylin/api/projects
create project
curl -X POST -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" -d '{"name":"api\_create\_project","description":"api test"}' http://172.17.1.183:7070/kylin/api/projects
响应:
{
"uuid": "ba8ca4b3-552f-4a74-891a-e46b28404bdd",
"last\_modified": 1506326825236,
"version": "1.6.0",
"name": "api\_create\_project",
"tables": [],
"owner": "ADMIN",
"status": "ENABLED",
"create\_time\_utc": 1506326825236,
"last\_update\_time": null,
"description": "api test",
"realizations": [],
"models": [],
"ext\_filters": []
}
drop project
{projectName}
curl -X DELETE -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" http://172.17.1.183:7070/kylin/api/projects/api\_create\_project
Model API
model base url:
http://{host}:{port}/kylin/api/models
create model
request: POST http://{host}:{port}/kylin/api/models
param: {
"uuid": "",
"modelName": "user_active_model_create_test",
"modelDescData": "{\"uuid\":\"\",\"last_modified\":0,\"version\":\"1.6.0\",\"name\":\"user_active_model_create_test\",\"owner\":\"ADMIN\",\"description\":\"用户活跃统计模型\",\"fact_table\":\"TEST.ODS_SERVICE_ORDER_VIEW\",\"lookups\":[],\"dimensions\":[{\"table\":\"TEST.ODS_SERVICE_ORDER_VIEW\",\"columns\":[\"DM_CITY_NAME\",\"DM_CORPORATE_TYPE\",\"DM_IS_TEST_USER\",\"DM_ORDER_SOURCE\",\"DM_ORDER_STATUS\",\"DM_ORIGIN_AMOUNT_COMPARE\",\"DT\"]}],\"metrics\":[\"USER_ID\"],\"filter_condition\":\"\",\"partition_desc\":{\"partition_date_column\":\"TEST.ODS_SERVICE_ORDER_VIEW.DT\",\"partition_time_column\":null,\"partition_date_start\":0,\"partition_date_format\":\"yyyyMMdd\",\"partition_time_format\":\"HH:mm:ss\",\"partition_type\":\"APPEND\",\"partition_condition_builder\":\"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\":\"MEDIUM\"}",
"successful": false,
"message": "",
"project": "user_register_project"
}
example:
curl -X POST -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" -d '{"uuid":"","modelName":"user\_active\_model\_create\_test","modelDescData":"{\"uuid\":\"\",\"last\_modified\":0,\"version\":\"1.6.0\",\"name\":\"user\_active\_model\_create\_test\",\"owner\":\"ADMIN\",\"description\":\"用户活跃统计模型\",\"fact\_table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"lookups\":[],\"dimensions\":[{\"table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"columns\":[\"DM\_CITY\_NAME\",\"DM\_CORPORATE\_TYPE\",\"DM\_IS\_TEST\_USER\",\"DM\_ORDER\_SOURCE\",\"DM\_ORDER\_STATUS\",\"DM\_ORIGIN\_AMOUNT\_COMPARE\",\"DT\"]}],\"metrics\":[\"USER\_ID\"],\"filter\_condition\":\"\",\"partition\_desc\":{\"partition\_date\_column\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW.DT\",\"partition\_time\_column\":null,\"partition\_date\_start\":0,\"partition\_date\_format\":\"yyyyMMdd\",\"partition\_time\_format\":\"HH:mm:ss\",\"partition\_type\":\"APPEND\",\"partition\_condition\_builder\":\"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\":\"MEDIUM\"}","successful":false,"message":"","project":"user\_register\_project"}' http://172.17.1.183:7070/kylin/api/models
响应:
{
"uuid": "7edea2a5-4967-4c19-81ad-aafb513d5c7c",
"modelName": "user\_active\_model\_create\_test",
"modelDescData": "{\"uuid\":\"\",\"last\_modified\":0,\"version\":\"1.6.0\",\"name\":\"user\_active\_model\_create\_test\",\"owner\":\"ADMIN\",\"description\":\"用户活跃统计模型\",\"fact\_table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"lookups\":[],\"dimensions\":[{\"table\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW\",\"columns\":[\"DM\_CITY\_NAME\",\"DM\_CORPORATE\_TYPE\",\"DM\_IS\_TEST\_USER\",\"DM\_ORDER\_SOURCE\",\"DM\_ORDER\_STATUS\",\"DM\_ORIGIN\_AMOUNT\_COMPARE\",\"DT\"]}],\"metrics\":[\"USER\_ID\"],\"filter\_condition\":\"\",\"partition\_desc\":{\"partition\_date\_column\":\"TEST.ODS\_SERVICE\_ORDER\_VIEW.DT\",\"partition\_time\_column\":null,\"partition\_date\_start\":0,\"partition\_date\_format\":\"yyyyMMdd\",\"partition\_time\_format\":\"HH:mm:ss\",\"partition\_type\":\"APPEND\",\"partition\_condition\_builder\":\"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder\"},\"capacity\":\"MEDIUM\"}",
"successful": true,
"message": "",
"project": "user\_register\_project"
}
drop model
{modelName}
curl -X DELETE -H "Authorization: Basic QURNSU46S1lMSU4=" -H "Content-Type: application/json" http://172.17.1.183:7070/kylin/api/models/user\_active\_model\_create\_test
Cube API
cube base url:
http://{host}:{port}/kylin/api/cubes
create cube
request: POST http://{host}:{port}/kylin/api/cubes
param: {
"uuid": "",
"cubeName": "driver_active_count_cube_create_test",
"cubeDescData": "{\"uuid\":\"\",\"last_modified\":0,\"version\":\"1.6.0\",\"name\":\"driver_active_count_cube_create_test\",\"model_name\":\"driver_active_model\",\"description\":\"\",\"null_string\":null,\"dimensions\":[{\"name\":\"DM_CITY_NAME\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CITY_NAME\",\"derived\":null},{\"name\":\"DM_CAR_TYPE_ID\",\"table\":\"TEST.ODS_SERVICE_ORDER_DRIVER_VIEW\",\"column\":\"DM_CAR_TYPE_ID\",\"derived\":null},{\"na