Repository: kylin Updated Branches: refs/heads/master b376e242d -> 139768fcb
KYLIN-1782 API redesign for CubeDesc Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e824c0f7 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e824c0f7 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e824c0f7 Branch: refs/heads/master Commit: e824c0f7b056ff56d613356651ba81d3272d83a0 Parents: b376e24 Author: Jason <jiat...@163.com> Authored: Mon Jun 13 10:28:47 2016 +0800 Committer: Jason <jiat...@163.com> Committed: Mon Jun 13 10:28:47 2016 +0800 ---------------------------------------------------------------------- .../rest/controller/CubeDescController.java | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e824c0f7/server/src/main/java/org/apache/kylin/rest/controller/CubeDescController.java ---------------------------------------------------------------------- diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeDescController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeDescController.java index 0a39634..61584a3 100644 --- a/server/src/main/java/org/apache/kylin/rest/controller/CubeDescController.java +++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeDescController.java @@ -64,6 +64,30 @@ public class CubeDescController { } } + /** + * Get detail information of the "Cube ID" + * return CubeDesc instead of CubeDesc[] + * + * @param cubeDescName + * Cube ID + * @return + * @throws IOException + */ + @RequestMapping(value = "/{cubeName}/desc", method = { RequestMethod.GET }) + @ResponseBody + public CubeDesc getDesc(@PathVariable String cubeName) { + CubeInstance cubeInstance = cubeService.getCubeManager().getCube(cubeName); + if (cubeInstance == null) { + return null; + } + CubeDesc cSchema = cubeInstance.getDescriptor(); + if (cSchema != null) { + return cSchema; + } else { + return null; + } + } + public void setCubeService(CubeService cubeService) { this.cubeService = cubeService; }