Merge "Add /node-list to the webapp"
This commit is contained in:
commit
e359c6018b
@ -102,6 +102,10 @@ def node_list(zk, node_id=None, detail=False):
|
|||||||
return str(t)
|
return str(t)
|
||||||
|
|
||||||
|
|
||||||
|
def node_list_json(zk):
|
||||||
|
return json.dumps([node.toDict() for node in zk.nodeIterator()])
|
||||||
|
|
||||||
|
|
||||||
def dib_image_list(zk):
|
def dib_image_list(zk):
|
||||||
t = PrettyTable(["ID", "Image", "Builder", "Formats",
|
t = PrettyTable(["ID", "Image", "Builder", "Formats",
|
||||||
"State", "Age"])
|
"State", "Age"])
|
||||||
|
@ -83,6 +83,10 @@ class WebApp(threading.Thread):
|
|||||||
output = status.dib_image_list(self.nodepool.getZK())
|
output = status.dib_image_list(self.nodepool.getZK())
|
||||||
elif path == '/dib-image-list.json':
|
elif path == '/dib-image-list.json':
|
||||||
output = status.dib_image_list_json(self.nodepool.getZK())
|
output = status.dib_image_list_json(self.nodepool.getZK())
|
||||||
|
elif path == '/node-list':
|
||||||
|
output = status.node_list(self.nodepool.getZK())
|
||||||
|
elif path == '/node-list.json':
|
||||||
|
output = status.node_list_json(self.nodepool.getZK())
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
return self.cache.put(path, output)
|
return self.cache.put(path, output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user