Navigation

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

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

Contents

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

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

Get a link instance

Parameters¶

  • project_id: Project UUID
  • link_id: Link UUID

Response status codes¶

  • 200: Link found
  • 400: Invalid request
  • 404: Link doesn’t exist

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
filters object Packet filter. This allow to simulate latency and errors
link_id string Link UUID
link_type enum Possible values: ethernet, serial
nodes array List of the VMS
project_id string Project UUID
suspend boolean Suspend the link

Sample session¶

curl -i -X GET 'http://localhost:3080/v2/projects/23093d79-3767-40fa-a4d2-d6cb9b8b3ad6/links/5ef12b17-0fcd-41c3-b14d-ac9a123fd260'

GET /v2/projects/23093d79-3767-40fa-a4d2-d6cb9b8b3ad6/links/5ef12b17-0fcd-41c3-b14d-ac9a123fd260 HTTP/1.1



HTTP/1.1 200
Connection: close
Content-Length: 916
Content-Type: application/json
Date: Mon, 08 Jan 2018 08:16:36 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/links/{link_id}

{
    "capture_file_name": null,
    "capture_file_path": null,
    "capturing": false,
    "filters": {},
    "link_id": "5ef12b17-0fcd-41c3-b14d-ac9a123fd260",
    "link_type": "ethernet",
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Text",
                "x": 42,
                "y": 0
            },
            "node_id": "ad56b649-841c-4212-ad67-47e8637f86ca",
            "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": "4f2ca049-53e8-4cd1-bd81-396e2b2b40d1",
            "port_number": 4
        }
    ],
    "project_id": "23093d79-3767-40fa-a4d2-d6cb9b8b3ad6",
    "suspend": false
}

PUT /v2/projects/{project_id}/links/{link_id}¶

Update a link instance

Parameters¶

  • project_id: Project UUID
  • link_id: Link UUID

Response status codes¶

  • 201: Link updated
  • 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
filters object Packet filter. This allow to simulate latency and errors
link_id string Link UUID
link_type enum Possible values: ethernet, serial
nodes array List of the VMS
project_id string Project UUID
suspend boolean Suspend the link

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
filters object Packet filter. This allow to simulate latency and errors
link_id string Link UUID
link_type enum Possible values: ethernet, serial
nodes array List of the VMS
project_id string Project UUID
suspend boolean Suspend the link

Sample session¶

curl -i -X PUT 'http://localhost:3080/v2/projects/c4cba489-d792-4244-9242-07f53f6c4eac/links/e29aad22-7d24-4648-8282-0c41d1c7e70e' -d '{"filters": {"frequency_drop": [50], "latency": [10]}, "nodes": [{"adapter_number": 0, "label": {"text": "Hello", "x": 64, "y": 0}, "node_id": "eb22314e-ff91-4679-8b65-636ec8b34905", "port_number": 3}, {"adapter_number": 2, "node_id": "1268c0a0-8652-4dba-beaf-07cef8e0a310", "port_number": 4}]}'

PUT /v2/projects/c4cba489-d792-4244-9242-07f53f6c4eac/links/e29aad22-7d24-4648-8282-0c41d1c7e70e HTTP/1.1
{
    "filters": {
        "frequency_drop": [
            50
        ],
        "latency": [
            10
        ]
    },
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Hello",
                "x": 64,
                "y": 0
            },
            "node_id": "eb22314e-ff91-4679-8b65-636ec8b34905",
            "port_number": 3
        },
        {
            "adapter_number": 2,
            "node_id": "1268c0a0-8652-4dba-beaf-07cef8e0a310",
            "port_number": 4
        }
    ]
}


HTTP/1.1 201
Connection: close
Content-Length: 1022
Content-Type: application/json
Date: Mon, 08 Jan 2018 08:16:36 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/links/{link_id}

{
    "capture_file_name": null,
    "capture_file_path": null,
    "capturing": false,
    "filters": {
        "frequency_drop": [
            50
        ],
        "latency": [
            10
        ]
    },
    "link_id": "e29aad22-7d24-4648-8282-0c41d1c7e70e",
    "link_type": "ethernet",
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Hello",
                "x": 64,
                "y": 0
            },
            "node_id": "eb22314e-ff91-4679-8b65-636ec8b34905",
            "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": "1268c0a0-8652-4dba-beaf-07cef8e0a310",
            "port_number": 4
        }
    ],
    "project_id": "c4cba489-d792-4244-9242-07f53f6c4eac",
    "suspend": false
}

DELETE /v2/projects/{project_id}/links/{link_id}¶

Delete a link instance

Parameters¶

  • project_id: Project UUID
  • link_id: Link UUID

Response status codes¶

  • 204: Link deleted
  • 400: Invalid request

Sample session¶

curl -i -X DELETE 'http://localhost:3080/v2/projects/2883d355-8b23-4ddd-a21b-ff213e485c29/links/3b6257c1-ce3b-44c8-8c6c-a0457d6e9e04'

DELETE /v2/projects/2883d355-8b23-4ddd-a21b-ff213e485c29/links/3b6257c1-ce3b-44c8-8c6c-a0457d6e9e04 HTTP/1.1



HTTP/1.1 204
Connection: close
Content-Length: 0
Content-Type: application/octet-stream
Date: Mon, 08 Jan 2018 08:16:36 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/links/{link_id}

Quick search

Navigation

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