diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index c26d9637..eb83f020 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -86,7 +86,8 @@ class VirtualBoxVM(BaseNode): "adapter_type": self.adapter_type, "ram": self.ram, "status": self.status, - "use_any_adapter": self.use_any_adapter} + "use_any_adapter": self.use_any_adapter, + "linked_clone": self._linked_clone} if self._linked_clone: json["node_directory"] = self.working_dir else: diff --git a/gns3server/handlers/api/compute/virtualbox_handler.py b/gns3server/handlers/api/compute/virtualbox_handler.py index 26a041a2..7ff865f5 100644 --- a/gns3server/handlers/api/compute/virtualbox_handler.py +++ b/gns3server/handlers/api/compute/virtualbox_handler.py @@ -26,7 +26,6 @@ from gns3server.compute.project_manager import ProjectManager from gns3server.schemas.virtualbox import ( VBOX_CREATE_SCHEMA, - VBOX_UPDATE_SCHEMA, VBOX_OBJECT_SCHEMA ) @@ -109,7 +108,7 @@ class VirtualBoxHandler: 409: "Conflict" }, description="Update a VirtualBox VM instance", - input=VBOX_UPDATE_SCHEMA, + input=VBOX_OBJECT_SCHEMA, output=VBOX_OBJECT_SCHEMA) def update(request, response): diff --git a/gns3server/schemas/virtualbox.py b/gns3server/schemas/virtualbox.py index 9ddcfe73..c55be950 100644 --- a/gns3server/schemas/virtualbox.py +++ b/gns3server/schemas/virtualbox.py @@ -89,64 +89,6 @@ VBOX_CREATE_SCHEMA = { "required": ["name", "vmname", "linked_clone"], } -VBOX_UPDATE_SCHEMA = { - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Request validation to update a VirtualBox VM instance", - "type": "object", - "properties": { - "name": { - "description": "VirtualBox VM instance name", - "type": "string", - "minLength": 1, - }, - "vmname": { - "description": "VirtualBox VM name (in VirtualBox itself)", - "type": "string", - "minLength": 1, - }, - "adapters": { - "description": "Number of adapters", - "type": "integer", - "minimum": 0, - "maximum": 36, # maximum given by the ICH9 chipset in VirtualBox - }, - "use_any_adapter": { - "description": "Allow GNS3 to use any VirtualBox adapter", - "type": "boolean", - }, - "adapter_type": { - "description": "VirtualBox adapter type", - "type": "string", - "minLength": 1, - }, - "console": { - "description": "Console TCP port", - "minimum": 1, - "maximum": 65535, - "type": "integer" - }, - "enable_remote_console": { - "description": "Enable the remote console", - "type": "boolean" - }, - "ram": { - "description": "Amount of RAM", - "minimum": 0, - "maximum": 65535, - "type": "integer" - }, - "headless": { - "description": "Headless mode", - "type": "boolean" - }, - "acpi_shutdown": { - "description": "ACPI shutdown", - "type": "boolean" - }, - }, - "additionalProperties": False, -} - VBOX_OBJECT_SCHEMA = { "$schema": "http://json-schema.org/draft-04/schema#", @@ -224,7 +166,10 @@ VBOX_OBJECT_SCHEMA = { "maximum": 65535, "type": "integer" }, + "linked_clone": { + "description": "Whether the VM is a linked clone or not", + "type": "boolean" + } }, "additionalProperties": False, - "required": ["name", "node_id", "project_id", "node_directory"] }