2016-03-03 15:02:27 +00:00
|
|
|
# -*- 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/>.
|
|
|
|
|
|
|
|
|
2016-03-08 15:04:12 +00:00
|
|
|
HYPERVISOR_CREATE_SCHEMA = {
|
2016-03-03 15:02:27 +00:00
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
2016-03-08 15:04:12 +00:00
|
|
|
"description": "Request validation to register a GNS3 hypervisor instance",
|
2016-03-03 15:02:27 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2016-03-08 15:04:12 +00:00
|
|
|
"hypervisor_id": {
|
2016-03-03 15:02:27 +00:00
|
|
|
"description": "Server identifier",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"protocol": {
|
|
|
|
"description": "Server protocol",
|
|
|
|
"enum": ["http", "https"]
|
|
|
|
},
|
|
|
|
"host": {
|
|
|
|
"description": "Server host",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"port": {
|
|
|
|
"description": "Server port",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"user": {
|
|
|
|
"description": "User for auth",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"password": {
|
|
|
|
"description": "Password for auth",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"additionalProperties": False,
|
2016-03-08 15:04:12 +00:00
|
|
|
"required": ["hypervisor_id", "protocol", "host", "port"]
|
2016-03-03 15:02:27 +00:00
|
|
|
}
|
|
|
|
|
2016-03-08 15:04:12 +00:00
|
|
|
HYPERVISOR_OBJECT_SCHEMA = {
|
2016-03-03 15:02:27 +00:00
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
2016-03-08 15:04:12 +00:00
|
|
|
"description": "Request validation to a GNS3 hypervisor object instance",
|
2016-03-03 15:02:27 +00:00
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2016-03-08 15:04:12 +00:00
|
|
|
"hypervisor_id": {
|
2016-03-03 15:02:27 +00:00
|
|
|
"description": "Server identifier",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"protocol": {
|
|
|
|
"description": "Server protocol",
|
|
|
|
"enum": ["http", "https"]
|
|
|
|
},
|
|
|
|
"host": {
|
|
|
|
"description": "Server host",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"port": {
|
|
|
|
"description": "Server port",
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"user": {
|
|
|
|
"description": "User for auth",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"connected": {
|
2016-03-08 15:04:12 +00:00
|
|
|
"description": "True if controller is connected to the hypervisor",
|
2016-03-03 15:02:27 +00:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"version": {
|
2016-03-08 15:04:12 +00:00
|
|
|
"description": "Version of the GNS3 remote hypervisor",
|
2016-03-03 15:02:27 +00:00
|
|
|
"type": ["string", "null"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"additionalProperties": False,
|
2016-03-08 15:04:12 +00:00
|
|
|
"required": ["hypervisor_id", "protocol", "host", "port"]
|
2016-03-03 15:02:27 +00:00
|
|
|
}
|