/v2/projects/{project_id}/links¶
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/51c1ac28-1756-4912-a31a-36d480326e9b/links'
GET /v2/projects/51c1ac28-1756-4912-a31a-36d480326e9b/links HTTP/1.1
HTTP/1.1 200
Connection: close
Content-Length: 1251
Content-Type: application/json
Date: Wed, 08 Jan 2020 02:27:58 GMT
Server: Python/3.6 GNS3/2.2.4dev1
X-Route: /v2/projects/{project_id}/links
[
{
"capture_compute_id": null,
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"filters": {
"frequency_drop": [
50
],
"latency": [
10
]
},
"link_id": "cff847b1-0233-4ee1-bb26-82039debff2b",
"link_type": "ethernet",
"nodes": [
{
"adapter_number": 0,
"label": {
"style": "font-family: TypeWriter;font-size: 10.0;font-weight: bold;fill: #000000;fill-opacity: 1.0;",
"text": "0/3"
},
"node_id": "fd4dc1ea-7688-4e42-bba1-71bfa31eddbc",
"port_number": 3
},
{
"adapter_number": 2,
"label": {
"style": "font-family: TypeWriter;font-size: 10.0;font-weight: bold;fill: #000000;fill-opacity: 1.0;",
"text": "2/4"
},
"node_id": "74e807d2-2e9a-467c-a44f-08b725c24cc9",
"port_number": 4
}
],
"project_id": "51c1ac28-1756-4912-a31a-36d480326e9b",
"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_compute_id | ['string', 'null'] | Read only property. The compute identifier where a capture is running | |
capture_file_name | ['string', 'null'] | Read only property. The name of the capture file if a capture is running | |
capture_file_path | ['string', 'null'] | Read only property. The full path of the capture file if a 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_style | object | Link line style | |
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_compute_id | ['string', 'null'] | Read only property. The compute identifier where a capture is running | |
capture_file_name | ['string', 'null'] | Read only property. The name of the capture file if a capture is running | |
capture_file_path | ['string', 'null'] | Read only property. The full path of the capture file if a 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_style | object | Link line style | |
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/44a8639a-c5e4-41f6-b4ad-f6577ba2f2a9/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "6025514b-8798-44ca-8531-26129710b202", "port_number": 3}, {"adapter_number": 0, "node_id": "6025514b-8798-44ca-8531-26129710b202", "port_number": 4}]}'
POST /v2/projects/44a8639a-c5e4-41f6-b4ad-f6577ba2f2a9/links HTTP/1.1
{
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "6025514b-8798-44ca-8531-26129710b202",
"port_number": 3
},
{
"adapter_number": 0,
"node_id": "6025514b-8798-44ca-8531-26129710b202",
"port_number": 4
}
]
}
HTTP/1.1 409
Connection: close
Content-Length: 64
Content-Type: application/json
Date: Wed, 08 Jan 2020 02:27:58 GMT
Server: Python/3.6 GNS3/2.2.4dev1
X-Route: /v2/projects/{project_id}/links
{
"message": "Cannot connect to itself",
"status": 409
}