mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
Send a field status in the node object
This commit is contained in:
parent
d43e78a1d7
commit
2857d9a070
@ -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
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user