由于官方网站的介绍中,涉及的Rest接口较少,现通过官方提供在github上的源码包,使用一些其他实用的Rest接口。
找到Kylin Rest源码:
https://github.com/apache/kylin/tree/master/server-base
到
org.apache.kylin.rest.controller目录下查找对应的controller类
例如:
org.apache.kylin.rest.controller
.CubeController
@Controller
@RequestMapping(value = "/cubes")
public class CubeController extends BasicController {
...
@RequestMapping(value = "/{cubeName}/purge", method = { RequestMethod.PUT })
@ResponseBody
public CubeInstance purgeCube(@PathVariable String cubeName) {
try {
CubeInstance cube = cubeService.getCubeManager().getCube(cubeName);
if (cube == null) {
throw new InternalErrorException("Cannot find cube " + cubeName);
}
return cubeService.purgeCube(cube);
} catch (Exception e) {
String message = "Failed to purge cube: " + cubeName;
logger.error(message, e);
throw new InternalErrorException(message + " Caused by: " + e.getMessage(), e);
}
}
...
}
purge(清空表)的操作Rest为: localhost:7070/kylin/api