/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/a683bc42-6b18-4c1e-9497-23f11f5e60bc/links'
GET /v2/projects/a683bc42-6b18-4c1e-9497-23f11f5e60bc/links HTTP/1.1
HTTP/1.1 200
Connection: close
Content-Length: 1111
Content-Type: application/json
Date: Thu, 29 Jun 2017 15:07:52 GMT
Server: Python/3.6 GNS3/2.1.0dev1
X-Route: /v2/projects/{project_id}/links
[
{
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"link_id": "a810aca4-4e76-47a2-9a33-78dd3c5d0f21",
"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": "13eee57f-4240-43eb-89f0-3cbe635f98d7",
"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": "a2102f85-9ca9-451e-aa67-f4c0f3dfc0a6",
"port_number": 4
}
],
"project_id": "a683bc42-6b18-4c1e-9497-23f11f5e60bc"
}
]
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 | |
link_id | string | Link UUID | |
link_type | enum | Possible values: ethernet, serial | |
nodes | ✔ | array | List of the VMS |
project_id | string | Project UUID |
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 | |
link_id | string | Link UUID | |
link_type | enum | Possible values: ethernet, serial | |
nodes | ✔ | array | List of the VMS |
project_id | string | Project UUID |
Sample session¶
curl -i -X POST 'http://localhost:3080/v2/projects/68e44845-f2da-451e-8641-5523c7a0a469/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "18f02b90-ad82-4f70-8bc5-dd2fe7186ca0", "port_number": 3}, {"adapter_number": 0, "node_id": "18f02b90-ad82-4f70-8bc5-dd2fe7186ca0", "port_number": 4}]}'
POST /v2/projects/68e44845-f2da-451e-8641-5523c7a0a469/links HTTP/1.1
{
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "18f02b90-ad82-4f70-8bc5-dd2fe7186ca0",
"port_number": 3
},
{
"adapter_number": 0,
"node_id": "18f02b90-ad82-4f70-8bc5-dd2fe7186ca0",
"port_number": 4
}
]
}
HTTP/1.1 409
Connection: close
Content-Length: 64
Content-Type: application/json
Date: Thu, 29 Jun 2017 15:07:51 GMT
Server: Python/3.6 GNS3/2.1.0dev1
X-Route: /v2/projects/{project_id}/links
{
"message": "Cannot connect to itself",
"status": 409
}