diff --git a/gns3server/controller/node.py b/gns3server/controller/node.py index c19b45d0..98d296c2 100644 --- a/gns3server/controller/node.py +++ b/gns3server/controller/node.py @@ -49,11 +49,16 @@ class Node: self._properties = properties self._command_line = None self._node_directory = None + self._status = "stopped" @property def id(self): return self._id + @property + def status(self): + return self._status + @property def name(self): return self._name @@ -236,5 +241,6 @@ class Node: "console": self._console, "console_type": self._console_type, "command_line": self._command_line, - "properties": self._properties + "properties": self._properties, + "status": self._status } diff --git a/gns3server/schemas/node.py b/gns3server/schemas/node.py index ba274f21..d9575adf 100644 --- a/gns3server/schemas/node.py +++ b/gns3server/schemas/node.py @@ -113,6 +113,10 @@ NODE_OBJECT_SCHEMA = { "properties": { "description": "Properties specific to an emulator", "type": "object" + }, + "status": { + "description": "Status of the node", + "enum": ["stopped", "started"] } }, "additionalProperties": False, diff --git a/tests/controller/test_node.py b/tests/controller/test_node.py index 29f88f4f..dfcfcadd 100644 --- a/tests/controller/test_node.py +++ b/tests/controller/test_node.py @@ -57,7 +57,8 @@ def test_json(node, compute): "console_type": node.console_type, "command_line": None, "node_directory": None, - "properties": node.properties + "properties": node.properties, + "status": node.status }