mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-18 06:18: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)
|
||||
|
||||
@Route.get(
|
||||
r"/computes/{compute_id}/{emulator}/images",
|
||||
r"/computes/{compute_id}/{emulator}/{action}",
|
||||
parameters={
|
||||
"compute_id": "Compute UUID"
|
||||
},
|
||||
@ -86,27 +86,11 @@ class ComputeHandler:
|
||||
200: "OK",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Get the list of images available on remote compute")
|
||||
def list_images(request, response):
|
||||
description="Forward call specific to compute node. Read the full compute API for available actions")
|
||||
def forward(request, response):
|
||||
controller = Controller.instance()
|
||||
compute = controller.get_compute(request.match_info["compute_id"])
|
||||
images = yield from compute.forward(request.match_info["emulator"], "images")
|
||||
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")
|
||||
images = yield from compute.forward(request.match_info["emulator"], request.match_info["action"])
|
||||
response.json(images)
|
||||
|
||||
@Route.get(
|
||||
|
Loading…
Reference in New Issue
Block a user