/v2/projects/{project_id}/links¶
Contents
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/7ab38231-b22e-4fd0-aee1-cb41c268c55f/links'
GET /v2/projects/7ab38231-b22e-4fd0-aee1-cb41c268c55f/links HTTP/1.1
HTTP/1.1 200
Connection: close
Content-Length: 1293
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
[
{
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"filters": {
"frequency_drop": [
50
],
"latency": [
10
]
},
"link_id": "c0c00ce2-d6b4-407e-b125-1723c3a8af93",
"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": "5fd46ee8-414c-44c0-8bb9-c0e710d8513c",
"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": "22582b05-a01c-4010-9428-34c8c3b9dce0",
"port_number": 4
}
],
"project_id": "7ab38231-b22e-4fd0-aee1-cb41c268c55f",
"suspend": false
}
]
POST /v2/projects/{project_id}/links¶
Create a new link instance
Parameters¶
- project_id: Project UUID
Response status codes¶
- 400: Invalid request
- 201: Link created
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 POST 'http://localhost:3080/v2/projects/bfb83f16-dab4-445a-a572-d7cc1801222e/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "d3601934-e39a-4865-9cf5-3e46e1fe24e2", "port_number": 3}, {"adapter_number": 0, "node_id": "d3601934-e39a-4865-9cf5-3e46e1fe24e2", "port_number": 4}]}'
POST /v2/projects/bfb83f16-dab4-445a-a572-d7cc1801222e/links HTTP/1.1
{
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "d3601934-e39a-4865-9cf5-3e46e1fe24e2",
"port_number": 3
},
{
"adapter_number": 0,
"node_id": "d3601934-e39a-4865-9cf5-3e46e1fe24e2",
"port_number": 4
}
]
}
HTTP/1.1 409
Connection: close
Content-Length: 64
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
{
"message": "Cannot connect to itself",
"status": 409
}