Navigation

  • index
  • next |
  • previous |
  • GNS3 2.1.8 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/082caf97-3374-471b-99e4-845bcd36b0c9/links/df7b0136-9495-4b8a-8b0b-00a6925c8cd2'

GET /v2/projects/082caf97-3374-471b-99e4-845bcd36b0c9/links/df7b0136-9495-4b8a-8b0b-00a6925c8cd2 HTTP/1.1



HTTP/1.1 200
Connection: close
Content-Length: 916
Content-Type: application/json
Date: Thu, 14 Jun 2018 08:35:14 GMT
Server: Python/3.5 GNS3/2.1.8dev1
X-Route: /v2/projects/{project_id}/links/{link_id}

{
    "capture_file_name": null,
    "capture_file_path": null,
    "capturing": false,
    "filters": {},
    "link_id": "df7b0136-9495-4b8a-8b0b-00a6925c8cd2",
    "link_type": "ethernet",
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Text",
                "x": 42,
                "y": 0
            },
            "node_id": "7bf2a264-2ca0-4306-a271-ebee05b4d2d9",
            "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": "d12382c7-9ff5-45cd-b928-d66b6a76c74b",
            "port_number": 4
        }
    ],
    "project_id": "082caf97-3374-471b-99e4-845bcd36b0c9",
    "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¶

  • 400: Invalid request
  • 201: Link updated

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/3f20f6cd-0674-41da-9ed9-36fbf90b87d5/links/8382d2ec-103b-4255-8073-d6754b2f72fc' -d '{"filters": {"frequency_drop": [50], "latency": [10]}, "nodes": [{"adapter_number": 0, "label": {"text": "Hello", "x": 64, "y": 0}, "node_id": "52e2c403-926e-470e-b27c-ae29c659ad72", "port_number": 3}, {"adapter_number": 2, "node_id": "7c514eac-e305-4fe3-b9d4-35db2558c172", "port_number": 4}]}'

PUT /v2/projects/3f20f6cd-0674-41da-9ed9-36fbf90b87d5/links/8382d2ec-103b-4255-8073-d6754b2f72fc HTTP/1.1
{
    "filters": {
        "frequency_drop": [
            50
        ],
        "latency": [
            10
        ]
    },
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Hello",
                "x": 64,
                "y": 0
            },
            "node_id": "52e2c403-926e-470e-b27c-ae29c659ad72",
            "port_number": 3
        },
        {
            "adapter_number": 2,
            "node_id": "7c514eac-e305-4fe3-b9d4-35db2558c172",
            "port_number": 4
        }
    ]
}


HTTP/1.1 201
Connection: close
Content-Length: 1022
Content-Type: application/json
Date: Thu, 14 Jun 2018 08:35:14 GMT
Server: Python/3.5 GNS3/2.1.8dev1
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": "8382d2ec-103b-4255-8073-d6754b2f72fc",
    "link_type": "ethernet",
    "nodes": [
        {
            "adapter_number": 0,
            "label": {
                "text": "Hello",
                "x": 64,
                "y": 0
            },
            "node_id": "52e2c403-926e-470e-b27c-ae29c659ad72",
            "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": "7c514eac-e305-4fe3-b9d4-35db2558c172",
            "port_number": 4
        }
    ],
    "project_id": "3f20f6cd-0674-41da-9ed9-36fbf90b87d5",
    "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¶

  • 400: Invalid request
  • 204: Link deleted

Sample session¶

curl -i -X DELETE 'http://localhost:3080/v2/projects/e2cf6437-055d-49f0-bcc6-5026d5a795d6/links/10456b36-5917-4992-a1c0-d2e07a56f2a2'

DELETE /v2/projects/e2cf6437-055d-49f0-bcc6-5026d5a795d6/links/10456b36-5917-4992-a1c0-d2e07a56f2a2 HTTP/1.1



HTTP/1.1 204
Connection: close
Content-Length: 0
Content-Type: application/octet-stream
Date: Thu, 14 Jun 2018 08:35:14 GMT
Server: Python/3.5 GNS3/2.1.8dev1
X-Route: /v2/projects/{project_id}/links/{link_id}

Quick search

Navigation

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