# -*- 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 . VMWARE_CREATE_SCHEMA = { "$schema": "http://json-schema.org/draft-04/schema#", "description": "Request validation to create a new VMware VM instance", "type": "object", "properties": { "node_id": { "description": "Node 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}$" }, "linked_clone": { "description": "Whether the VM is a linked clone or not", "type": "boolean" }, "name": { "description": "VMware VM instance name", "type": "string", "minLength": 1, }, "vmx_path": { "description": "Path to the vmx file", "type": "string", "minLength": 1, }, "console": { "description": "Console TCP port", "minimum": 1, "maximum": 65535, "type": "integer" }, "enable_remote_console": { "description": "Enable the remote console", "type": "boolean" }, "headless": { "description": "Headless mode", "type": "boolean" }, "acpi_shutdown": { "description": "ACPI shutdown", "type": "boolean" }, "adapters": { "description": "Number of adapters", "type": "integer", "minimum": 0, "maximum": 10, # maximum adapters support by VMware VMs }, "adapter_type": { "description": "VMware adapter type", "type": "string", "minLength": 1, }, "use_any_adapter": { "description": "Allow GNS3 to use any VMware adapter", "type": "boolean", }, "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"] } }, "additionalProperties": False, "required": ["name", "vmx_path", "linked_clone"], } 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, }, "node_id": { "description": "Node 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}$" }, "status": { "description": "VM status", "enum": ["started", "stopped", "suspended"] }, "node_directory": { "decription": "Path to the node working directory", "type": ["string", "null"] }, "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": { "description": "Path to the vmx file", "type": "string", "minLength": 1, }, "enable_remote_console": { "description": "Enable the remote console", "type": "boolean" }, "headless": { "description": "Headless mode", "type": "boolean" }, "acpi_shutdown": { "description": "ACPI shutdown", "type": "boolean" }, "adapters": { "description": "Number of adapters", "type": "integer", "minimum": 0, "maximum": 10, # maximum adapters support by VMware VMs }, "adapter_type": { "description": "VMware adapter type", "type": "string", "minLength": 1, }, "use_any_adapter": { "description": "Allow GNS3 to use any VMware adapter", "type": "boolean", }, "console": { "description": "Console TCP port", "minimum": 1, "maximum": 65535, "type": "integer" }, "linked_clone": { "description": "Whether the VM is a linked clone or not", "type": "boolean" }, "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"] } }, "additionalProperties": False }