summaryrefslogtreecommitdiffstats
path: root/api/escalator/installer/daisy/api.py
diff options
context:
space:
mode:
authorJing Sun <sun.jing22@zte.com.cn>2017-03-06 17:11:21 +0800
committerJing Sun <sun.jing22@zte.com.cn>2017-03-11 06:52:33 +0000
commit3e90898f667afa508137e7be885daa62fbdb86d9 (patch)
tree189c76039b5463880055c59f866eec3a071017ac /api/escalator/installer/daisy/api.py
parenta0625dbf2ffef08a492ffdaed641e62b90aa6ad6 (diff)
Jira ESCALATOR-41:get cluster list from installer
Change-Id: Ie3cd22b2f8398ec893686445ac85da7e69ffffb7 Signed-off-by: Jing Sun <sun.jing22@zte.com.cn>
Diffstat (limited to 'api/escalator/installer/daisy/api.py')
-rw-r--r--api/escalator/installer/daisy/api.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/api/escalator/installer/daisy/api.py b/api/escalator/installer/daisy/api.py
new file mode 100644
index 0000000..661d0d5
--- /dev/null
+++ b/api/escalator/installer/daisy/api.py
@@ -0,0 +1,14 @@
+from daisyclient.v1 import client as daisy_client
+
+
+def daisyclient(request):
+ DAISY_ENDPOINT_URL = "http://127.0.0.1:19292"
+ return daisy_client.Client(version=1, endpoint=DAISY_ENDPOINT_URL)
+
+
+def cluster_list(request):
+ return daisyclient(request).clusters.list()
+
+
+def cluster_get(request, cluster_id):
+ return daisyclient(request).clusters.get(cluster_id)