mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +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._properties = properties
|
||||||
self._command_line = None
|
self._command_line = None
|
||||||
self._node_directory = None
|
self._node_directory = None
|
||||||
|
self._status = "stopped"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def status(self):
|
||||||
|
return self._status
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return self._name
|
return self._name
|
||||||
@ -236,5 +241,6 @@ class Node:
|
|||||||
"console": self._console,
|
"console": self._console,
|
||||||
"console_type": self._console_type,
|
"console_type": self._console_type,
|
||||||
"command_line": self._command_line,
|
"command_line": self._command_line,
|
||||||
"properties": self._properties
|
"properties": self._properties,
|
||||||
|
"status": self._status
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,10 @@ NODE_OBJECT_SCHEMA = {
|
|||||||
"properties": {
|
"properties": {
|
||||||
"description": "Properties specific to an emulator",
|
"description": "Properties specific to an emulator",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"description": "Status of the node",
|
||||||
|
"enum": ["stopped", "started"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
|
@ -57,7 +57,8 @@ def test_json(node, compute):
|
|||||||
"console_type": node.console_type,
|
"console_type": node.console_type,
|
||||||
"command_line": None,
|
"command_line": None,
|
||||||
"node_directory": None,
|
"node_directory": None,
|
||||||
"properties": node.properties
|
"properties": node.properties,
|
||||||
|
"status": node.status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user