/v2/projects/{project_id}/links/{link_id}¶
Contents
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_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_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/1740ba78-ed59-4da9-880d-d2f4675a06c2/links/39a5ec94-aa23-4825-baad-853f0ac63e4a'
GET /v2/projects/1740ba78-ed59-4da9-880d-d2f4675a06c2/links/39a5ec94-aa23-4825-baad-853f0ac63e4a HTTP/1.1
HTTP/1.1 200
Connection: close
Content-Length: 921
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/{link_id}
{
"capture_compute_id": null,
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"filters": {},
"link_id": "39a5ec94-aa23-4825-baad-853f0ac63e4a",
"link_type": "ethernet",
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "4a330d9b-fbb1-4865-ae79-2350e8ca9397",
"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": "74ad52f6-faf2-4c6b-8b29-e36c9f0ba03a",
"port_number": 4
}
],
"project_id": "1740ba78-ed59-4da9-880d-d2f4675a06c2",
"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_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_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_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/85333131-b83a-4112-9a51-184ba0c536a8/links/b76bd8b1-2171-4361-9228-801713d23079' -d '{"filters": {"frequency_drop": [50], "latency": [10]}, "nodes": [{"adapter_number": 0, "label": {"text": "Hello", "x": 64, "y": 0}, "node_id": "8b77b480-361e-488b-96b1-a769890e11ec", "port_number": 3}, {"adapter_number": 2, "node_id": "b4688a3d-0af8-4ddc-b85f-e26dc1031c4c", "port_number": 4}]}'
PUT /v2/projects/85333131-b83a-4112-9a51-184ba0c536a8/links/b76bd8b1-2171-4361-9228-801713d23079 HTTP/1.1
{
"filters": {
"frequency_drop": [
50
],
"latency": [
10
]
},
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Hello",
"x": 64,
"y": 0
},
"node_id": "8b77b480-361e-488b-96b1-a769890e11ec",
"port_number": 3
},
{
"adapter_number": 2,
"node_id": "b4688a3d-0af8-4ddc-b85f-e26dc1031c4c",
"port_number": 4
}
]
}
HTTP/1.1 201
Connection: close
Content-Length: 1027
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/{link_id}
{
"capture_compute_id": null,
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"filters": {
"frequency_drop": [
50
],
"latency": [
10
]
},
"link_id": "b76bd8b1-2171-4361-9228-801713d23079",
"link_type": "ethernet",
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Hello",
"x": 64,
"y": 0
},
"node_id": "8b77b480-361e-488b-96b1-a769890e11ec",
"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": "b4688a3d-0af8-4ddc-b85f-e26dc1031c4c",
"port_number": 4
}
],
"project_id": "85333131-b83a-4112-9a51-184ba0c536a8",
"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/4589f3fc-4d98-4170-ac66-ed1262cac368/links/695dacc3-7daf-493e-b31f-3370436f1d23'
DELETE /v2/projects/4589f3fc-4d98-4170-ac66-ed1262cac368/links/695dacc3-7daf-493e-b31f-3370436f1d23 HTTP/1.1
HTTP/1.1 204
Connection: close
Content-Length: 0
Content-Type: application/octet-stream
Date: Wed, 08 Jan 2020 02:27:58 GMT
Server: Python/3.6 GNS3/2.2.4dev1
X-Route: /v2/projects/{project_id}/links/{link_id}