gns3-server/docs/gns3_file.json
2018-01-08 11:57:07 +07:00

610 lines
28 KiB
JSON

{
"properties": {
"auto_open": {
"type": "boolean",
"description": "Open the topology with GNS3"
},
"version": {
"type": "string",
"description": "Version of the GNS3 software which have update the file for the last time"
},
"name": {
"type": "string",
"description": "Name of the project"
},
"scene_height": {
"type": "integer",
"description": "Height of the drawing area"
},
"type": {
"enum": [
"topology"
],
"description": "Type of file. It's always topology"
},
"project_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Project UUID"
},
"topology": {
"properties": {
"nodes": {
"type": "array",
"items": {
"properties": {
"z": {
"type": "integer",
"description": "Z position of the node"
},
"first_port_name": {
"type": [
"string",
"null"
],
"description": "Name of the first port"
},
"node_directory": {
"type": [
"null",
"string"
],
"description": "Working directory of the node. Read only"
},
"command_line": {
"type": [
"null",
"string"
],
"description": "Command line use to start the node"
},
"console_type": {
"enum": [
"vnc",
"telnet",
"http",
"https",
"spice",
null
],
"description": "Console type"
},
"x": {
"type": "integer",
"description": "X position of the node"
},
"compute_id": {
"type": "string",
"description": "Compute identifier"
},
"node_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Node UUID"
},
"label": {
"properties": {
"style": {
"type": "string",
"description": "SVG style attribute"
},
"y": {
"type": "integer",
"description": "Relative Y position of the label"
},
"text": {
"type": "string"
},
"x": {
"type": [
"integer",
"null"
],
"description": "Relative X position of the label. If null center it"
},
"rotation": {
"type": "integer",
"minimum": -359,
"maximum": 360,
"description": "Rotation of the label"
}
},
"type": "object",
"additionalProperties": false,
"required": [
"text",
"x",
"y"
]
},
"port_segment_size": {
"type": "integer",
"minimum": 0,
"description": "Size of the port segment"
},
"properties": {
"type": "object",
"description": "Properties specific to an emulator"
},
"ports": {
"type": "array",
"items": {
"properties": {
"short_name": {
"type": "string",
"description": "Short version of port name"
},
"adapter_number": {
"type": "integer",
"description": "Adapter slot"
},
"port_number": {
"type": "integer",
"description": "Port slot"
},
"name": {
"type": "string",
"description": "Port name"
},
"link_type": {
"enum": [
"ethernet",
"serial"
],
"description": "Type of link"
},
"data_link_types": {
"properties": {},
"type": "object",
"description": "Available PCAP type for capture"
}
},
"type": "object",
"additionalProperties": false,
"description": "A node port"
},
"description": "List of node ports READ only"
},
"console": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 65535,
"description": "Console TCP port"
},
"name": {
"type": "string",
"minLength": 1,
"description": "Node name"
},
"node_type": {
"enum": [
"cloud",
"nat",
"ethernet_hub",
"ethernet_switch",
"frame_relay_switch",
"atm_switch",
"docker",
"dynamips",
"vpcs",
"virtualbox",
"vmware",
"iou",
"qemu"
],
"description": "Type of node"
},
"symbol": {
"type": [
"string",
"null"
],
"minLength": 1,
"description": "Symbol of the node"
},
"project_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Project UUID"
},
"width": {
"type": "integer",
"description": "Width of the node (Read only)"
},
"y": {
"type": "integer",
"description": "Y position of the node"
},
"console_host": {
"type": "string",
"minLength": 1,
"description": "Console host. Warning if the host is 0.0.0.0 or :: (listen on all interfaces) you need to use the same address you use to connect to the controller."
},
"status": {
"enum": [
"stopped",
"started",
"suspended"
],
"description": "Status of the node"
},
"height": {
"type": "integer",
"description": "Height of the node (Read only)"
},
"port_name_format": {
"type": "string",
"description": "Formating for port name {0} will be replace by port number"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"required": [
"name",
"node_type",
"compute_id"
],
"type": "object",
"description": "A node object"
},
"description": "Nodes elements"
},
"links": {
"type": "array",
"items": {
"properties": {
"nodes": {
"type": "array",
"items": {
"properties": {
"label": {
"properties": {
"style": {
"type": "string",
"description": "SVG style attribute"
},
"y": {
"type": "integer",
"description": "Relative Y position of the label"
},
"text": {
"type": "string"
},
"x": {
"type": [
"integer",
"null"
],
"description": "Relative X position of the label. If null center it"
},
"rotation": {
"type": "integer",
"minimum": -359,
"maximum": 360,
"description": "Rotation of the label"
}
},
"type": "object",
"additionalProperties": false,
"required": [
"text",
"x",
"y"
]
},
"node_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Node UUID"
},
"port_number": {
"type": "integer",
"description": "Port number"
},
"adapter_number": {
"type": "integer",
"description": "Adapter number"
}
},
"type": "object",
"additionalProperties": false,
"required": [
"node_id",
"adapter_number",
"port_number"
]
},
"description": "List of the VMS"
},
"link_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Link UUID"
},
"capturing": {
"type": "boolean",
"description": "Read only property. True if a capture running on the link"
},
"capture_file_path": {
"type": [
"string",
"null"
],
"description": "Read only property. The full path of the capture file if capture is running"
},
"capture_file_name": {
"type": [
"string",
"null"
],
"description": "Read only property. The name of the capture file if capture is running"
},
"suspend": {
"type": "boolean",
"description": "Suspend the link"
},
"link_type": {
"enum": [
"ethernet",
"serial"
],
"description": "Type of link"
},
"project_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Project UUID"
},
"filters": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Packet filter. This allow to simulate latency and errors"
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A link object"
},
"description": "Link elements"
},
"drawings": {
"type": "array",
"items": {
"properties": {
"y": {
"type": "integer",
"description": "Y property"
},
"x": {
"type": "integer",
"description": "X property"
},
"z": {
"type": "integer",
"description": "Z property"
},
"drawing_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Drawing UUID"
},
"svg": {
"type": "string",
"description": "SVG content of the drawing"
},
"project_id": {
"maxLength": 36,
"type": "string",
"minLength": 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}$",
"description": "Project UUID"
},
"rotation": {
"type": "integer",
"minimum": -359,
"maximum": 360,
"description": "Rotation of the element"
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "An drawing object"
},
"description": "Drawings elements"
},
"computes": {
"type": "array",
"items": {
"properties": {
"cpu_usage_percent": {
"type": [
"number",
"null"
],
"minimum": 0,
"maximum": 100,
"description": "CPU usage of the compute. Read only"
},
"connected": {
"type": "boolean",
"description": "Whether the controller is connected to the compute server or not"
},
"protocol": {
"enum": [
"http",
"https"
],
"description": "Server protocol"
},
"capabilities": {
"properties": {
"platform": {
"type": "string",
"description": "Platform where the compute is running"
},
"version": {
"type": [
"string",
"null"
],
"description": "Version number"
},
"node_types": {
"type": "array",
"items": {
"enum": [
"cloud",
"nat",
"ethernet_hub",
"ethernet_switch",
"frame_relay_switch",
"atm_switch",
"docker",
"dynamips",
"vpcs",
"virtualbox",
"vmware",
"iou",
"qemu"
],
"description": "Type of node"
},
"description": "Node type supported by the compute"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Get what a server support",
"required": [
"version",
"node_types"
]
},
"name": {
"type": "string",
"description": "Server name"
},
"user": {
"type": [
"string",
"null"
],
"description": "User for authentication"
},
"compute_id": {
"type": "string",
"description": "Server identifier"
},
"host": {
"type": "string",
"description": "Server host"
},
"memory_usage_percent": {
"type": [
"number",
"null"
],
"minimum": 0,
"maximum": 100,
"description": "RAM usage of the compute. Read only"
},
"port": {
"type": "integer",
"description": "Server port"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"required": [
"compute_id",
"protocol",
"host",
"port",
"name"
],
"type": "object",
"description": "Request validation to a GNS3 compute object instance"
},
"description": "Computes servers"
}
},
"type": "object",
"required": [
"nodes",
"links",
"drawings",
"computes"
],
"additionalProperties": false,
"description": "The topology content"
},
"revision": {
"type": "integer",
"description": "Version of the .gns3 specification."
},
"auto_close": {
"type": "boolean",
"description": "Close the topology when no client is connected"
},
"show_layers": {
"type": "boolean",
"description": "Show layers on the drawing area"
},
"snap_to_grid": {
"type": "boolean",
"description": "Snap to grid on the drawing area"
},
"scene_width": {
"type": "integer",
"description": "Width of the drawing area"
},
"zoom": {
"type": "integer",
"description": "Zoom of the drawing area"
},
"auto_start": {
"type": "boolean",
"description": "Start the topology when opened"
},
"show_interface_labels": {
"type": "boolean",
"description": "Show interface labels on the drawing area"
},
"show_grid": {
"type": "boolean",
"description": "Show the grid on the drawing area"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "The topology",
"required": [
"project_id",
"type",
"revision",
"version",
"name",
"topology"
]
}