Fix VMware support

This commit is contained in:
Julien Duponchelle 2016-07-12 16:29:58 +02:00
parent b98d4cb042
commit fd0e8f89db
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
3 changed files with 8 additions and 57 deletions

View File

@ -88,7 +88,8 @@ class VMwareVM(BaseNode):
"adapter_type": self.adapter_type, "adapter_type": self.adapter_type,
"use_any_adapter": self.use_any_adapter, "use_any_adapter": self.use_any_adapter,
"status": self.status, "status": self.status,
"node_directory": self.working_dir} "node_directory": self.working_dir,
"linked_clone": self._linked_clone}
return json return json
@property @property

View File

@ -26,7 +26,6 @@ from gns3server.compute.project_manager import ProjectManager
from gns3server.schemas.vmware import ( from gns3server.schemas.vmware import (
VMWARE_CREATE_SCHEMA, VMWARE_CREATE_SCHEMA,
VMWARE_UPDATE_SCHEMA,
VMWARE_OBJECT_SCHEMA VMWARE_OBJECT_SCHEMA
) )
@ -100,7 +99,7 @@ class VMwareHandler:
409: "Conflict" 409: "Conflict"
}, },
description="Update a VMware VM instance", description="Update a VMware VM instance",
input=VMWARE_UPDATE_SCHEMA, input=VMWARE_OBJECT_SCHEMA,
output=VMWARE_OBJECT_SCHEMA) output=VMWARE_OBJECT_SCHEMA)
def update(request, response): def update(request, response):

View File

@ -80,58 +80,6 @@ VMWARE_CREATE_SCHEMA = {
"required": ["name", "vmx_path", "linked_clone"], "required": ["name", "vmx_path", "linked_clone"],
} }
VMWARE_UPDATE_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request validation to update a VMware VM instance",
"type": "object",
"properties": {
"name": {
"description": "VMware VM instance name",
"type": "string",
"minLength": 1,
},
"vmx_path": {
"description": "Path to the vmx file",
"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"
},
"headless": {
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
"description": "ACPI shutdown",
"type": "boolean"
},
"adapters": {
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 10, # maximum adapters support by VMware VMs
},
"adapter_type": {
"description": "VMware adapter type",
"type": "string",
"minLength": 1,
},
"use_any_adapter": {
"description": "Allow GNS3 to use any VMware adapter",
"type": "boolean",
},
},
"additionalProperties": False,
}
VMWARE_OBJECT_SCHEMA = { VMWARE_OBJECT_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
@ -203,7 +151,10 @@ VMWARE_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"]
} }