Send command line used to start the VM to client

Add a command_line attribute to the VM object with
the command line used to start the VM.

Now /start return the object in order to get
this new attribute. And the HTTP status code
is 200 instead of 204 because 204 disallow body.

Support:
* Qemu
* Dynamips
* IOU

Ref https://github.com/GNS3/gns3-gui/issues/513
This commit is contained in:
Julien Duponchelle committed 2016-02-02 18:25:17 +01:00
1 parent 71c3bda0a5
commit fd22cd8361
16 files changed
+67 -31

No files matched your search

+3 -2
View File
@@ -148,11 +148,12 @@ class IOUHandler:
"vm_id": "UUID for the instance"
},
status_codes={
204: "Instance started",
200: "Instance started",
400: "Invalid request",
404: "Instance doesn't exist"
},
input=IOU_START_SCHEMA,
output=IOU_OBJECT_SCHEMA,
description="Start a IOU instance")
def start(request, response):
@@ -166,7 +167,7 @@ class IOUHandler:
print(vm.iourc_path)
yield from vm.start()
response.set_status(204)
response.json(vm)
@classmethod
@Route.post(
+4 -3
View File
@@ -146,11 +146,12 @@ class QEMUHandler:
"vm_id": "UUID for the instance"
},
status_codes={
204: "Instance started",
200: "Instance started",
400: "Invalid request",
404: "Instance doesn't exist"
},
description="Start a Qemu VM instance")
description="Start a Qemu VM instance",
output=QEMU_OBJECT_SCHEMA)
def start(request, response):
qemu_manager = Qemu.instance()
@@ -161,7 +162,7 @@ class QEMUHandler:
if pm.check_hardware_virtualization(vm) is False:
raise HTTPConflict(text="Cannot start VM with KVM enabled because hardware virtualization (VT-x/AMD-V) is already used by another software like VMware or VirtualBox")
yield from vm.start()
response.set_status(204)
response.json(vm)
@classmethod
@Route.post(
+3 -2
View File
@@ -130,13 +130,14 @@ class VPCSHandler:
400: "Invalid request",
404: "Instance doesn't exist"
},
description="Start a VPCS instance")
description="Start a VPCS instance",
output=VPCS_OBJECT_SCHEMA)
def start(request, response):
vpcs_manager = VPCS.instance()
vm = vpcs_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
yield from vm.start()
response.set_status(204)
response.json(vm)
@classmethod
@Route.post(