2015-05-01 01:05:37 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# Copyright (C) 2014 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/>.
|
|
|
|
|
|
|
|
|
|
|
|
VMWARE_CREATE_SCHEMA = {
|
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
"description": "Request validation to create a new VMware VM instance",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2016-05-11 17:35:36 +00:00
|
|
|
"node_id": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Node UUID",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "string",
|
|
|
|
"minLength": 36,
|
|
|
|
"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}$"
|
|
|
|
},
|
|
|
|
"linked_clone": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Whether the VM is a linked clone or not",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"description": "VMware VM instance name",
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
},
|
|
|
|
"vmx_path": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Path to the vmx file",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
},
|
|
|
|
"console": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Console TCP port",
|
2015-05-01 01:05:37 +00:00
|
|
|
"minimum": 1,
|
|
|
|
"maximum": 65535,
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"enable_remote_console": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Enable the remote console",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"headless": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Headless mode",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
2015-06-18 21:02:31 +00:00
|
|
|
"acpi_shutdown": {
|
|
|
|
"description": "ACPI shutdown",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
2015-05-15 02:11:57 +00:00
|
|
|
"adapters": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Number of adapters",
|
2015-05-15 02:11:57 +00:00
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0,
|
|
|
|
"maximum": 10, # maximum adapters support by VMware VMs
|
|
|
|
},
|
|
|
|
"adapter_type": {
|
|
|
|
"description": "VMware adapter type",
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
},
|
2015-05-22 03:48:59 +00:00
|
|
|
"use_any_adapter": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Allow GNS3 to use any VMware adapter",
|
2015-05-22 03:48:59 +00:00
|
|
|
"type": "boolean",
|
|
|
|
},
|
2016-09-06 09:30:08 +00:00
|
|
|
"port_name_format": {
|
|
|
|
"description": "Formating for port name {0} will be replace by port number",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"port_segment_size": {
|
|
|
|
"description": "Size of the port segment",
|
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0
|
|
|
|
},
|
|
|
|
"first_port_name": {
|
|
|
|
"description": "Name of the first port",
|
|
|
|
"type": ["string", "null"]
|
|
|
|
}
|
2015-05-01 01:05:37 +00:00
|
|
|
},
|
|
|
|
"additionalProperties": False,
|
|
|
|
"required": ["name", "vmx_path", "linked_clone"],
|
|
|
|
}
|
|
|
|
|
2015-09-13 15:40:09 +00:00
|
|
|
|
2015-05-01 01:05:37 +00:00
|
|
|
VMWARE_OBJECT_SCHEMA = {
|
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
"description": "VMware VM instance",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"name": {
|
|
|
|
"description": "VMware VM instance name",
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
},
|
2016-05-11 17:35:36 +00:00
|
|
|
"node_id": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Node UUID",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "string",
|
|
|
|
"minLength": 36,
|
|
|
|
"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}$"
|
|
|
|
},
|
2016-05-17 17:51:06 +00:00
|
|
|
"status": {
|
|
|
|
"description": "VM status",
|
|
|
|
"enum": ["started", "stopped", "suspended"]
|
|
|
|
},
|
2016-05-12 08:39:50 +00:00
|
|
|
"node_directory": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"decription": "Path to the node working directory",
|
2015-06-26 15:09:19 +00:00
|
|
|
"type": ["string", "null"]
|
|
|
|
},
|
2015-05-01 01:05:37 +00:00
|
|
|
"project_id": {
|
|
|
|
"description": "Project UUID",
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 36,
|
|
|
|
"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}$"
|
|
|
|
},
|
|
|
|
"vmx_path": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Path to the vmx file",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
},
|
|
|
|
"enable_remote_console": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Enable the remote console",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"headless": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Headless mode",
|
2015-05-01 01:05:37 +00:00
|
|
|
"type": "boolean"
|
|
|
|
},
|
2015-06-18 21:02:31 +00:00
|
|
|
"acpi_shutdown": {
|
|
|
|
"description": "ACPI shutdown",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
2015-05-15 02:11:57 +00:00
|
|
|
"adapters": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Number of adapters",
|
2015-05-15 02:11:57 +00:00
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0,
|
|
|
|
"maximum": 10, # maximum adapters support by VMware VMs
|
|
|
|
},
|
|
|
|
"adapter_type": {
|
|
|
|
"description": "VMware adapter type",
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
},
|
2015-05-22 03:48:59 +00:00
|
|
|
"use_any_adapter": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Allow GNS3 to use any VMware adapter",
|
2015-05-22 03:48:59 +00:00
|
|
|
"type": "boolean",
|
|
|
|
},
|
2015-05-01 01:05:37 +00:00
|
|
|
"console": {
|
2016-05-13 01:07:25 +00:00
|
|
|
"description": "Console TCP port",
|
2015-05-01 01:05:37 +00:00
|
|
|
"minimum": 1,
|
|
|
|
"maximum": 65535,
|
|
|
|
"type": "integer"
|
|
|
|
},
|
2016-07-12 14:29:58 +00:00
|
|
|
"linked_clone": {
|
|
|
|
"description": "Whether the VM is a linked clone or not",
|
|
|
|
"type": "boolean"
|
2016-09-06 09:30:08 +00:00
|
|
|
},
|
|
|
|
"port_name_format": {
|
|
|
|
"description": "Formating for port name {0} will be replace by port number",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"port_segment_size": {
|
|
|
|
"description": "Size of the port segment",
|
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0
|
|
|
|
},
|
|
|
|
"first_port_name": {
|
|
|
|
"description": "Name of the first port",
|
|
|
|
"type": ["string", "null"]
|
2016-07-12 14:29:58 +00:00
|
|
|
}
|
2015-05-01 01:05:37 +00:00
|
|
|
},
|
2016-07-12 14:29:58 +00:00
|
|
|
"additionalProperties": False
|
2015-05-01 01:05:37 +00:00
|
|
|
}
|