mirror of
https://github.com/GNS3/gns3-server
synced 2025-02-13 00:22:37 +00:00
Return array for controller statistics endpoint
This commit is contained in:
parent
3df348ac2a
commit
a62168fde0
@ -139,11 +139,11 @@ class ServerHandler:
|
|||||||
})
|
})
|
||||||
async def statistics(request, response):
|
async def statistics(request, response):
|
||||||
|
|
||||||
compute_statistics = {}
|
compute_statistics = []
|
||||||
for compute in list(Controller.instance().computes.values()):
|
for compute in list(Controller.instance().computes.values()):
|
||||||
try:
|
try:
|
||||||
r = await compute.get("/statistics")
|
r = await compute.get("/statistics")
|
||||||
compute_statistics[compute.name] = r.json
|
compute_statistics.append({"compute_id": compute.id, "compute_name": compute.name, "statistics": r.json})
|
||||||
except HTTPConflict as e:
|
except HTTPConflict as e:
|
||||||
log.error("Could not retrieve statistics on compute {}: {}".format(compute.name, e.text))
|
log.error("Could not retrieve statistics on compute {}: {}".format(compute.name, e.text))
|
||||||
response.json(compute_statistics)
|
response.json(compute_statistics)
|
||||||
|
Loading…
Reference in New Issue
Block a user