mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Fix Virtualbox support
This commit is contained in:
parent
9cd3231de3
commit
b98d4cb042
@ -86,7 +86,8 @@ class VirtualBoxVM(BaseNode):
|
|||||||
"adapter_type": self.adapter_type,
|
"adapter_type": self.adapter_type,
|
||||||
"ram": self.ram,
|
"ram": self.ram,
|
||||||
"status": self.status,
|
"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:
|
if self._linked_clone:
|
||||||
json["node_directory"] = self.working_dir
|
json["node_directory"] = self.working_dir
|
||||||
else:
|
else:
|
||||||
|
@ -26,7 +26,6 @@ from gns3server.compute.project_manager import ProjectManager
|
|||||||
|
|
||||||
from gns3server.schemas.virtualbox import (
|
from gns3server.schemas.virtualbox import (
|
||||||
VBOX_CREATE_SCHEMA,
|
VBOX_CREATE_SCHEMA,
|
||||||
VBOX_UPDATE_SCHEMA,
|
|
||||||
VBOX_OBJECT_SCHEMA
|
VBOX_OBJECT_SCHEMA
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ class VirtualBoxHandler:
|
|||||||
409: "Conflict"
|
409: "Conflict"
|
||||||
},
|
},
|
||||||
description="Update a VirtualBox VM instance",
|
description="Update a VirtualBox VM instance",
|
||||||
input=VBOX_UPDATE_SCHEMA,
|
input=VBOX_OBJECT_SCHEMA,
|
||||||
output=VBOX_OBJECT_SCHEMA)
|
output=VBOX_OBJECT_SCHEMA)
|
||||||
def update(request, response):
|
def update(request, response):
|
||||||
|
|
||||||
|
@ -89,64 +89,6 @@ VBOX_CREATE_SCHEMA = {
|
|||||||
"required": ["name", "vmname", "linked_clone"],
|
"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 = {
|
VBOX_OBJECT_SCHEMA = {
|
||||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||||
@ -224,7 +166,10 @@ VBOX_OBJECT_SCHEMA = {
|
|||||||
"maximum": 65535,
|
"maximum": 65535,
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"linked_clone": {
|
||||||
|
"description": "Whether the VM is a linked clone or not",
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
"required": ["name", "node_id", "project_id", "node_directory"]
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user