1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00
gns3-server/docs/api/examples/controller_post_projectsprojectidlinks.txt
2016-08-25 14:43:19 +02:00

63 lines
1.8 KiB
Plaintext

curl -i -X POST 'http://localhost:3080/v2/projects/3eca4ad9-19e6-48a5-8cf4-cc2076b3cf33/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "49b39d66-11d1-4155-89c4-99265417991b", "port_number": 3}, {"adapter_number": 2, "node_id": "71b97329-fbf9-41c6-a138-c8829a63050a", "port_number": 4}]}'
POST /v2/projects/3eca4ad9-19e6-48a5-8cf4-cc2076b3cf33/links HTTP/1.1
{
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "49b39d66-11d1-4155-89c4-99265417991b",
"port_number": 3
},
{
"adapter_number": 2,
"node_id": "71b97329-fbf9-41c6-a138-c8829a63050a",
"port_number": 4
}
]
}
HTTP/1.1 201
CONTENT-LENGTH: 846
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/2.0.0dev1
X-ROUTE: /v2/projects/{project_id}/links
{
"capture_file_name": null,
"capture_file_path": null,
"capturing": false,
"link_id": "1812c97d-3993-46f9-8bb6-65a36389f005",
"nodes": [
{
"adapter_number": 0,
"label": {
"text": "Text",
"x": 42,
"y": 0
},
"node_id": "49b39d66-11d1-4155-89c4-99265417991b",
"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": "71b97329-fbf9-41c6-a138-c8829a63050a",
"port_number": 4
}
],
"project_id": "3eca4ad9-19e6-48a5-8cf4-cc2076b3cf33"
}