1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Updates Ethernet hub schema.

This commit is contained in:
grossmj 2016-05-15 21:01:33 -06:00
parent 7a523990a6
commit c88c67e8ef
2 changed files with 43 additions and 5 deletions

View File

@ -131,7 +131,7 @@ class Controller:
return self._computes[compute_id] return self._computes[compute_id]
except KeyError: except KeyError:
if compute_id == "local": if compute_id == "local":
return self._createLocalCompute() return self._create_local_compute()
raise aiohttp.web.HTTPNotFound(text="Compute ID {} doesn't exist".format(compute_id)) raise aiohttp.web.HTTPNotFound(text="Compute ID {} doesn't exist".format(compute_id))
@asyncio.coroutine @asyncio.coroutine

View File

@ -44,6 +44,20 @@ ETHERNET_HUB_UPDATE_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"description": "Ethernet hub instance", "description": "Ethernet hub instance",
"type": "object", "type": "object",
"definitions": {
"EthernetSwitchPort": {
"description": "Ethernet switch port",
"properties": {
"port": {
"description": "Port number",
"type": "number",
"minimum": 1
},
},
"required": ["port"],
"additionalProperties": False
},
},
"properties": { "properties": {
"name": { "name": {
"description": "Ethernet hub name", "description": "Ethernet hub name",
@ -51,8 +65,13 @@ ETHERNET_HUB_UPDATE_SCHEMA = {
"minLength": 1, "minLength": 1,
}, },
"ports": { "ports": {
"description": "Number of ports", "type": "array",
"type": "integer" "items": [
{"type": "object",
"oneOf": [
{"$ref": "#/definitions/EthernetSwitchPort"}
]},
]
} }
}, },
"additionalProperties": False, "additionalProperties": False,
@ -62,6 +81,20 @@ ETHERNET_HUB_OBJECT_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"description": "Ethernet hub instance", "description": "Ethernet hub instance",
"type": "object", "type": "object",
"definitions": {
"EthernetSwitchPort": {
"description": "Ethernet switch port",
"properties": {
"port": {
"description": "Port number",
"type": "integer",
"minimum": 1
},
},
"required": ["port"],
"additionalProperties": False
},
},
"properties": { "properties": {
"node_id": { "node_id": {
"description": "Node UUID", "description": "Node UUID",
@ -83,8 +116,13 @@ ETHERNET_HUB_OBJECT_SCHEMA = {
"minLength": 1, "minLength": 1,
}, },
"ports": { "ports": {
"description": "Number of ports", "type": "array",
"type": "integer" "items": [
{"type": "object",
"oneOf": [
{"$ref": "#/definitions/EthernetSwitchPort"}
]},
]
} }
}, },
"additionalProperties": False, "additionalProperties": False,