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)
|
||||
|
||||
|
||||
def node_list_json(zk):
|
||||
return json.dumps([node.toDict() for node in zk.nodeIterator()])
|
||||
|
||||
|
||||
def dib_image_list(zk):
|
||||
t = PrettyTable(["ID", "Image", "Builder", "Formats",
|
||||
"State", "Age"])
|
||||
|
@ -83,6 +83,10 @@ class WebApp(threading.Thread):
|
||||
output = status.dib_image_list(self.nodepool.getZK())
|
||||
elif path == '/dib-image-list.json':
|
||||
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:
|
||||
return None
|
||||
return self.cache.put(path, output)
|
||||
|
Loading…
Reference in New Issue
Block a user