1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Send a field status in the node object

This commit is contained in:
Julien Duponchelle 2016-05-12 19:15:46 +02:00
parent d43e78a1d7
commit 2857d9a070
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
3 changed files with 13 additions and 2 deletions

View File

@ -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
}

View File

@ -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,

View File

@ -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
}