mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Return status in all cases
This commit is contained in:
parent
c4ebdc0e37
commit
f052299eb1
@ -108,6 +108,7 @@ class DockerVM(BaseNode):
|
|||||||
"console_http_path": self.console_http_path,
|
"console_http_path": self.console_http_path,
|
||||||
"aux": self.aux,
|
"aux": self.aux,
|
||||||
"start_command": self.start_command,
|
"start_command": self.start_command,
|
||||||
|
"status": self.status,
|
||||||
"environment": self.environment,
|
"environment": self.environment,
|
||||||
"node_directory": self.working_dir
|
"node_directory": self.working_dir
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,7 @@ class Router(BaseNode):
|
|||||||
"disk0": self._disk0,
|
"disk0": self._disk0,
|
||||||
"disk1": self._disk1,
|
"disk1": self._disk1,
|
||||||
"auto_delete_disks": self._auto_delete_disks,
|
"auto_delete_disks": self._auto_delete_disks,
|
||||||
|
"status": self.status,
|
||||||
"console": self.console,
|
"console": self.console,
|
||||||
"console_type": "telnet",
|
"console_type": "telnet",
|
||||||
"aux": self.aux,
|
"aux": self.aux,
|
||||||
|
@ -205,6 +205,8 @@ class IOUVM(BaseNode):
|
|||||||
"node_id": self.id,
|
"node_id": self.id,
|
||||||
"node_directory": self.working_dir,
|
"node_directory": self.working_dir,
|
||||||
"console": self._console,
|
"console": self._console,
|
||||||
|
"console_type": "telnet",
|
||||||
|
"status": self.status,
|
||||||
"project_id": self.project.id,
|
"project_id": self.project.id,
|
||||||
"path": self.path,
|
"path": self.path,
|
||||||
"md5sum": gns3server.utils.images.md5sum(self.path),
|
"md5sum": gns3server.utils.images.md5sum(self.path),
|
||||||
|
@ -85,6 +85,7 @@ class VirtualBoxVM(BaseNode):
|
|||||||
"adapters": self._adapters,
|
"adapters": self._adapters,
|
||||||
"adapter_type": self.adapter_type,
|
"adapter_type": self.adapter_type,
|
||||||
"ram": self.ram,
|
"ram": self.ram,
|
||||||
|
"status": self.status,
|
||||||
"use_any_adapter": self.use_any_adapter}
|
"use_any_adapter": self.use_any_adapter}
|
||||||
if self._linked_clone:
|
if self._linked_clone:
|
||||||
json["node_directory"] = self.working_dir
|
json["node_directory"] = self.working_dir
|
||||||
|
@ -91,6 +91,7 @@ class VMwareVM(BaseNode):
|
|||||||
"adapter_type": self.adapter_type,
|
"adapter_type": self.adapter_type,
|
||||||
"use_ubridge": self.use_ubridge,
|
"use_ubridge": self.use_ubridge,
|
||||||
"use_any_adapter": self.use_any_adapter,
|
"use_any_adapter": self.use_any_adapter,
|
||||||
|
"status": self.status,
|
||||||
"node_directory": self.working_dir}
|
"node_directory": self.working_dir}
|
||||||
return json
|
return json
|
||||||
|
|
||||||
|
@ -233,7 +233,11 @@ DOCKER_OBJECT_SCHEMA = {
|
|||||||
"node_directory": {
|
"node_directory": {
|
||||||
"description": "Path to the node working directory",
|
"description": "Path to the node working directory",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "VM status",
|
||||||
|
"enum": ["started", "stopped", "suspended"]
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
"required": ["node_id",
|
"required": ["node_id",
|
||||||
@ -247,7 +251,8 @@ DOCKER_OBJECT_SCHEMA = {
|
|||||||
"console_resolution",
|
"console_resolution",
|
||||||
"start_command",
|
"start_command",
|
||||||
"environment",
|
"environment",
|
||||||
"node_directory"]
|
"node_directory",
|
||||||
|
"status"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -544,6 +544,10 @@ VM_OBJECT_SCHEMA = {
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "VM status",
|
||||||
|
"enum": ["started", "stopped", "suspended"]
|
||||||
|
},
|
||||||
"platform": {
|
"platform": {
|
||||||
"description": "Cisco router platform",
|
"description": "Cisco router platform",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -206,12 +206,20 @@ IOU_OBJECT_SCHEMA = {
|
|||||||
"description": "Path to the node working directory",
|
"description": "Path to the node working directory",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "VM status",
|
||||||
|
"enum": ["started", "stopped", "suspended"]
|
||||||
|
},
|
||||||
"console": {
|
"console": {
|
||||||
"description": "Console TCP port",
|
"description": "Console TCP port",
|
||||||
"minimum": 1,
|
"minimum": 1,
|
||||||
"maximum": 65535,
|
"maximum": 65535,
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"console_type": {
|
||||||
|
"description": "Console type",
|
||||||
|
"enum": ["telnet"]
|
||||||
|
},
|
||||||
"project_id": {
|
"project_id": {
|
||||||
"description": "Project UUID",
|
"description": "Project UUID",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -397,6 +397,10 @@ QEMU_OBJECT_SCHEMA = {
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "VM status",
|
||||||
|
"enum": ["started", "stopped", "suspended"]
|
||||||
|
},
|
||||||
"usage": {
|
"usage": {
|
||||||
"description": "How to use the QEMU VM",
|
"description": "How to use the QEMU VM",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -603,7 +607,8 @@ QEMU_OBJECT_SCHEMA = {
|
|||||||
"process_priority",
|
"process_priority",
|
||||||
"options",
|
"options",
|
||||||
"node_directory",
|
"node_directory",
|
||||||
"command_line"]
|
"command_line",
|
||||||
|
"status"]
|
||||||
}
|
}
|
||||||
|
|
||||||
QEMU_BINARY_FILTER_SCHEMA = {
|
QEMU_BINARY_FILTER_SCHEMA = {
|
||||||
|
@ -177,6 +177,10 @@ VBOX_OBJECT_SCHEMA = {
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
},
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "VM status",
|
||||||
|
"enum": ["started", "stopped", "suspended"]
|
||||||
|
},
|
||||||
"node_directory": {
|
"node_directory": {
|
||||||
"decription": "Path to the VM working directory",
|
"decription": "Path to the VM working directory",
|
||||||
"type": ["string", "null"]
|
"type": ["string", "null"]
|
||||||
|
@ -158,6 +158,10 @@ VMWARE_OBJECT_SCHEMA = {
|
|||||||
"maxLength": 36,
|
"maxLength": 36,
|
||||||
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
|
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
|
||||||
},
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "VM status",
|
||||||
|
"enum": ["started", "stopped", "suspended"]
|
||||||
|
},
|
||||||
"node_directory": {
|
"node_directory": {
|
||||||
"decription": "Path to the node working directory",
|
"decription": "Path to the node working directory",
|
||||||
"type": ["string", "null"]
|
"type": ["string", "null"]
|
||||||
|
@ -110,7 +110,7 @@ VPCS_OBJECT_SCHEMA = {
|
|||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"description": "VM status",
|
"description": "VM status",
|
||||||
"enum": ["started", "stopped"]
|
"enum": ["started", "stopped", "suspended"]
|
||||||
},
|
},
|
||||||
"console": {
|
"console": {
|
||||||
"description": "Console TCP port",
|
"description": "Console TCP port",
|
||||||
|
@ -63,7 +63,8 @@ def test_json(vm, project):
|
|||||||
'aux': vm.aux,
|
'aux': vm.aux,
|
||||||
'start_command': vm.start_command,
|
'start_command': vm.start_command,
|
||||||
'environment': vm.environment,
|
'environment': vm.environment,
|
||||||
'node_directory': vm.working_dir
|
'node_directory': vm.working_dir,
|
||||||
|
'status': 'stopped'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user