diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index e35d04e3..a6097b24 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -108,6 +108,7 @@ class DockerVM(BaseNode): "console_http_path": self.console_http_path, "aux": self.aux, "start_command": self.start_command, + "status": self.status, "environment": self.environment, "node_directory": self.working_dir } diff --git a/gns3server/compute/dynamips/nodes/router.py b/gns3server/compute/dynamips/nodes/router.py index 1a975435..ace73b78 100644 --- a/gns3server/compute/dynamips/nodes/router.py +++ b/gns3server/compute/dynamips/nodes/router.py @@ -132,6 +132,7 @@ class Router(BaseNode): "disk0": self._disk0, "disk1": self._disk1, "auto_delete_disks": self._auto_delete_disks, + "status": self.status, "console": self.console, "console_type": "telnet", "aux": self.aux, diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 1e01570e..ad3647e0 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -205,6 +205,8 @@ class IOUVM(BaseNode): "node_id": self.id, "node_directory": self.working_dir, "console": self._console, + "console_type": "telnet", + "status": self.status, "project_id": self.project.id, "path": self.path, "md5sum": gns3server.utils.images.md5sum(self.path), diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index 26fe0c83..69260390 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -85,6 +85,7 @@ class VirtualBoxVM(BaseNode): "adapters": self._adapters, "adapter_type": self.adapter_type, "ram": self.ram, + "status": self.status, "use_any_adapter": self.use_any_adapter} if self._linked_clone: json["node_directory"] = self.working_dir diff --git a/gns3server/compute/vmware/vmware_vm.py b/gns3server/compute/vmware/vmware_vm.py index 4c3b5bc9..dc2feb60 100644 --- a/gns3server/compute/vmware/vmware_vm.py +++ b/gns3server/compute/vmware/vmware_vm.py @@ -91,6 +91,7 @@ class VMwareVM(BaseNode): "adapter_type": self.adapter_type, "use_ubridge": self.use_ubridge, "use_any_adapter": self.use_any_adapter, + "status": self.status, "node_directory": self.working_dir} return json diff --git a/gns3server/schemas/docker.py b/gns3server/schemas/docker.py index e922a15f..d0d22ee3 100644 --- a/gns3server/schemas/docker.py +++ b/gns3server/schemas/docker.py @@ -233,7 +233,11 @@ DOCKER_OBJECT_SCHEMA = { "node_directory": { "description": "Path to the node working directory", "type": "string" - } + }, + "status": { + "description": "VM status", + "enum": ["started", "stopped", "suspended"] + }, }, "additionalProperties": False, "required": ["node_id", @@ -247,7 +251,8 @@ DOCKER_OBJECT_SCHEMA = { "console_resolution", "start_command", "environment", - "node_directory"] + "node_directory", + "status"] } diff --git a/gns3server/schemas/dynamips_vm.py b/gns3server/schemas/dynamips_vm.py index aa47a31f..94b236f6 100644 --- a/gns3server/schemas/dynamips_vm.py +++ b/gns3server/schemas/dynamips_vm.py @@ -544,6 +544,10 @@ VM_OBJECT_SCHEMA = { "type": "string", "minLength": 1, }, + "status": { + "description": "VM status", + "enum": ["started", "stopped", "suspended"] + }, "platform": { "description": "Cisco router platform", "type": "string", diff --git a/gns3server/schemas/iou.py b/gns3server/schemas/iou.py index 599ece73..42c3177f 100644 --- a/gns3server/schemas/iou.py +++ b/gns3server/schemas/iou.py @@ -206,12 +206,20 @@ IOU_OBJECT_SCHEMA = { "description": "Path to the node working directory", "type": "string" }, + "status": { + "description": "VM status", + "enum": ["started", "stopped", "suspended"] + }, "console": { "description": "Console TCP port", "minimum": 1, "maximum": 65535, "type": "integer" }, + "console_type": { + "description": "Console type", + "enum": ["telnet"] + }, "project_id": { "description": "Project UUID", "type": "string", diff --git a/gns3server/schemas/qemu.py b/gns3server/schemas/qemu.py index dd7e6513..d06f30ee 100644 --- a/gns3server/schemas/qemu.py +++ b/gns3server/schemas/qemu.py @@ -397,6 +397,10 @@ QEMU_OBJECT_SCHEMA = { "type": "string", "minLength": 1, }, + "status": { + "description": "VM status", + "enum": ["started", "stopped", "suspended"] + }, "usage": { "description": "How to use the QEMU VM", "type": "string", @@ -603,7 +607,8 @@ QEMU_OBJECT_SCHEMA = { "process_priority", "options", "node_directory", - "command_line"] + "command_line", + "status"] } QEMU_BINARY_FILTER_SCHEMA = { diff --git a/gns3server/schemas/virtualbox.py b/gns3server/schemas/virtualbox.py index 46d851ee..9ddcfe73 100644 --- a/gns3server/schemas/virtualbox.py +++ b/gns3server/schemas/virtualbox.py @@ -177,6 +177,10 @@ VBOX_OBJECT_SCHEMA = { "type": "string", "minLength": 1, }, + "status": { + "description": "VM status", + "enum": ["started", "stopped", "suspended"] + }, "node_directory": { "decription": "Path to the VM working directory", "type": ["string", "null"] diff --git a/gns3server/schemas/vmware.py b/gns3server/schemas/vmware.py index 3b05b48b..1fdbde5c 100644 --- a/gns3server/schemas/vmware.py +++ b/gns3server/schemas/vmware.py @@ -158,6 +158,10 @@ VMWARE_OBJECT_SCHEMA = { "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}$" }, + "status": { + "description": "VM status", + "enum": ["started", "stopped", "suspended"] + }, "node_directory": { "decription": "Path to the node working directory", "type": ["string", "null"] diff --git a/gns3server/schemas/vpcs.py b/gns3server/schemas/vpcs.py index 80d698d2..c85949af 100644 --- a/gns3server/schemas/vpcs.py +++ b/gns3server/schemas/vpcs.py @@ -110,7 +110,7 @@ VPCS_OBJECT_SCHEMA = { }, "status": { "description": "VM status", - "enum": ["started", "stopped"] + "enum": ["started", "stopped", "suspended"] }, "console": { "description": "Console TCP port", diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index 4dec6e43..fdd34255 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -63,7 +63,8 @@ def test_json(vm, project): 'aux': vm.aux, 'start_command': vm.start_command, 'environment': vm.environment, - 'node_directory': vm.working_dir + 'node_directory': vm.working_dir, + 'status': 'stopped' }