/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/9ca80ee5-8396-4c65-a477-874532d42ed3/links'
GET /v2/projects/9ca80ee5-8396-4c65-a477-874532d42ed3/links HTTP/1.1
HTTP/1.1 200
Connection: close
Content-Length: 1293
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
[
{
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"filters": {
"frequency_drop": [
50
],
"latency": [
10
]
},
"link_id": "d61729b0-e4c8-4d29-9e37-ed7997d2fcd8",
"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": "2384cb6c-1783-4872-9c9e-91f015dee027",
"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": "a679eb04-b702-4353-baa2-3554e49396b1",
"port_number": 4
}
],
"project_id": "9ca80ee5-8396-4c65-a477-874532d42ed3",
"suspend": false
}
]
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 | |
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/1be6903e-2a33-456c-acac-0ce09f4bee53/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "7fd37d81-3c9e-42af-a5a1-04c859278b2b", "port_number": 3}, {"adapter_number": 0, "node_id": "7fd37d81-3c9e-42af-a5a1-04c859278b2b", "port_number": 4}]}'
POST /v2/projects/1be6903e-2a33-456c-acac-0ce09f4bee53/links HTTP/1.1
{
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "7fd37d81-3c9e-42af-a5a1-04c859278b2b",
"port_number": 3
},
{
"adapter_number": 0,
"node_id": "7fd37d81-3c9e-42af-a5a1-04c859278b2b",
"port_number": 4
}
]
}
HTTP/1.1 409
Connection: close
Content-Length: 64
Content-Type: application/json
Date: Mon, 08 Jan 2018 08:16:35 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/links
{
"message": "Cannot connect to itself",
"status": 409
}