Navigation

  • index
  • next |
  • previous |
  • GNS3 2.0.1 documentation »
  • Endpoints »
  • Link »

/v2/projects/{project_id}/links¶

Contents

  • /v2/projects/{project_id}/links
    • GET /v2/projects/{project_id}/links
      • Parameters
      • Response status codes
      • Sample session
    • POST /v2/projects/{project_id}/links
      • Parameters
      • Response status codes
      • Input
      • Output
      • Sample session

GET /v2/projects/{project_id}/links¶

List links of a project

Parameters¶

  • project_id: Project UUID

Response status codes¶

  • 200: List of links returned

Sample session¶

curl -i -X GET 'http://localhost:3080/v2/projects/19def516-231c-4a43-8fdb-1d49333c1f8e/links'

GET /v2/projects/19def516-231c-4a43-8fdb-1d49333c1f8e/links HTTP/1.1



HTTP/1.1 200
Connection: close
Content-Length: 1111
Content-Type: application/json
Date: Tue, 21 Mar 2017 09:31:58 GMT
Server: Python/3.6 GNS3/2.0.0dev11
X-Route: /v2/projects/{project_id}/links

[
    {
        "capture_file_name": null,
        "capture_file_path": null,
        "capturing": false,
        "link_id": "9b74fb50-652a-47de-aa7a-f936fad2623a",
        "link_type": "ethernet",
        "nodes": [
            {
                "adapter_number": 0,
                "label": {
                    "rotation": 0,
                    "style": "font-size: 10; font-style: Verdana",
                    "text": "0/3",
                    "x": -10,
                    "y": -10
                },
                "node_id": "009935d3-bb71-48ee-8f8c-4160ecf36a1f",
                "port_number": 3
            },
            {
                "adapter_number": 2,
                "label": {
                    "rotation": 0,
                    "style": "font-size: 10; font-style: Verdana",
                    "text": "2/4",
                    "x": -10,
                    "y": -10
                },
                "node_id": "efd15e6d-cc6d-4b85-8e11-0389806f7231",
                "port_number": 4
            }
        ],
        "project_id": "19def516-231c-4a43-8fdb-1d49333c1f8e"
    }
]

POST /v2/projects/{project_id}/links¶

Create a new link instance

Parameters¶

  • project_id: Project UUID

Response status codes¶

  • 201: Link created
  • 400: Invalid request

Input¶

Name Mandatory Type Description
capture_file_name ['string', 'null'] Read only property. The name of the capture file if capture is running
capture_file_path ['string', 'null'] Read only property. The full path of the capture file if capture is running
capturing boolean Read only property. True if a capture running on the link
link_id string Link UUID
link_type enum Possible values: ethernet, serial
nodes ✔ array List of the VMS
project_id string Project UUID

Output¶

Name Mandatory Type Description
capture_file_name ['string', 'null'] Read only property. The name of the capture file if capture is running
capture_file_path ['string', 'null'] Read only property. The full path of the capture file if capture is running
capturing boolean Read only property. True if a capture running on the link
link_id string Link UUID
link_type enum Possible values: ethernet, serial
nodes ✔ array List of the VMS
project_id string Project UUID

Sample session¶

curl -i -X POST 'http://localhost:3080/v2/projects/b5301c53-908d-459c-8e27-46ca1b62968f/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49", "port_number": 3}, {"adapter_number": 0, "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49", "port_number": 4}]}'

POST /v2/projects/b5301c53-908d-459c-8e27-46ca1b62968f/links HTTP/1.1
{
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Text",
                "x": 42,
                "y": 0
            },
            "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49",
            "port_number": 3
        },
        {
            "adapter_number": 0,
            "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49",
            "port_number": 4
        }
    ]
}


HTTP/1.1 409
Connection: close
Content-Length: 64
Content-Type: application/json
Date: Tue, 21 Mar 2017 09:31:57 GMT
Server: Python/3.6 GNS3/2.0.0dev11
X-Route: /v2/projects/{project_id}/links

{
    "message": "Cannot connect to itself",
    "status": 409
}

Quick search

Navigation

  • index
  • next |
  • previous |
  • GNS3 2.0.1 documentation »
  • Endpoints »
  • Link »
© Copyright 2015, GNS3 GNS3 Technologies Inc.. Created using Sphinx 1.5.6.