Schemas review.

This commit is contained in:
grossmj 2016-05-12 19:07:25 -06:00
parent d21fa9e961
commit be1efe8327
14 changed files with 213 additions and 199 deletions

View File

@ -95,7 +95,7 @@ class Controller:
:param kwargs: See the documentation of Compute
"""
# We dissallow to create from the outside the
# We disallow to create from the outside the
if compute_id == 'local':
return self._createLocalCompute()

View File

@ -38,11 +38,11 @@ COMPUTE_CREATE_SCHEMA = {
"type": "integer"
},
"user": {
"description": "User for auth",
"description": "User for authentication",
"type": "string"
},
"password": {
"description": "Password for auth",
"description": "Password for authentication",
"type": "string"
}
},
@ -72,15 +72,15 @@ COMPUTE_OBJECT_SCHEMA = {
"type": "integer"
},
"user": {
"description": "User for auth",
"description": "User for authentication",
"type": "string"
},
"connected": {
"description": "True if controller is connected to the compute",
"description": "Whether the controller is connected to the compute server or not",
"type": "boolean"
},
"version": {
"description": "Version of the GNS3 remote compute",
"description": "Version of the GNS3 remote compute server",
"type": ["string", "null"]
}
},

View File

@ -22,7 +22,7 @@ DOCKER_CREATE_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "Docker VM instance identifier",
"description": "Node UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,
@ -34,22 +34,22 @@ DOCKER_CREATE_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet", "vnc", "http", "https"]
},
"console_resolution": {
"description": "console resolution for VNC",
"description": "Console resolution for VNC",
"type": ["string", "null"],
"pattern": "^[0-9]+x[0-9]+$"
},
"console_http_port": {
"description": "Internal port in the container of the HTTP server",
"description": "Internal port in the container for the HTTP server",
"type": "integer",
},
"console_http_path": {
@ -57,7 +57,7 @@ DOCKER_CREATE_SCHEMA = {
"type": "string",
},
"aux": {
"description": "auxilary TCP port",
"description": "Auxiliary TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
@ -73,13 +73,13 @@ DOCKER_CREATE_SCHEMA = {
"minLength": 1,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": ["integer", "null"],
"minimum": 0,
"maximum": 99,
},
"environment": {
"description": "Docker environment",
"description": "Docker environment variables",
"type": ["string", "null"],
"minLength": 0,
}
@ -91,7 +91,7 @@ DOCKER_CREATE_SCHEMA = {
DOCKER_UPDATE_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request validation to create a new Docker container",
"description": "Request validation to update a Docker container",
"type": "object",
"properties": {
"name": {
@ -100,13 +100,13 @@ DOCKER_UPDATE_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
},
"console_resolution": {
"description": "console resolution for VNC",
"description": "Console resolution for VNC",
"type": ["string", "null"],
"pattern": "^[0-9]+x[0-9]+$"
},
@ -115,7 +115,7 @@ DOCKER_UPDATE_SCHEMA = {
"enum": ["telnet", "vnc", "http", "https"]
},
"console_http_port": {
"description": "Internal port in the container of the HTTP server",
"description": "Internal port in the container for the HTTP server",
"type": "integer",
},
"console_http_path": {
@ -123,7 +123,7 @@ DOCKER_UPDATE_SCHEMA = {
"type": "string",
},
"aux": {
"description": "auxilary TCP port",
"description": "Auxiliary TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
@ -134,12 +134,12 @@ DOCKER_UPDATE_SCHEMA = {
"minLength": 0,
},
"environment": {
"description": "Docker environment",
"description": "Docker environment variables",
"type": ["string", "null"],
"minLength": 0,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": ["integer", "null"],
"minimum": 0,
"maximum": 99,
@ -150,7 +150,7 @@ DOCKER_UPDATE_SCHEMA = {
DOCKER_OBJECT_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Docker instance",
"description": "Docker container instance",
"type": "object",
"properties": {
"name": {
@ -159,35 +159,35 @@ DOCKER_OBJECT_SCHEMA = {
"minLength": 1,
},
"node_id": {
"description": "Docker container instance UUID",
"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}$"
},
"aux": {
"description": "auxilary TCP port",
"description": "Auxiliary TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"console_resolution": {
"description": "console resolution for VNC",
"description": "Console resolution for VNC",
"type": "string",
"pattern": "^[0-9]+x[0-9]+$"
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet", "vnc", "http", "https"]
},
"console_http_port": {
"description": "Internal port in the container of the HTTP server",
"description": "Internal port in the container for the HTTP server",
"type": "integer",
},
"console_http_path": {
@ -230,12 +230,23 @@ DOCKER_OBJECT_SCHEMA = {
"minLength": 0,
},
"node_directory": {
"decription": "Path to the VM working directory",
"description": "Path to the node working directory",
"type": "string"
}
},
"additionalProperties": False,
"required": ["node_id", "project_id", "image", "container_id", "adapters", "aux", "console", "console_type", "console_resolution", "start_command", "environment", "node_directory"]
"required": ["node_id",
"project_id",
"image",
"container_id",
"adapters",
"aux",
"console",
"console_type",
"console_resolution",
"start_command",
"environment",
"node_directory"]
}

View File

@ -27,7 +27,7 @@ DEVICE_CREATE_SCHEMA = {
"minLength": 1,
},
"device_id": {
"description": "Dynamips device instance identifier",
"description": "Dynamips device UUID",
"oneOf": [
{"type": "string",
"minLength": 36,

View File

@ -22,7 +22,7 @@ VM_CREATE_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "Node identifier",
"description": "Node UUID",
"oneOf": [
{"type": "string",
"minLength": 36,
@ -32,7 +32,7 @@ VM_CREATE_SCHEMA = {
]
},
"dynamips_id": {
"description": "ID to use with Dynamips",
"description": "Dynamips ID",
"type": "integer"
},
"name": {
@ -41,29 +41,29 @@ VM_CREATE_SCHEMA = {
"minLength": 1,
},
"platform": {
"description": "platform",
"description": "Cisco router platform",
"type": "string",
"minLength": 1,
"pattern": "^c[0-9]{4}$"
},
"chassis": {
"description": "router chassis model",
"description": "Cisco router chassis model",
"type": "string",
"minLength": 1,
"pattern": "^[0-9]{4}(XM)?$"
},
"image": {
"description": "path to the IOS image",
"description": "Path to the IOS image",
"type": "string",
"minLength": 1,
},
"image_md5sum": {
"description": "checksum of the IOS image",
"description": "Checksum of the IOS image",
"type": ["string", "null"],
"minLength": 1,
},
"startup_config": {
"description": "path to the IOS startup configuration file",
"description": "Path to the IOS startup configuration file",
"type": "string",
"minLength": 1,
},
@ -72,7 +72,7 @@ VM_CREATE_SCHEMA = {
"type": "string",
},
"private_config": {
"description": "path to the IOS private configuration file",
"description": "Path to the IOS private configuration file",
"type": "string",
"minLength": 1,
},
@ -81,11 +81,11 @@ VM_CREATE_SCHEMA = {
"type": "string",
},
"ram": {
"description": "amount of RAM in MB",
"description": "Amount of RAM in MB",
"type": "integer"
},
"nvram": {
"description": "amount of NVRAM in KB",
"description": "Amount of NVRAM in KB",
"type": "integer"
},
"mmap": {
@ -93,11 +93,11 @@ VM_CREATE_SCHEMA = {
"type": "boolean"
},
"sparsemem": {
"description": "sparse memory feature",
"description": "Sparse memory feature",
"type": "boolean"
},
"clock_divisor": {
"description": "clock divisor",
"description": "Clock divisor",
"type": "integer"
},
"idlepc": {
@ -106,53 +106,53 @@ VM_CREATE_SCHEMA = {
"pattern": "^(0x[0-9a-fA-F]+)?$"
},
"idlemax": {
"description": "idlemax value",
"description": "Idlemax value",
"type": "integer",
},
"idlesleep": {
"description": "idlesleep value",
"description": "Idlesleep value",
"type": "integer",
},
"exec_area": {
"description": "exec area value",
"description": "Exec area value",
"type": "integer",
},
"disk0": {
"description": "disk0 size in MB",
"description": "Disk0 size in MB",
"type": "integer"
},
"disk1": {
"description": "disk1 size in MB",
"description": "Disk1 size in MB",
"type": "integer"
},
"auto_delete_disks": {
"description": "automatically delete nvram and disk files",
"description": "Automatically delete nvram and disk files",
"type": "boolean"
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet"]
},
"aux": {
"description": "auxiliary console TCP port",
"description": "Auxiliary console TCP port",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"mac_addr": {
"description": "base MAC address",
"description": "Base MAC address",
"type": "string",
"minLength": 1,
"pattern": "^([0-9a-fA-F]{4}\\.){2}[0-9a-fA-F]{4}$"
},
"system_id": {
"description": "system ID",
"description": "System ID",
"type": "string",
"minLength": 1,
},
@ -227,11 +227,11 @@ VM_CREATE_SCHEMA = {
]
},
"startup_config_base64": {
"description": "startup configuration base64 encoded",
"description": "Startup configuration base64 encoded",
"type": "string"
},
"private_config_base64": {
"description": "private configuration base64 encoded",
"description": "Private configuration base64 encoded",
"type": "string"
},
# C7200 properties
@ -281,24 +281,24 @@ VM_UPDATE_SCHEMA = {
"minLength": 1,
},
"platform": {
"description": "platform",
"description": "Cisco router platform",
"type": "string",
"minLength": 1,
"pattern": "^c[0-9]{4}$"
},
"chassis": {
"description": "router chassis model",
"description": "Cisco router chassis model",
"type": "string",
"minLength": 1,
"pattern": "^[0-9]{4}(XM)?$"
},
"image": {
"description": "path to the IOS image",
"description": "Path to the IOS image",
"type": "string",
"minLength": 1,
},
"image_md5sum": {
"description": "checksum of the IOS image",
"description": "Checksum of the IOS image",
"type": ["string", "null"],
"minLength": 1,
},
@ -311,11 +311,11 @@ VM_UPDATE_SCHEMA = {
"type": "string",
},
"ram": {
"description": "amount of RAM in MB",
"description": "Amount of RAM in MB",
"type": "integer"
},
"nvram": {
"description": "amount of NVRAM in KB",
"description": "Amount of NVRAM in KB",
"type": "integer"
},
"mmap": {
@ -323,11 +323,11 @@ VM_UPDATE_SCHEMA = {
"type": "boolean"
},
"sparsemem": {
"description": "sparse memory feature",
"description": "Sparse memory feature",
"type": "boolean"
},
"clock_divisor": {
"description": "clock divisor",
"description": "Clock divisor",
"type": "integer"
},
"idlepc": {
@ -336,53 +336,53 @@ VM_UPDATE_SCHEMA = {
"pattern": "^(0x[0-9a-fA-F]+)?$"
},
"idlemax": {
"description": "idlemax value",
"description": "Idlemax value",
"type": "integer",
},
"idlesleep": {
"description": "idlesleep value",
"description": "Idlesleep value",
"type": "integer",
},
"exec_area": {
"description": "exec area value",
"description": "Exec area value",
"type": "integer",
},
"disk0": {
"description": "disk0 size in MB",
"description": "Disk0 size in MB",
"type": "integer"
},
"disk1": {
"description": "disk1 size in MB",
"description": "Disk1 size in MB",
"type": "integer"
},
"auto_delete_disks": {
"description": "automatically delete nvram and disk files",
"description": "Automatically delete nvram and disk files",
"type": "boolean"
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet"]
},
"aux": {
"description": "auxiliary console TCP port",
"description": "Auxiliary console TCP port",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"mac_addr": {
"description": "base MAC address",
"description": "Base MAC address",
"type": "string",
"minLength": 1,
"pattern": "^([0-9a-fA-F]{4}\\.){2}[0-9a-fA-F]{4}$"
},
"system_id": {
"description": "system ID",
"description": "System ID",
"type": "string",
"minLength": 1,
},
@ -457,11 +457,11 @@ VM_UPDATE_SCHEMA = {
]
},
"startup_config_base64": {
"description": "startup configuration base64 encoded",
"description": "Startup configuration base64 encoded",
"type": "string"
},
"private_config_base64": {
"description": "private configuration base64 encoded",
"description": "Private configuration base64 encoded",
"type": "string"
},
# C7200 properties
@ -510,7 +510,7 @@ VM_OBJECT_SCHEMA = {
"type": "integer"
},
"node_id": {
"description": "Node instance UUID",
"description": "Node UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,
@ -533,41 +533,41 @@ VM_OBJECT_SCHEMA = {
"minLength": 1,
},
"platform": {
"description": "platform",
"description": "Cisco router platform",
"type": "string",
"minLength": 1,
"pattern": "^c[0-9]{4}$"
},
"chassis": {
"description": "router chassis model",
"description": "Cisco router chassis model",
"type": "string",
"minLength": 1,
"pattern": "^[0-9]{4}(XM)?$"
},
"image": {
"description": "path to the IOS image",
"description": "Path to the IOS image",
"type": "string",
"minLength": 1,
},
"image_md5sum": {
"description": "checksum of the IOS image",
"description": "Checksum of the IOS image",
"type": ["string", "null"],
"minLength": 1,
},
"startup_config": {
"description": "path to the IOS startup configuration file",
"description": "Path to the IOS startup configuration file",
"type": "string",
},
"private_config": {
"description": "path to the IOS private configuration file",
"description": "Path to the IOS private configuration file",
"type": "string",
},
"ram": {
"description": "amount of RAM in MB",
"description": "Amount of RAM in MB",
"type": "integer"
},
"nvram": {
"description": "amount of NVRAM in KB",
"description": "Amount of NVRAM in KB",
"type": "integer"
},
"mmap": {
@ -575,11 +575,11 @@ VM_OBJECT_SCHEMA = {
"type": "boolean"
},
"sparsemem": {
"description": "sparse memory feature",
"description": "Sparse memory feature",
"type": "boolean"
},
"clock_divisor": {
"description": "clock divisor",
"description": "Clock divisor",
"type": "integer"
},
"idlepc": {
@ -588,53 +588,53 @@ VM_OBJECT_SCHEMA = {
"pattern": "^(0x[0-9a-fA-F]+)?$"
},
"idlemax": {
"description": "idlemax value",
"description": "Idlemax value",
"type": "integer",
},
"idlesleep": {
"description": "idlesleep value",
"description": "Idlesleep value",
"type": "integer",
},
"exec_area": {
"description": "exec area value",
"description": "Exec area value",
"type": "integer",
},
"disk0": {
"description": "disk0 size in MB",
"description": "Disk0 size in MB",
"type": "integer"
},
"disk1": {
"description": "disk1 size in MB",
"description": "Disk1 size in MB",
"type": "integer"
},
"auto_delete_disks": {
"description": "automatically delete nvram and disk files",
"description": "Automatically delete nvram and disk files",
"type": "boolean"
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet"]
},
"aux": {
"description": "auxiliary console TCP port",
"description": "Auxiliary console TCP port",
"type": ["integer", "null"],
"minimum": 1,
"maximum": 65535
},
"mac_addr": {
"description": "base MAC address",
"description": "Base MAC address",
"type": "string",
#"minLength": 1,
#"pattern": "^([0-9a-fA-F]{4}\\.){2}[0-9a-fA-F]{4}$"
},
"system_id": {
"description": "system ID",
"description": "System ID",
"type": "string",
"minLength": 1,
},
@ -709,11 +709,11 @@ VM_OBJECT_SCHEMA = {
]
},
"startup_config_base64": {
"description": "startup configuration base64 encoded",
"description": "Startup configuration base64 encoded",
"type": "string"
},
"private_config_base64": {
"description": "private configuration base64 encoded",
"description": "Private configuration base64 encoded",
"type": "string"
},
# C7200 properties

View File

@ -27,7 +27,7 @@ IOU_CREATE_SCHEMA = {
"minLength": 1,
},
"node_id": {
"description": "IOU VM identifier",
"description": "Node UUID",
"oneOf": [
{"type": "string",
"minLength": 36,
@ -37,7 +37,7 @@ IOU_CREATE_SCHEMA = {
]
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
@ -110,7 +110,7 @@ IOU_UPDATE_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
@ -195,11 +195,11 @@ IOU_OBJECT_SCHEMA = {
"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_directory": {
"decription": "Path to the VM working directory",
"description": "Path to the node working directory",
"type": "string"
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"

View File

@ -22,7 +22,7 @@ LINK_OBJECT_SCHEMA = {
"type": "object",
"properties": {
"link_id": {
"description": "Link identifier",
"description": "Link UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,
@ -35,7 +35,7 @@ LINK_OBJECT_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "VM identifier",
"description": "Node UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,
@ -55,15 +55,15 @@ LINK_OBJECT_SCHEMA = {
}
},
"capturing": {
"description": "Read only propertie. True if a capture running on the link",
"description": "Read only property. True if a capture running on the link",
"type": "boolean"
},
"capture_file_name": {
"description": "Read only propertie. The name of the capture file if capture is running",
"description": "Read only property. The name of the capture file if capture is running",
"type": ["string", "null"]
},
"capture_file_path": {
"description": "Read only propertie. The full path of the capture file if capture is running",
"description": "Read only property. The full path of the capture file if capture is running",
"type": ["string", "null"]
}
},
@ -82,7 +82,7 @@ LINK_CAPTURE_SCHEMA = {
"enum": ["DLT_ATM_RFC1483", "DLT_EN10MB", "DLT_FRELAY", "DLT_C_HDLC"]
},
"capture_file_name": {
"description": "Read only propertie. The name of the capture file if capture is running",
"description": "Read only property. The name of the capture file if capture is running",
"type": "string"
}
},

View File

@ -73,11 +73,14 @@ NODE_OBJECT_SCHEMA = {
"type": "string"
},
"project_id": {
"description": "Project identifier",
"type": "string"
"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}$"
},
"node_id": {
"description": "Node identifier",
"description": "Node UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,

View File

@ -39,7 +39,7 @@ PROJECT_CREATE_SCHEMA = {
"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}$"
},
"temporary": {
"description": "If project is a temporary project",
"description": "Whether the project is a temporary project or not",
"type": "boolean"
},
},
@ -57,7 +57,7 @@ PROJECT_UPDATE_SCHEMA = {
"minLength": 1
},
"temporary": {
"description": "If project is a temporary project",
"description": "Whether the project is a temporary project or not",
"type": "boolean"
},
"path": {
@ -86,7 +86,7 @@ PROJECT_OBJECT_SCHEMA = {
"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}$"
},
"temporary": {
"description": "If project is a temporary project",
"description": "Whether the project is a temporary project or not",
"type": "boolean"
},
"path": {

View File

@ -24,7 +24,7 @@ QEMU_CREATE_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "QEMU VM identifier",
"description": "Node UUID",
"oneOf": [
{"type": "string",
"minLength": 36,
@ -43,7 +43,7 @@ QEMU_CREATE_SCHEMA = {
"type": "string",
},
"linked_clone": {
"description": "either the VM is a linked clone or not",
"description": "Whether the VM is a linked clone or not",
"type": "boolean"
},
"qemu_path": {
@ -56,13 +56,13 @@ QEMU_CREATE_SCHEMA = {
"enum": QEMU_PLATFORMS + ["null"]
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet", "vnc"]
},
"hda_disk_image": {
@ -126,17 +126,17 @@ QEMU_CREATE_SCHEMA = {
"enum": ["c", "d", "n", "cn", "cd"]
},
"ram": {
"description": "amount of RAM in MB",
"description": "Amount of RAM in MB",
"type": ["integer", "null"]
},
"cpus": {
"description": "number of vCPUs",
"description": "Number of vCPUs",
"type": ["integer", "null"],
"minimum": 1,
"maximum": 255,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": ["integer", "null"],
"minimum": 0,
"maximum": 32,
@ -216,7 +216,7 @@ QEMU_UPDATE_SCHEMA = {
"minLength": 1,
},
"usage": {
"description": "How to use the qemu VM",
"description": "How to use the QEMU VM",
"type": "string",
},
"qemu_path": {
@ -229,13 +229,13 @@ QEMU_UPDATE_SCHEMA = {
"enum": QEMU_PLATFORMS + ["null"]
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet", "vnc"]
},
"hda_disk_image": {
@ -299,17 +299,17 @@ QEMU_UPDATE_SCHEMA = {
"enum": ["c", "d", "n", "cn", "cd"]
},
"ram": {
"description": "amount of RAM in MB",
"description": "Amount of RAM in MB",
"type": ["integer", "null"]
},
"cpus": {
"description": "number of vCPUs",
"description": "Number of vCPUs",
"type": ["integer", "null"],
"minimum": 1,
"maximum": 255,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": ["integer", "null"],
"minimum": 0,
"maximum": 32,
@ -383,12 +383,12 @@ QEMU_OBJECT_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "QEMU VM uuid",
"description": "Node UUID",
"type": "string",
"minLength": 1,
},
"project_id": {
"description": "Project uuid",
"description": "Project UUID",
"type": "string",
"minLength": 1,
},
@ -398,11 +398,11 @@ QEMU_OBJECT_SCHEMA = {
"minLength": 1,
},
"usage": {
"description": "How to use the qemu VM",
"description": "How to use the QEMU VM",
"type": "string",
},
"qemu_path": {
"description": "path to QEMU",
"description": "Path to QEMU",
"type": "string",
"minLength": 1,
},
@ -475,17 +475,17 @@ QEMU_OBJECT_SCHEMA = {
"type": "string"
},
"ram": {
"description": "amount of RAM in MB",
"description": "Amount of RAM in MB",
"type": "integer"
},
"cpus": {
"description": "number of vCPUs",
"description": "Number of vCPUs",
"type": ["integer", "null"],
"minimum": 1,
"maximum": 255,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 32,
@ -502,13 +502,13 @@ QEMU_OBJECT_SCHEMA = {
"pattern": "^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$"
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet", "vnc"]
},
"initrd": {
@ -608,10 +608,10 @@ QEMU_OBJECT_SCHEMA = {
QEMU_BINARY_FILTER_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request validation for a list of qemu capabilities",
"description": "Request validation for a list of QEMU capabilities",
"properties": {
"archs": {
"description": "Architectures to filter binaries by",
"description": "Architectures to filter binaries with",
"type": "array",
"items": {
"enum": QEMU_PLATFORMS
@ -623,7 +623,7 @@ QEMU_BINARY_FILTER_SCHEMA = {
QEMU_BINARY_LIST_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request validation for a list of qemu binaries",
"description": "Request validation for a list of QEMU binaries",
"type": "array",
"items": {
"$ref": "#/definitions/QemuPath"
@ -648,7 +648,7 @@ QEMU_BINARY_LIST_SCHEMA = {
QEMU_CAPABILITY_LIST_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request validation for a list of qemu capabilities",
"description": "Request validation for a list of QEMU capabilities",
"properties": {
"kvm": {
"description": "Architectures that KVM is enabled for",
@ -663,7 +663,7 @@ QEMU_CAPABILITY_LIST_SCHEMA = {
QEMU_IMAGE_CREATE_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Create a new qemu image. Options can be specific to a format. Read qemu-img manual for more information",
"description": "Create a new QEMU image. Options can be specific to a format. Read qemu-img manual for more information",
"type": "object",
"properties": {
"qemu_img": {
@ -679,7 +679,7 @@ QEMU_IMAGE_CREATE_SCHEMA = {
"enum": ["qcow2", "qcow", "vpc", "vdi", "vmdk", "raw"]
},
"size": {
"description": "Image size in M",
"description": "Image size in Megabytes",
"type": "integer"
},
"preallocation": {

View File

@ -22,11 +22,11 @@ VERSION_SCHEMA = {
"additionalProperties": False,
"properties": {
"version": {
"description": "Version number human readable",
"description": "Version number",
"type": "string",
},
"local": {
"description": "Either this is a local server",
"description": "Whether this is a local server or not",
"type": "boolean",
}
}

View File

@ -22,7 +22,7 @@ VBOX_CREATE_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "VirtualBox VM instance identifier",
"description": "Node UUID",
"oneOf": [
{"type": "string",
"minLength": 36,
@ -32,7 +32,7 @@ VBOX_CREATE_SCHEMA = {
]
},
"linked_clone": {
"description": "either the VM is a linked clone or not",
"description": "Whether the VM is a linked clone or not",
"type": "boolean"
},
"name": {
@ -46,13 +46,13 @@ VBOX_CREATE_SCHEMA = {
"minLength": 1,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 36, # maximum given by the ICH9 chipset in VirtualBox
},
"use_any_adapter": {
"description": "allow GNS3 to use any VirtualBox adapter",
"description": "Allow GNS3 to use any VirtualBox adapter",
"type": "boolean",
},
"adapter_type": {
@ -61,13 +61,13 @@ VBOX_CREATE_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"enable_remote_console": {
"description": "enable the remote console",
"description": "Enable the remote console",
"type": "boolean"
},
"ram": {
@ -77,7 +77,7 @@ VBOX_CREATE_SCHEMA = {
"type": "integer"
},
"headless": {
"description": "headless mode",
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
@ -105,13 +105,13 @@ VBOX_UPDATE_SCHEMA = {
"minLength": 1,
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 36, # maximum given by the ICH9 chipset in VirtualBox
},
"use_any_adapter": {
"description": "allow GNS3 to use any VirtualBox adapter",
"description": "Allow GNS3 to use any VirtualBox adapter",
"type": "boolean",
},
"adapter_type": {
@ -120,13 +120,13 @@ VBOX_UPDATE_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"enable_remote_console": {
"description": "enable the remote console",
"description": "Enable the remote console",
"type": "boolean"
},
"ram": {
@ -136,7 +136,7 @@ VBOX_UPDATE_SCHEMA = {
"type": "integer"
},
"headless": {
"description": "headless mode",
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
@ -159,7 +159,7 @@ VBOX_OBJECT_SCHEMA = {
"minLength": 1,
},
"node_id": {
"description": "VirtualBox VM instance UUID",
"description": "Node UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,
@ -182,11 +182,11 @@ VBOX_OBJECT_SCHEMA = {
"type": ["string", "null"]
},
"enable_remote_console": {
"description": "enable the remote console",
"description": "Enable the remote console",
"type": "boolean"
},
"headless": {
"description": "headless mode",
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
@ -194,13 +194,13 @@ VBOX_OBJECT_SCHEMA = {
"type": "boolean"
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 36, # maximum given by the ICH9 chipset in VirtualBox
},
"use_any_adapter": {
"description": "allow GNS3 to use any VirtualBox adapter",
"description": "Allow GNS3 to use any VirtualBox adapter",
"type": "boolean",
},
"adapter_type": {
@ -209,7 +209,7 @@ VBOX_OBJECT_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"

View File

@ -22,14 +22,14 @@ VMWARE_CREATE_SCHEMA = {
"type": "object",
"properties": {
"node_id": {
"description": "VMware VM instance identifier",
"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": "either the VM is a linked clone or not",
"description": "Whether the VM is a linked clone or not",
"type": "boolean"
},
"name": {
@ -38,22 +38,22 @@ VMWARE_CREATE_SCHEMA = {
"minLength": 1,
},
"vmx_path": {
"description": "path to the vmx file",
"description": "Path to the vmx file",
"type": "string",
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"enable_remote_console": {
"description": "enable the remote console",
"description": "Enable the remote console",
"type": "boolean"
},
"headless": {
"description": "headless mode",
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
@ -61,7 +61,7 @@ VMWARE_CREATE_SCHEMA = {
"type": "boolean"
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 10, # maximum adapters support by VMware VMs
@ -72,11 +72,11 @@ VMWARE_CREATE_SCHEMA = {
"minLength": 1,
},
"use_ubridge": {
"description": "use uBridge for network connections",
"description": "Use uBridge for network connections",
"type": "boolean",
},
"use_any_adapter": {
"description": "allow GNS3 to use any VMware adapter",
"description": "Allow GNS3 to use any VMware adapter",
"type": "boolean",
},
},
@ -95,22 +95,22 @@ VMWARE_UPDATE_SCHEMA = {
"minLength": 1,
},
"vmx_path": {
"description": "path to the vmx file",
"description": "Path to the vmx file",
"type": "string",
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"enable_remote_console": {
"description": "enable the remote console",
"description": "Enable the remote console",
"type": "boolean"
},
"headless": {
"description": "headless mode",
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
@ -118,7 +118,7 @@ VMWARE_UPDATE_SCHEMA = {
"type": "boolean"
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 10, # maximum adapters support by VMware VMs
@ -129,11 +129,11 @@ VMWARE_UPDATE_SCHEMA = {
"minLength": 1,
},
"use_ubridge": {
"description": "use uBridge for network connections",
"description": "Use uBridge for network connections",
"type": "boolean",
},
"use_any_adapter": {
"description": "allow GNS3 to use any VMware adapter",
"description": "Allow GNS3 to use any VMware adapter",
"type": "boolean",
},
},
@ -152,14 +152,14 @@ VMWARE_OBJECT_SCHEMA = {
"minLength": 1,
},
"node_id": {
"description": "VMware VM instance UUID",
"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}$"
},
"node_directory": {
"decription": "Path to the VM working directory",
"decription": "Path to the node working directory",
"type": ["string", "null"]
},
"project_id": {
@ -170,16 +170,16 @@ VMWARE_OBJECT_SCHEMA = {
"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",
"description": "Path to the vmx file",
"type": "string",
"minLength": 1,
},
"enable_remote_console": {
"description": "enable the remote console",
"description": "Enable the remote console",
"type": "boolean"
},
"headless": {
"description": "headless mode",
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
@ -187,7 +187,7 @@ VMWARE_OBJECT_SCHEMA = {
"type": "boolean"
},
"adapters": {
"description": "number of adapters",
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 10, # maximum adapters support by VMware VMs
@ -198,15 +198,15 @@ VMWARE_OBJECT_SCHEMA = {
"minLength": 1,
},
"use_ubridge": {
"description": "use uBridge for network connections",
"description": "Use uBridge for network connections",
"type": "boolean",
},
"use_any_adapter": {
"description": "allow GNS3 to use any VMware adapter",
"description": "Allow GNS3 to use any VMware adapter",
"type": "boolean",
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"

View File

@ -27,7 +27,7 @@ VPCS_CREATE_SCHEMA = {
"minLength": 1,
},
"node_id": {
"description": "VPCS VM identifier",
"description": "Node UUID",
"oneOf": [
{"type": "string",
"minLength": 36,
@ -37,13 +37,13 @@ VPCS_CREATE_SCHEMA = {
]
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet"]
},
"startup_script": {
@ -66,13 +66,13 @@ VPCS_UPDATE_SCHEMA = {
"minLength": 1,
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": ["integer", "null"]
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet"]
},
"startup_script": {
@ -98,7 +98,7 @@ VPCS_OBJECT_SCHEMA = {
"minLength": 1,
},
"node_id": {
"description": "VPCS VM UUID",
"description": "Node UUID",
"type": "string",
"minLength": 36,
"maxLength": 36,
@ -113,13 +113,13 @@ VPCS_OBJECT_SCHEMA = {
"enum": ["started", "stopped"]
},
"console": {
"description": "console TCP port",
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"console_type": {
"description": "console type",
"description": "Console type",
"enum": ["telnet"]
},
"project_id": {