/v2/projects/{project_id}/nodes

POST /v2/projects/{project_id}/nodes

Create a new node instance

Parameters

  • project_id: Project UUID

Response status codes

  • 201: Instance created
  • 400: Invalid request

Input

Name Mandatory Type Description
command_line ['null', 'string'] Command line use to start the node
compute_id string Compute identifier
console ['integer', 'null'] Console TCP port
console_host string 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.
console_type enum Possible values: vnc, telnet, http, spice, null
first_port_name ['string', 'null'] Name of the first port
height integer Height of the node (Read only)
label object
name string Node name
node_directory ['null', 'string'] Working directory of the node. Read only
node_id string Node UUID
node_type enum Possible values: cloud, nat, ethernet_hub, ethernet_switch, frame_relay_switch, atm_switch, docker, dynamips, vpcs, virtualbox, vmware, iou, qemu
port_name_format string Formating for port name {0} will be replace by port number
port_segment_size integer Size of the port segment
ports array List of node ports READ only
project_id string Project UUID
properties object Properties specific to an emulator
status enum Possible values: stopped, started, suspended
symbol ['string', 'null'] Symbol of the node
width integer Width of the node (Read only)
x integer X position of the node
y integer Y position of the node
z integer Z position of the node

Output

Name Mandatory Type Description
command_line ['null', 'string'] Command line use to start the node
compute_id string Compute identifier
console ['integer', 'null'] Console TCP port
console_host string 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.
console_type enum Possible values: vnc, telnet, http, spice, null
first_port_name ['string', 'null'] Name of the first port
height integer Height of the node (Read only)
label object
name string Node name
node_directory ['null', 'string'] Working directory of the node. Read only
node_id string Node UUID
node_type enum Possible values: cloud, nat, ethernet_hub, ethernet_switch, frame_relay_switch, atm_switch, docker, dynamips, vpcs, virtualbox, vmware, iou, qemu
port_name_format string Formating for port name {0} will be replace by port number
port_segment_size integer Size of the port segment
ports array List of node ports READ only
project_id string Project UUID
properties object Properties specific to an emulator
status enum Possible values: stopped, started, suspended
symbol ['string', 'null'] Symbol of the node
width integer Width of the node (Read only)
x integer X position of the node
y integer Y position of the node
z integer Z position of the node

Sample session

curl -i -X POST 'http://localhost:3080/v2/projects/75ca52c8-0504-4d98-95f3-b07fea466aaf/nodes' -d '{"compute_id": "example.com", "name": "test", "node_type": "vpcs", "properties": {"startup_script": "echo test"}}'

POST /v2/projects/75ca52c8-0504-4d98-95f3-b07fea466aaf/nodes HTTP/1.1
{
    "compute_id": "example.com",
    "name": "test",
    "node_type": "vpcs",
    "properties": {
        "startup_script": "echo test"
    }
}


HTTP/1.1 201
Connection: close
Content-Length: 1123
Content-Type: application/json
Date: Thu, 29 Jun 2017 15:07:54 GMT
Server: Python/3.6 GNS3/2.1.0dev1
X-Route: /v2/projects/{project_id}/nodes

{
    "command_line": null,
    "compute_id": "example.com",
    "console": 2048,
    "console_host": "<MagicMock name='mock.console_host' id='4663344768'>",
    "console_type": null,
    "first_port_name": null,
    "height": 59,
    "label": {
        "rotation": 0,
        "style": "font-size: 10;font-familly: Verdana",
        "text": "test",
        "x": null,
        "y": -40
    },
    "name": "test",
    "node_directory": null,
    "node_id": "bb6e2d39-2771-4a50-9740-b47e88a0ea45",
    "node_type": "vpcs",
    "port_name_format": "Ethernet{0}",
    "port_segment_size": 0,
    "ports": [
        {
            "adapter_number": 0,
            "data_link_types": {
                "Ethernet": "DLT_EN10MB"
            },
            "link_type": "ethernet",
            "name": "Ethernet0",
            "port_number": 0,
            "short_name": "e0"
        }
    ],
    "project_id": "75ca52c8-0504-4d98-95f3-b07fea466aaf",
    "properties": {
        "startup_script": "echo test"
    },
    "status": "stopped",
    "symbol": ":/symbols/computer.svg",
    "width": 65,
    "x": 0,
    "y": 0,
    "z": 0
}

GET /v2/projects/{project_id}/nodes

List nodes of a project

Parameters

  • project_id: Project UUID

Response status codes

  • 200: List of nodes returned

Sample session

curl -i -X GET 'http://localhost:3080/v2/projects/d6778aaa-bd4f-45c3-b2bb-8bfdd6bbe392/nodes'

GET /v2/projects/d6778aaa-bd4f-45c3-b2bb-8bfdd6bbe392/nodes HTTP/1.1



HTTP/1.1 200
Connection: close
Content-Length: 1303
Content-Type: application/json
Date: Thu, 29 Jun 2017 15:07:55 GMT
Server: Python/3.6 GNS3/2.1.0dev1
X-Route: /v2/projects/{project_id}/nodes

[
    {
        "command_line": null,
        "compute_id": "example.com",
        "console": 2048,
        "console_host": "<MagicMock name='mock.console_host' id='4713035200'>",
        "console_type": null,
        "first_port_name": null,
        "height": 59,
        "label": {
            "rotation": 0,
            "style": "font-size: 10;font-familly: Verdana",
            "text": "test",
            "x": null,
            "y": -40
        },
        "name": "test",
        "node_directory": null,
        "node_id": "71a2b586-7c71-4dd5-8708-87e8fddca30d",
        "node_type": "vpcs",
        "port_name_format": "Ethernet{0}",
        "port_segment_size": 0,
        "ports": [
            {
                "adapter_number": 0,
                "data_link_types": {
                    "Ethernet": "DLT_EN10MB"
                },
                "link_type": "ethernet",
                "name": "Ethernet0",
                "port_number": 0,
                "short_name": "e0"
            }
        ],
        "project_id": "d6778aaa-bd4f-45c3-b2bb-8bfdd6bbe392",
        "properties": {
            "startup_script": "echo test"
        },
        "status": "stopped",
        "symbol": ":/symbols/computer.svg",
        "width": 65,
        "x": 0,
        "y": 0,
        "z": 0
    }
]