mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Return what is supported by a compute node
Ref https://github.com/GNS3/gns3-gui/issues/1448
This commit is contained in:
15 files changed
+210
-68
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2015 GNS3 Technologies Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .node import NODE_TYPE_SCHEMA
|
||||
|
||||
|
||||
CAPABILITIES_SCHEMA = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "Get what a server support",
|
||||
"type": "object",
|
||||
"required": ["version", "node_types"],
|
||||
"properties": {
|
||||
"version": {
|
||||
"description": "Version number",
|
||||
"type": ["string", "null"],
|
||||
},
|
||||
"node_types": {
|
||||
"type": "array",
|
||||
"items": NODE_TYPE_SCHEMA
|
||||
}
|
||||
},
|
||||
"additionalProperties": False
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .capabilities import CAPABILITIES_SCHEMA
|
||||
|
||||
COMPUTE_CREATE_SCHEMA = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
@@ -102,10 +103,7 @@ COMPUTE_OBJECT_SCHEMA = {
|
||||
"maximum": 100,
|
||||
"minimum": 0
|
||||
},
|
||||
"version": {
|
||||
"description": "Version of the GNS3 remote compute server",
|
||||
"type": ["string", "null"]
|
||||
}
|
||||
"capabilities": CAPABILITIES_SCHEMA
|
||||
},
|
||||
"additionalProperties": False,
|
||||
"required": ["compute_id", "protocol", "host", "port", "name"]
|
||||
|
||||
+20
-16
@@ -17,6 +17,25 @@
|
||||
|
||||
from .label import LABEL_OBJECT_SCHEMA
|
||||
|
||||
NODE_TYPE_SCHEMA = {
|
||||
"description": "Type of node",
|
||||
"enum": [
|
||||
"cloud",
|
||||
"nat",
|
||||
"ethernet_hub",
|
||||
"ethernet_switch",
|
||||
"frame_relay_switch",
|
||||
"atm_switch",
|
||||
"docker",
|
||||
"dynamips",
|
||||
"vpcs",
|
||||
"virtualbox",
|
||||
"vmware",
|
||||
"iou",
|
||||
"qemu"
|
||||
]
|
||||
}
|
||||
|
||||
NODE_LIST_IMAGES_SCHEMA = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "List of binary images",
|
||||
@@ -87,22 +106,7 @@ NODE_OBJECT_SCHEMA = {
|
||||
"maxLength": 36,
|
||||
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
|
||||
},
|
||||
"node_type": {
|
||||
"description": "Type of node",
|
||||
"enum": ["cloud",
|
||||
"nat",
|
||||
"ethernet_hub",
|
||||
"ethernet_switch",
|
||||
"frame_relay_switch",
|
||||
"atm_switch",
|
||||
"docker",
|
||||
"dynamips",
|
||||
"vpcs",
|
||||
"virtualbox",
|
||||
"vmware",
|
||||
"iou",
|
||||
"qemu"]
|
||||
},
|
||||
"node_type": NODE_TYPE_SCHEMA,
|
||||
"node_directory": {
|
||||
"description": "Working directory of the node. Read only",
|
||||
"type": ["null", "string"]
|
||||
|
||||
Reference in new issue
Block a user