mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-24 15:58:08 +00:00
Generic forward call to compute node (especially for qemu with require a
lot of call)
This commit is contained in:
parent
e05b0a396e
commit
eaf621cc57
@ -78,7 +78,7 @@ class ComputeHandler:
|
|||||||
response.json(compute)
|
response.json(compute)
|
||||||
|
|
||||||
@Route.get(
|
@Route.get(
|
||||||
r"/computes/{compute_id}/{emulator}/images",
|
r"/computes/{compute_id}/{emulator}/{action}",
|
||||||
parameters={
|
parameters={
|
||||||
"compute_id": "Compute UUID"
|
"compute_id": "Compute UUID"
|
||||||
},
|
},
|
||||||
@ -86,27 +86,11 @@ class ComputeHandler:
|
|||||||
200: "OK",
|
200: "OK",
|
||||||
404: "Instance doesn't exist"
|
404: "Instance doesn't exist"
|
||||||
},
|
},
|
||||||
description="Get the list of images available on remote compute")
|
description="Forward call specific to compute node. Read the full compute API for available actions")
|
||||||
def list_images(request, response):
|
def forward(request, response):
|
||||||
controller = Controller.instance()
|
controller = Controller.instance()
|
||||||
compute = controller.get_compute(request.match_info["compute_id"])
|
compute = controller.get_compute(request.match_info["compute_id"])
|
||||||
images = yield from compute.forward(request.match_info["emulator"], "images")
|
images = yield from compute.forward(request.match_info["emulator"], request.match_info["action"])
|
||||||
response.json(images)
|
|
||||||
|
|
||||||
@Route.get(
|
|
||||||
r"/computes/{compute_id}/{emulator}/vms",
|
|
||||||
parameters={
|
|
||||||
"compute_id": "Compute UUID"
|
|
||||||
},
|
|
||||||
status_codes={
|
|
||||||
200: "OK",
|
|
||||||
404: "Instance doesn't exist"
|
|
||||||
},
|
|
||||||
description="Get the list of vms available on remote compute for VMware an Virtualbox")
|
|
||||||
def list_vms(request, response):
|
|
||||||
controller = Controller.instance()
|
|
||||||
compute = controller.get_compute(request.match_info["compute_id"])
|
|
||||||
images = yield from compute.forward(request.match_info["emulator"], "vms")
|
|
||||||
response.json(images)
|
response.json(images)
|
||||||
|
|
||||||
@Route.get(
|
@Route.get(
|
||||||
|
Loading…
Reference in New Issue
Block a user