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
2016-02-02 18:25:17 +01:00
parent 71c3bda0a5
commit fd22cd8361
16 changed files with 67 additions and 31 deletions

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(