diff --git a/.travis.yml b/.travis.yml index c6870778..664583a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,11 @@ install: - pip install -rdev-requirements.txt script: - py.test -v -s tests +deploy: + provider: pypi + user: noplay + password: + secure: Fa66zp8ML4oSGwzkUMZi07MIYfO3tbS5gHFUaLN2mk2MBknhCjDYexmFJqT//sC/+xqv6sSJE6rz1EPoy/THbxj8R96ZgIyiUZIbDCbzgdy92d7J/eusrDoNdpApBLke8NqQqtFETb3addMZZNofQ3IDANFD2m2jY+KECU8z8NI= + on: + tags: true + repo: GNS3/gns3-server diff --git a/CHANGELOG b/CHANGELOG index f1968a41..3b6baac5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,13 @@ # Change Log +## 2.0.0rc2 10/03/2017 + +* Drop color logging for remote install, seem to fail in some conditions +* Cleanup the remote install script +* Support for Xenial in remote install +* Fix GNS3VM settings are lost at startup +* When we receive settings from the client save them on disk + ## 2.0.0 RC 1 06/03/2017 * Update the documentation diff --git a/dev-requirements.txt b/dev-requirements.txt index 54339617..4cfd2926 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ -rrequirements.txt sphinx==1.5.3 -pytest==3.0.6 +pytest==3.0.7 pep8==1.7.0 pytest-catchlog==1.2.2 pytest-timeout==1.2.0 diff --git a/docs/api/examples/compute_delete_projectsprojectid.txt b/docs/api/examples/compute_delete_projectsprojectid.txt new file mode 100644 index 00000000..9e178398 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:47 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id} + diff --git a/docs/api/examples/compute_delete_projectsprojectidcloudnodesnodeid.txt b/docs/api/examples/compute_delete_projectsprojectidcloudnodesnodeid.txt new file mode 100644 index 00000000..483c3e97 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidcloudnodesnodeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/eeee4a80-b66d-4865-b9e6-92582712210c' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/eeee4a80-b66d-4865-b9e6-92582712210c HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:40 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/cloud/nodes/{node_id} + diff --git a/docs/api/examples/compute_delete_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..d85a52af --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/85766740-75a7-40e7-9dc2-31af994af8cd/adapters/0/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/85766740-75a7-40e7-9dc2-31af994af8cd/adapters/0/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:40 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/cloud/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_delete_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..0ee2ad82 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/908a6d69-00ce-403a-9627-a5a874acd69e/adapters/0/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/908a6d69-00ce-403a-9627-a5a874acd69e/adapters/0/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:42 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/docker/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_delete_projectsprojectidiounodesnodeid.txt b/docs/api/examples/compute_delete_projectsprojectidiounodesnodeid.txt new file mode 100644 index 00000000..f011ef4a --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidiounodesnodeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/e3bd45e7-0097-4fa6-af79-017a6f20d7c5' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/e3bd45e7-0097-4fa6-af79-017a6f20d7c5 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:44 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id} + diff --git a/docs/api/examples/compute_delete_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..fa51ccaa --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/9a33b2e9-8964-4ebc-bd59-054de444cf4f/adapters/1/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/9a33b2e9-8964-4ebc-bd59-054de444cf4f/adapters/1/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:44 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_delete_projectsprojectidnatnodesnodeid.txt b/docs/api/examples/compute_delete_projectsprojectidnatnodesnodeid.txt new file mode 100644 index 00000000..7c059af1 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidnatnodesnodeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/92b25428-6f34-41f0-b7ed-876cf67528c4' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/92b25428-6f34-41f0-b7ed-876cf67528c4 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/nat/nodes/{node_id} + diff --git a/docs/api/examples/compute_delete_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..ab6b688a --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/d468a9d2-40ce-4bda-92cf-0861eed15000/adapters/0/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/d468a9d2-40ce-4bda-92cf-0861eed15000/adapters/0/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/nat/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_delete_projectsprojectidqemunodesnodeid.txt b/docs/api/examples/compute_delete_projectsprojectidqemunodesnodeid.txt new file mode 100644 index 00000000..fd5b4f59 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidqemunodesnodeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/80371207-d146-4f75-ac1f-efa58b2fbc0a' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/80371207-d146-4f75-ac1f-efa58b2fbc0a HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:49 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id} + diff --git a/docs/api/examples/compute_delete_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..467032b2 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/13ae9cf1-8289-4d3f-b97b-cc677f9dc8c8/adapters/1/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/13ae9cf1-8289-4d3f-b97b-cc677f9dc8c8/adapters/1/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:50 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_delete_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..28c8fc6b --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/62493495-be49-416b-8761-4d9ed3709a80/adapters/0/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/62493495-be49-416b-8761-4d9ed3709a80/adapters/0/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_delete_projectsprojectidvpcsnodesnodeid.txt b/docs/api/examples/compute_delete_projectsprojectidvpcsnodesnodeid.txt new file mode 100644 index 00000000..b39869d1 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidvpcsnodesnodeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/07f5aea7-ca70-4efb-b103-1033630ca889' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/07f5aea7-ca70-4efb-b103-1033630ca889 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id} + diff --git a/docs/api/examples/compute_delete_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_delete_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..b6d46413 --- /dev/null +++ b/docs/api/examples/compute_delete_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/f663baf3-b84f-4ad0-a8b8-b8a43ebd8a2d/adapters/0/ports/0/nio' + +DELETE /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/f663baf3-b84f-4ad0-a8b8-b8a43ebd8a2d/adapters/0/ports/0/nio HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:54 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + diff --git a/docs/api/examples/compute_get_capabilities.txt b/docs/api/examples/compute_get_capabilities.txt new file mode 100644 index 00000000..af38f17d --- /dev/null +++ b/docs/api/examples/compute_get_capabilities.txt @@ -0,0 +1,33 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/capabilities' + +GET /v2/compute/capabilities HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 348 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:40 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/capabilities + +{ + "node_types": [ + "cloud", + "ethernet_hub", + "ethernet_switch", + "nat", + "vpcs", + "virtualbox", + "dynamips", + "frame_relay_switch", + "atm_switch", + "qemu", + "vmware", + "docker", + "iou" + ], + "platform": "linuxdebian", + "version": "2.0.0dev11" +} diff --git a/docs/api/examples/compute_get_iouimages.txt b/docs/api/examples/compute_get_iouimages.txt new file mode 100644 index 00000000..c260becd --- /dev/null +++ b/docs/api/examples/compute_get_iouimages.txt @@ -0,0 +1,22 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/iou/images' + +GET /v2/compute/iou/images HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 149 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/iou/images + +[ + { + "filename": "iou.bin", + "filesize": 7, + "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c", + "path": "iou.bin" + } +] diff --git a/docs/api/examples/compute_get_networkinterfaces.txt b/docs/api/examples/compute_get_networkinterfaces.txt new file mode 100644 index 00000000..49cce54e --- /dev/null +++ b/docs/api/examples/compute_get_networkinterfaces.txt @@ -0,0 +1,250 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/network/interfaces' + +GET /v2/compute/network/interfaces HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 5665 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:46 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/network/interfaces + +[ + { + "id": "bridge0", + "ip_address": "", + "mac_address": "d2:00:1b:c0:17:80", + "name": "bridge0", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "en0", + "ip_address": "", + "mac_address": "3c:07:54:78:07:cc", + "name": "en0", + "netmask": "", + "special": false, + "type": "ethernet" + }, + { + "id": "en1", + "ip_address": "192.168.84.156", + "mac_address": "68:a8:6d:4a:c3:16", + "name": "en1", + "netmask": "255.255.255.0", + "special": false, + "type": "ethernet" + }, + { + "id": "en2", + "ip_address": "", + "mac_address": "d2:00:1b:c0:17:80", + "name": "en2", + "netmask": "", + "special": false, + "type": "ethernet" + }, + { + "id": "fw0", + "ip_address": "", + "mac_address": "3c:07:54:ff:fe:bc:01:78", + "name": "fw0", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "lo0", + "ip_address": "127.0.0.1", + "mac_address": "", + "name": "lo0", + "netmask": "255.0.0.0", + "special": true, + "type": "ethernet" + }, + { + "id": "p2p0", + "ip_address": "", + "mac_address": "0a:a8:6d:4a:c3:16", + "name": "p2p0", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "utun0", + "ip_address": "", + "mac_address": "", + "name": "utun0", + "netmask": "", + "special": false, + "type": "ethernet" + }, + { + "id": "vboxnet0", + "ip_address": "", + "mac_address": "0a:00:27:00:00:00", + "name": "vboxnet0", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet1", + "ip_address": "", + "mac_address": "0a:00:27:00:00:01", + "name": "vboxnet1", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet2", + "ip_address": "", + "mac_address": "0a:00:27:00:00:02", + "name": "vboxnet2", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet3", + "ip_address": "", + "mac_address": "0a:00:27:00:00:03", + "name": "vboxnet3", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet4", + "ip_address": "", + "mac_address": "0a:00:27:00:00:04", + "name": "vboxnet4", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet5", + "ip_address": "", + "mac_address": "0a:00:27:00:00:05", + "name": "vboxnet5", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet6", + "ip_address": "", + "mac_address": "0a:00:27:00:00:06", + "name": "vboxnet6", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vboxnet7", + "ip_address": "", + "mac_address": "0a:00:27:00:00:07", + "name": "vboxnet7", + "netmask": "", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet1", + "ip_address": "172.16.16.1", + "mac_address": "00:50:56:c0:00:01", + "name": "vmnet1", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet10", + "ip_address": "172.16.7.1", + "mac_address": "00:50:56:c0:00:0a", + "name": "vmnet10", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet2", + "ip_address": "172.16.0.1", + "mac_address": "00:50:56:c0:00:02", + "name": "vmnet2", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet3", + "ip_address": "172.16.1.1", + "mac_address": "00:50:56:c0:00:03", + "name": "vmnet3", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet4", + "ip_address": "172.16.2.1", + "mac_address": "00:50:56:c0:00:04", + "name": "vmnet4", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet5", + "ip_address": "172.16.3.1", + "mac_address": "00:50:56:c0:00:05", + "name": "vmnet5", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet6", + "ip_address": "172.16.4.1", + "mac_address": "00:50:56:c0:00:06", + "name": "vmnet6", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet7", + "ip_address": "172.16.5.1", + "mac_address": "00:50:56:c0:00:07", + "name": "vmnet7", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet8", + "ip_address": "192.168.229.1", + "mac_address": "00:50:56:c0:00:08", + "name": "vmnet8", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + }, + { + "id": "vmnet9", + "ip_address": "172.16.6.1", + "mac_address": "00:50:56:c0:00:09", + "name": "vmnet9", + "netmask": "255.255.255.0", + "special": true, + "type": "ethernet" + } +] diff --git a/docs/api/examples/compute_get_projects.txt b/docs/api/examples/compute_get_projects.txt new file mode 100644 index 00000000..b090ccc4 --- /dev/null +++ b/docs/api/examples/compute_get_projects.txt @@ -0,0 +1,24 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects' + +GET /v2/compute/projects HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 198 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:47 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects + +[ + { + "name": "test", + "project_id": "51010203-0405-0607-0809-0a0b0c0d0e0f" + }, + { + "name": "test", + "project_id": "52010203-0405-0607-0809-0a0b0c0d0e0b" + } +] diff --git a/docs/api/examples/compute_get_projectsprojectid.txt b/docs/api/examples/compute_get_projectsprojectid.txt new file mode 100644 index 00000000..b3d33995 --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectid.txt @@ -0,0 +1,18 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/40010203-0405-0607-0809-0a0b0c0d0e02' + +GET /v2/compute/projects/40010203-0405-0607-0809-0a0b0c0d0e02 HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 80 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:46 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id} + +{ + "name": "test", + "project_id": "40010203-0405-0607-0809-0a0b0c0d0e02" +} diff --git a/docs/api/examples/compute_get_projectsprojectidcloudnodesnodeid.txt b/docs/api/examples/compute_get_projectsprojectidcloudnodesnodeid.txt new file mode 100644 index 00000000..a59db671 --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectidcloudnodesnodeid.txt @@ -0,0 +1,179 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/689c58e7-9112-4d4f-b5ea-37c5b478c332' + +GET /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/689c58e7-9112-4d4f-b5ea-37c5b478c332 HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 3855 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:40 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/cloud/nodes/{node_id} + +{ + "interfaces": [ + { + "name": "bridge0", + "special": true, + "type": "ethernet" + }, + { + "name": "en0", + "special": false, + "type": "ethernet" + }, + { + "name": "en1", + "special": false, + "type": "ethernet" + }, + { + "name": "en2", + "special": false, + "type": "ethernet" + }, + { + "name": "fw0", + "special": true, + "type": "ethernet" + }, + { + "name": "lo0", + "special": true, + "type": "ethernet" + }, + { + "name": "p2p0", + "special": true, + "type": "ethernet" + }, + { + "name": "utun0", + "special": false, + "type": "ethernet" + }, + { + "name": "vboxnet0", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet1", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet2", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet3", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet4", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet5", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet6", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet7", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet1", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet10", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet2", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet3", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet4", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet5", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet6", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet7", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet8", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet9", + "special": true, + "type": "ethernet" + } + ], + "name": "Cloud 1", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/builtin/689c58e7-9112-4d4f-b5ea-37c5b478c332", + "node_id": "689c58e7-9112-4d4f-b5ea-37c5b478c332", + "ports_mapping": [ + { + "interface": "en0", + "name": "en0", + "port_number": 0, + "type": "ethernet" + }, + { + "interface": "en1", + "name": "en1", + "port_number": 1, + "type": "ethernet" + }, + { + "interface": "en2", + "name": "en2", + "port_number": 2, + "type": "ethernet" + }, + { + "interface": "utun0", + "name": "utun0", + "port_number": 3, + "type": "ethernet" + } + ], + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "status": "started" +} diff --git a/docs/api/examples/compute_get_projectsprojectidiounodesnodeid.txt b/docs/api/examples/compute_get_projectsprojectidiounodesnodeid.txt new file mode 100644 index 00000000..d322d08a --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectidiounodesnodeid.txt @@ -0,0 +1,36 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/61f62c73-8480-4598-92ec-178b2046a5da' + +GET /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/61f62c73-8480-4598-92ec-178b2046a5da HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 768 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:43 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id} + +{ + "command_line": "", + "console": 5004, + "console_type": "telnet", + "ethernet_adapters": 2, + "l1_keepalives": false, + "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c", + "name": "PC TEST 1", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/iou/61f62c73-8480-4598-92ec-178b2046a5da", + "node_id": "61f62c73-8480-4598-92ec-178b2046a5da", + "nvram": 128, + "path": "iou.bin", + "private_config": null, + "private_config_content": null, + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 256, + "serial_adapters": 2, + "startup_config": null, + "startup_config_content": null, + "status": "stopped", + "use_default_iou_values": true +} diff --git a/docs/api/examples/compute_get_projectsprojectidnatnodesnodeid.txt b/docs/api/examples/compute_get_projectsprojectidnatnodesnodeid.txt new file mode 100644 index 00000000..07373914 --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectidnatnodesnodeid.txt @@ -0,0 +1,28 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/cd149043-78a0-4fda-aa96-e74c3abd90e8' + +GET /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/cd149043-78a0-4fda-aa96-e74c3abd90e8 HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 335 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/nat/nodes/{node_id} + +{ + "name": "Nat 1", + "node_id": "cd149043-78a0-4fda-aa96-e74c3abd90e8", + "ports_mapping": [ + { + "interface": "virbr0", + "name": "nat0", + "port_number": 0, + "type": "ethernet" + } + ], + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "status": "started" +} diff --git a/docs/api/examples/compute_get_projectsprojectidqemunodesnodeid.txt b/docs/api/examples/compute_get_projectsprojectidqemunodesnodeid.txt new file mode 100644 index 00000000..85846761 --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectidqemunodesnodeid.txt @@ -0,0 +1,59 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/6bdb5099-446a-43c4-9734-a2037011df6b' + +GET /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/6bdb5099-446a-43c4-9734-a2037011df6b HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 1468 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:48 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id} + +{ + "acpi_shutdown": false, + "adapter_type": "e1000", + "adapters": 1, + "bios_image": "", + "bios_image_md5sum": null, + "boot_priority": "c", + "cdrom_image": "", + "cdrom_image_md5sum": null, + "command_line": "", + "console": 5004, + "console_type": "telnet", + "cpu_throttling": 0, + "cpus": 1, + "hda_disk_image": "", + "hda_disk_image_md5sum": null, + "hda_disk_interface": "ide", + "hdb_disk_image": "", + "hdb_disk_image_md5sum": null, + "hdb_disk_interface": "ide", + "hdc_disk_image": "", + "hdc_disk_image_md5sum": null, + "hdc_disk_interface": "ide", + "hdd_disk_image": "", + "hdd_disk_image_md5sum": null, + "hdd_disk_interface": "ide", + "initrd": "", + "initrd_md5sum": null, + "kernel_command_line": "", + "kernel_image": "", + "kernel_image_md5sum": null, + "legacy_networking": false, + "mac_address": "00:dd:80:df:6b:00", + "name": "PC TEST 1", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/6bdb5099-446a-43c4-9734-a2037011df6b", + "node_id": "6bdb5099-446a-43c4-9734-a2037011df6b", + "options": "", + "platform": "x86_64", + "process_priority": "low", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp9s3gyopf/qemu-system-x86_64", + "ram": 256, + "status": "stopped", + "usage": "" +} diff --git a/docs/api/examples/compute_get_projectsprojectidvirtualboxnodesnodeid.txt b/docs/api/examples/compute_get_projectsprojectidvirtualboxnodesnodeid.txt new file mode 100644 index 00000000..1f2ff428 --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectidvirtualboxnodesnodeid.txt @@ -0,0 +1,31 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/29d6dc03-42e5-4c3b-9892-4e69a3dbac7c' + +GET /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/29d6dc03-42e5-4c3b-9892-4e69a3dbac7c HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 465 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:52 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id} + +{ + "acpi_shutdown": false, + "adapter_type": "Intel PRO/1000 MT Desktop (82540EM)", + "adapters": 0, + "console": 5004, + "console_type": "telnet", + "headless": false, + "linked_clone": false, + "name": "VMTEST", + "node_directory": null, + "node_id": "29d6dc03-42e5-4c3b-9892-4e69a3dbac7c", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 0, + "status": "stopped", + "use_any_adapter": false, + "vmname": "VMTEST" +} diff --git a/docs/api/examples/compute_get_projectsprojectidvpcsnodesnodeid.txt b/docs/api/examples/compute_get_projectsprojectidvpcsnodesnodeid.txt new file mode 100644 index 00000000..5ca3fa02 --- /dev/null +++ b/docs/api/examples/compute_get_projectsprojectidvpcsnodesnodeid.txt @@ -0,0 +1,26 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/8adc20e6-687b-4246-a470-be4a171ebd98' + +GET /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/8adc20e6-687b-4246-a470-be4a171ebd98 HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 489 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id} + +{ + "command_line": "", + "console": 5004, + "console_type": "telnet", + "name": "PC TEST 1", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/8adc20e6-687b-4246-a470-be4a171ebd98", + "node_id": "8adc20e6-687b-4246-a470-be4a171ebd98", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "startup_script": null, + "startup_script_path": null, + "status": "stopped" +} diff --git a/docs/api/examples/compute_get_qemubinaries.txt b/docs/api/examples/compute_get_qemubinaries.txt new file mode 100644 index 00000000..09dc7cb1 --- /dev/null +++ b/docs/api/examples/compute_get_qemubinaries.txt @@ -0,0 +1,32 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/qemu/binaries' -d '{"archs": ["i386"]}' + +GET /v2/compute/qemu/binaries HTTP/1.1 +{ + "archs": [ + "i386" + ] +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 212 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:50 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/qemu/binaries + +[ + { + "path": "/tmp/x86_64", + "version": "2.2.0" + }, + { + "path": "/tmp/alpha", + "version": "2.1.0" + }, + { + "path": "/tmp/i386", + "version": "2.1.0" + } +] diff --git a/docs/api/examples/compute_get_qemucapabilities.txt b/docs/api/examples/compute_get_qemucapabilities.txt new file mode 100644 index 00000000..1766d9c4 --- /dev/null +++ b/docs/api/examples/compute_get_qemucapabilities.txt @@ -0,0 +1,19 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/qemu/capabilities' + +GET /v2/compute/qemu/capabilities HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 39 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:51 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/qemu/capabilities + +{ + "kvm": [ + "x86_64" + ] +} diff --git a/docs/api/examples/compute_get_version.txt b/docs/api/examples/compute_get_version.txt new file mode 100644 index 00000000..5aa59985 --- /dev/null +++ b/docs/api/examples/compute_get_version.txt @@ -0,0 +1,18 @@ +curl -i -X GET 'http://localhost:3080/v2/compute/version' + +GET /v2/compute/version HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 50 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:51 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/version + +{ + "local": true, + "version": "2.0.0dev11" +} diff --git a/docs/api/examples/compute_post_projects.txt b/docs/api/examples/compute_post_projects.txt new file mode 100644 index 00000000..f283d6e1 --- /dev/null +++ b/docs/api/examples/compute_post_projects.txt @@ -0,0 +1,21 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects' -d '{"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f"}' + +POST /v2/compute/projects HTTP/1.1 +{ + "name": "test", + "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 80 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:46 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects + +{ + "name": "test", + "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f" +} diff --git a/docs/api/examples/compute_post_projectsprojectidclose.txt b/docs/api/examples/compute_post_projectsprojectidclose.txt new file mode 100644 index 00000000..e65d97b8 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidclose.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/close' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/close HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:47 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/close + diff --git a/docs/api/examples/compute_post_projectsprojectidcloudnodes.txt b/docs/api/examples/compute_post_projectsprojectidcloudnodes.txt new file mode 100644 index 00000000..b85ae2c8 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidcloudnodes.txt @@ -0,0 +1,181 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes' -d '{"name": "Cloud 1"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes HTTP/1.1 +{ + "name": "Cloud 1" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 3855 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:40 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/cloud/nodes + +{ + "interfaces": [ + { + "name": "bridge0", + "special": true, + "type": "ethernet" + }, + { + "name": "en0", + "special": false, + "type": "ethernet" + }, + { + "name": "en1", + "special": false, + "type": "ethernet" + }, + { + "name": "en2", + "special": false, + "type": "ethernet" + }, + { + "name": "fw0", + "special": true, + "type": "ethernet" + }, + { + "name": "lo0", + "special": true, + "type": "ethernet" + }, + { + "name": "p2p0", + "special": true, + "type": "ethernet" + }, + { + "name": "utun0", + "special": false, + "type": "ethernet" + }, + { + "name": "vboxnet0", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet1", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet2", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet3", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet4", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet5", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet6", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet7", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet1", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet10", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet2", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet3", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet4", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet5", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet6", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet7", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet8", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet9", + "special": true, + "type": "ethernet" + } + ], + "name": "Cloud 1", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/builtin/c435790d-867a-4e10-8c1c-7faa9b0f8700", + "node_id": "c435790d-867a-4e10-8c1c-7faa9b0f8700", + "ports_mapping": [ + { + "interface": "en0", + "name": "en0", + "port_number": 0, + "type": "ethernet" + }, + { + "interface": "en1", + "name": "en1", + "port_number": 1, + "type": "ethernet" + }, + { + "interface": "en2", + "name": "en2", + "port_number": 2, + "type": "ethernet" + }, + { + "interface": "utun0", + "name": "utun0", + "port_number": 3, + "type": "ethernet" + } + ], + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "status": "started" +} diff --git a/docs/api/examples/compute_post_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..a74a6711 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,25 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/91f7220f-e7da-4f00-b5bc-ef63c70b9f5b/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/91f7220f-e7da-4f00-b5bc-ef63c70b9f5b/adapters/0/ports/0/nio HTTP/1.1 +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 89 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:40 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/cloud/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} diff --git a/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..92bff1be --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,25 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/798507d5-9725-4bfa-945b-6a22d6c80f0f/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/798507d5-9725-4bfa-945b-6a22d6c80f0f/adapters/0/ports/0/nio HTTP/1.1 +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 89 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:42 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/docker/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} diff --git a/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt b/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt new file mode 100644 index 00000000..71cf7d8f --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt @@ -0,0 +1,20 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/fd243cd9-627a-4aa5-89af-b935882611e5/adapters/0/ports/0/start_capture' -d '{"capture_file_name": "test.pcap", "data_link_type": "DLT_EN10MB"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/fd243cd9-627a-4aa5-89af-b935882611e5/adapters/0/ports/0/start_capture HTTP/1.1 +{ + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 145 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:42 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/docker/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/start_capture + +{ + "pcap_file_path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/tmp/captures/test.pcap" +} diff --git a/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt b/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt new file mode 100644 index 00000000..2744120c --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/c58d8241-4b6c-439a-95dd-b259d221df8c/adapters/0/ports/0/stop_capture' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/c58d8241-4b6c-439a-95dd-b259d221df8c/adapters/0/ports/0/stop_capture HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:42 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/docker/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/stop_capture + diff --git a/docs/api/examples/compute_post_projectsprojectidiounodes.txt b/docs/api/examples/compute_post_projectsprojectidiounodes.txt new file mode 100644 index 00000000..3fb59dea --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodes.txt @@ -0,0 +1,41 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes' -d '{"name": "PC TEST 1", "node_id": "fc04f13f-c54d-421e-9a05-bb2fcc16857a", "path": "iou.bin", "startup_config_content": "hostname test"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes HTTP/1.1 +{ + "name": "PC TEST 1", + "node_id": "fc04f13f-c54d-421e-9a05-bb2fcc16857a", + "path": "iou.bin", + "startup_config_content": "hostname test" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 792 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:43 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes + +{ + "command_line": "", + "console": 5004, + "console_type": "telnet", + "ethernet_adapters": 2, + "l1_keepalives": false, + "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c", + "name": "PC TEST 1", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/iou/fc04f13f-c54d-421e-9a05-bb2fcc16857a", + "node_id": "fc04f13f-c54d-421e-9a05-bb2fcc16857a", + "nvram": 128, + "path": "iou.bin", + "private_config": null, + "private_config_content": null, + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 256, + "serial_adapters": 2, + "startup_config": "startup-config.cfg", + "startup_config_content": "echo hello", + "status": "stopped", + "use_default_iou_values": true +} diff --git a/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..f582d177 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,21 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/1120208e-153d-4328-bf77-7c87de8b14d2/adapters/1/ports/0/nio' -d '{"ethernet_device": "bridge0", "type": "nio_ethernet"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/1120208e-153d-4328-bf77-7c87de8b14d2/adapters/1/ports/0/nio HTTP/1.1 +{ + "ethernet_device": "bridge0", + "type": "nio_ethernet" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 64 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:44 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "ethernet_device": "bridge0", + "type": "nio_ethernet" +} diff --git a/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt new file mode 100644 index 00000000..6054e3d9 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt @@ -0,0 +1,20 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/9593ac62-eb3a-4f09-b351-90c26ed94b7e/adapters/0/ports/0/start_capture' -d '{"capture_file_name": "test.pcap", "data_link_type": "DLT_EN10MB"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/9593ac62-eb3a-4f09-b351-90c26ed94b7e/adapters/0/ports/0/start_capture HTTP/1.1 +{ + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 145 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/start_capture + +{ + "pcap_file_path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/tmp/captures/test.pcap" +} diff --git a/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt new file mode 100644 index 00000000..3a3b1cd1 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/61d07cd7-336f-43c9-8d54-148cf0b7cb49/adapters/0/ports/0/stop_capture' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/61d07cd7-336f-43c9-8d54-148cf0b7cb49/adapters/0/ports/0/stop_capture HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/stop_capture + diff --git a/docs/api/examples/compute_post_projectsprojectidiounodesnodeidreload.txt b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidreload.txt new file mode 100644 index 00000000..7fbbd6b2 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidreload.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/18fbfbba-4ccd-43e7-9f8b-5555e224809c/reload' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/18fbfbba-4ccd-43e7-9f8b-5555e224809c/reload HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:44 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/reload + diff --git a/docs/api/examples/compute_post_projectsprojectidiounodesnodeidstart.txt b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidstart.txt new file mode 100644 index 00000000..b558537e --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidstart.txt @@ -0,0 +1,38 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/22195b00-9af2-48d0-9e98-7f31463c7fd2/start' -d '{"iourc_content": "test"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/22195b00-9af2-48d0-9e98-7f31463c7fd2/start HTTP/1.1 +{ + "iourc_content": "test" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 768 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:43 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/start + +{ + "command_line": "", + "console": 5004, + "console_type": "telnet", + "ethernet_adapters": 2, + "l1_keepalives": false, + "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c", + "name": "PC TEST 1", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/iou/22195b00-9af2-48d0-9e98-7f31463c7fd2", + "node_id": "22195b00-9af2-48d0-9e98-7f31463c7fd2", + "nvram": 128, + "path": "iou.bin", + "private_config": null, + "private_config_content": null, + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 256, + "serial_adapters": 2, + "startup_config": null, + "startup_config_content": null, + "status": "stopped", + "use_default_iou_values": true +} diff --git a/docs/api/examples/compute_post_projectsprojectidiounodesnodeidstop.txt b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidstop.txt new file mode 100644 index 00000000..47929f87 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidiounodesnodeidstop.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/7b8cc3ee-4ed4-425b-85e4-673b79804390/stop' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/7b8cc3ee-4ed4-425b-85e4-673b79804390/stop HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:43 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id}/stop + diff --git a/docs/api/examples/compute_post_projectsprojectidnatnodes.txt b/docs/api/examples/compute_post_projectsprojectidnatnodes.txt new file mode 100644 index 00000000..149c9d65 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidnatnodes.txt @@ -0,0 +1,30 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes' -d '{"name": "Nat 1"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes HTTP/1.1 +{ + "name": "Nat 1" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 335 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/nat/nodes + +{ + "name": "Nat 1", + "node_id": "681a2b8d-0213-4851-9a40-9ecd68165e8e", + "ports_mapping": [ + { + "interface": "virbr0", + "name": "nat0", + "port_number": 0, + "type": "ethernet" + } + ], + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "status": "started" +} diff --git a/docs/api/examples/compute_post_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..6599f799 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,25 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/b952ac47-f2b1-4683-8e67-84b35c017b4e/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/b952ac47-f2b1-4683-8e67-84b35c017b4e/adapters/0/ports/0/nio HTTP/1.1 +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 89 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:45 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/nat/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} diff --git a/docs/api/examples/compute_post_projectsprojectidportsudp.txt b/docs/api/examples/compute_post_projectsprojectidportsudp.txt new file mode 100644 index 00000000..cc468082 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidportsudp.txt @@ -0,0 +1,17 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/ports/udp' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/ports/udp HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 25 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:46 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/ports/udp + +{ + "udp_port": 10000 +} diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodes.txt b/docs/api/examples/compute_post_projectsprojectidqemunodes.txt new file mode 100644 index 00000000..d1ba6c21 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodes.txt @@ -0,0 +1,64 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes' -d '{"hda_disk_image": "linux\u8f7d.img", "name": "PC TEST 1", "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp9s3gyopf/qemu-system-x86_64", "ram": 1024}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes HTTP/1.1 +{ + "hda_disk_image": "linux\u8f7d.img", + "name": "PC TEST 1", + "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp9s3gyopf/qemu-system-x86_64", + "ram": 1024 +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 1514 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:48 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes + +{ + "acpi_shutdown": false, + "adapter_type": "e1000", + "adapters": 1, + "bios_image": "", + "bios_image_md5sum": null, + "boot_priority": "c", + "cdrom_image": "", + "cdrom_image_md5sum": null, + "command_line": "", + "console": 5004, + "console_type": "telnet", + "cpu_throttling": 0, + "cpus": 1, + "hda_disk_image": "linux\u8f7d.img", + "hda_disk_image_md5sum": "c4ca4238a0b923820dcc509a6f75849b", + "hda_disk_interface": "ide", + "hdb_disk_image": "", + "hdb_disk_image_md5sum": null, + "hdb_disk_interface": "ide", + "hdc_disk_image": "", + "hdc_disk_image_md5sum": null, + "hdc_disk_interface": "ide", + "hdd_disk_image": "", + "hdd_disk_image_md5sum": null, + "hdd_disk_interface": "ide", + "initrd": "", + "initrd_md5sum": null, + "kernel_command_line": "", + "kernel_image": "", + "kernel_image_md5sum": null, + "legacy_networking": false, + "mac_address": "00:dd:80:71:32:00", + "name": "PC TEST 1", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/e49b7703-f596-4e60-9e30-f5bc6f917132", + "node_id": "e49b7703-f596-4e60-9e30-f5bc6f917132", + "options": "", + "platform": "x86_64", + "process_priority": "low", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp9s3gyopf/qemu-system-x86_64", + "ram": 1024, + "status": "stopped", + "usage": "" +} diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..c2c2e7c2 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,21 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/a6011c49-adf8-4e1e-8731-4c963315f662/adapters/1/ports/0/nio' -d '{"ethernet_device": "eth0", "type": "nio_ethernet"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/a6011c49-adf8-4e1e-8731-4c963315f662/adapters/1/ports/0/nio HTTP/1.1 +{ + "ethernet_device": "eth0", + "type": "nio_ethernet" +} + + +HTTP/1.1 409 +Connection: close +Content-Length: 81 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:50 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "message": "NIO of type nio_ethernet is not supported", + "status": 409 +} diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidreload.txt b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidreload.txt new file mode 100644 index 00000000..787a622c --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidreload.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/64933f6c-e8cb-480c-81a2-075de93d09d9/reload' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/64933f6c-e8cb-480c-81a2-075de93d09d9/reload HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:49 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/reload + diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidresume.txt b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidresume.txt new file mode 100644 index 00000000..6db3f494 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidresume.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/84a63d18-61c2-4a77-97eb-4d54b19b8825/resume' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/84a63d18-61c2-4a77-97eb-4d54b19b8825/resume HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:49 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/resume + diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidstart.txt b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidstart.txt new file mode 100644 index 00000000..89870d7b --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidstart.txt @@ -0,0 +1,59 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/0ec7c554-3bc6-42e2-9284-11b6b1e51db1/start' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/0ec7c554-3bc6-42e2-9284-11b6b1e51db1/start HTTP/1.1 +{} + + +HTTP/1.1 200 +Connection: close +Content-Length: 1468 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:48 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/start + +{ + "acpi_shutdown": false, + "adapter_type": "e1000", + "adapters": 1, + "bios_image": "", + "bios_image_md5sum": null, + "boot_priority": "c", + "cdrom_image": "", + "cdrom_image_md5sum": null, + "command_line": "", + "console": 5004, + "console_type": "telnet", + "cpu_throttling": 0, + "cpus": 1, + "hda_disk_image": "", + "hda_disk_image_md5sum": null, + "hda_disk_interface": "ide", + "hdb_disk_image": "", + "hdb_disk_image_md5sum": null, + "hdb_disk_interface": "ide", + "hdc_disk_image": "", + "hdc_disk_image_md5sum": null, + "hdc_disk_interface": "ide", + "hdd_disk_image": "", + "hdd_disk_image_md5sum": null, + "hdd_disk_interface": "ide", + "initrd": "", + "initrd_md5sum": null, + "kernel_command_line": "", + "kernel_image": "", + "kernel_image_md5sum": null, + "legacy_networking": false, + "mac_address": "00:dd:80:1d:b1:00", + "name": "PC TEST 1", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/0ec7c554-3bc6-42e2-9284-11b6b1e51db1", + "node_id": "0ec7c554-3bc6-42e2-9284-11b6b1e51db1", + "options": "", + "platform": "x86_64", + "process_priority": "low", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp9s3gyopf/qemu-system-x86_64", + "ram": 256, + "status": "stopped", + "usage": "" +} diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidstop.txt b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidstop.txt new file mode 100644 index 00000000..e848d6eb --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidstop.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/0c174db5-a2c4-464f-98e7-153b83532e35/stop' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/0c174db5-a2c4-464f-98e7-153b83532e35/stop HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:48 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/stop + diff --git a/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidsuspend.txt b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidsuspend.txt new file mode 100644 index 00000000..2f76964f --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidqemunodesnodeidsuspend.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/3668274c-d74e-4f59-ab74-ab52442ccf61/suspend' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/3668274c-d74e-4f59-ab74-ab52442ccf61/suspend HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:49 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id}/suspend + diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodes.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodes.txt new file mode 100644 index 00000000..c34d30de --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodes.txt @@ -0,0 +1,35 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes' -d '{"linked_clone": false, "name": "VM1", "vmname": "VM1"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes HTTP/1.1 +{ + "linked_clone": false, + "name": "VM1", + "vmname": "VM1" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 459 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:52 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes + +{ + "acpi_shutdown": false, + "adapter_type": "Intel PRO/1000 MT Desktop (82540EM)", + "adapters": 0, + "console": 5004, + "console_type": "telnet", + "headless": false, + "linked_clone": false, + "name": "VM1", + "node_directory": null, + "node_id": "4c74d21f-6af2-4fde-82a6-5e15c3037dd8", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 0, + "status": "stopped", + "use_any_adapter": false, + "vmname": "VM1" +} diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..bf07d3a9 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,25 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/950553f4-1f4c-4d47-ab35-b00817c9dae9/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/950553f4-1f4c-4d47-ab35-b00817c9dae9/adapters/0/ports/0/nio HTTP/1.1 +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 89 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidreload.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidreload.txt new file mode 100644 index 00000000..49dd3a3c --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidreload.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/a89cbf17-8504-4590-a4db-214adf91b473/reload' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/a89cbf17-8504-4590-a4db-214adf91b473/reload HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/reload + diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidresume.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidresume.txt new file mode 100644 index 00000000..22bf27ed --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidresume.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/b11da8d7-abb5-401e-a53a-3ce767c1a1bb/resume' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/b11da8d7-abb5-401e-a53a-3ce767c1a1bb/resume HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/resume + diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidstart.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidstart.txt new file mode 100644 index 00000000..799c9a81 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidstart.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/0e7a38fe-7626-4d75-a545-8b0764472eec/start' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/0e7a38fe-7626-4d75-a545-8b0764472eec/start HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:52 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/start + diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidstop.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidstop.txt new file mode 100644 index 00000000..6ff5e675 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidstop.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/23d775e8-6206-4f15-9bad-3cc5c75dd219/stop' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/23d775e8-6206-4f15-9bad-3cc5c75dd219/stop HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:52 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/stop + diff --git a/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidsuspend.txt b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidsuspend.txt new file mode 100644 index 00000000..052b319e --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvirtualboxnodesnodeidsuspend.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/b3e67522-dd20-4bde-b2e8-43e815d65b6d/suspend' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/b3e67522-dd20-4bde-b2e8-43e815d65b6d/suspend HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:52 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id}/suspend + diff --git a/docs/api/examples/compute_post_projectsprojectidvpcsnodes.txt b/docs/api/examples/compute_post_projectsprojectidvpcsnodes.txt new file mode 100644 index 00000000..d6ef95f4 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvpcsnodes.txt @@ -0,0 +1,28 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes' -d '{"name": "PC TEST 1"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes HTTP/1.1 +{ + "name": "PC TEST 1" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 489 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes + +{ + "command_line": "", + "console": 5004, + "console_type": "telnet", + "name": "PC TEST 1", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/54184038-3552-4386-8a8d-7c13080fae06", + "node_id": "54184038-3552-4386-8a8d-7c13080fae06", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "startup_script": null, + "startup_script_path": null, + "status": "stopped" +} diff --git a/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt new file mode 100644 index 00000000..47c54d9f --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt @@ -0,0 +1,25 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/ed43313f-0b29-44a2-9183-a3703fe1aad0/adapters/0/ports/0/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/ed43313f-0b29-44a2-9183-a3703fe1aad0/adapters/0/ports/0/nio HTTP/1.1 +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 89 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:54 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio + +{ + "lport": 4242, + "rhost": "127.0.0.1", + "rport": 4343, + "type": "nio_udp" +} diff --git a/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidreload.txt b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidreload.txt new file mode 100644 index 00000000..d20d5c41 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidreload.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/cfdc8b6c-4254-4f9c-9095-7886c4b8894a/reload' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/cfdc8b6c-4254-4f9c-9095-7886c4b8894a/reload HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:54 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id}/reload + diff --git a/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidstart.txt b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidstart.txt new file mode 100644 index 00000000..5e565e09 --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidstart.txt @@ -0,0 +1,26 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/27e35650-731f-48a5-a318-92e2c00031a8/start' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/27e35650-731f-48a5-a318-92e2c00031a8/start HTTP/1.1 +{} + + +HTTP/1.1 200 +Connection: close +Content-Length: 489 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:54 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id}/start + +{ + "command_line": "", + "console": 5004, + "console_type": "telnet", + "name": "PC TEST 1", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/27e35650-731f-48a5-a318-92e2c00031a8", + "node_id": "27e35650-731f-48a5-a318-92e2c00031a8", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "startup_script": null, + "startup_script_path": null, + "status": "stopped" +} diff --git a/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidstop.txt b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidstop.txt new file mode 100644 index 00000000..37c9579a --- /dev/null +++ b/docs/api/examples/compute_post_projectsprojectidvpcsnodesnodeidstop.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/bbe7cc55-ef05-4ae9-9d4c-b4aad8468c85/stop' -d '{}' + +POST /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/bbe7cc55-ef05-4ae9-9d4c-b4aad8468c85/stop HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:54 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id}/stop + diff --git a/docs/api/examples/compute_post_qemuimg.txt b/docs/api/examples/compute_post_qemuimg.txt new file mode 100644 index 00000000..e47149bd --- /dev/null +++ b/docs/api/examples/compute_post_qemuimg.txt @@ -0,0 +1,23 @@ +curl -i -X POST 'http://localhost:3080/v2/compute/qemu/img' -d '{"cluster_size": 64, "format": "qcow2", "lazy_refcounts": "off", "path": "/tmp/hda.qcow2", "preallocation": "metadata", "qemu_img": "/tmp/qemu-img", "refcount_bits": 12, "size": 100}' + +POST /v2/compute/qemu/img HTTP/1.1 +{ + "cluster_size": 64, + "format": "qcow2", + "lazy_refcounts": "off", + "path": "/tmp/hda.qcow2", + "preallocation": "metadata", + "qemu_img": "/tmp/qemu-img", + "refcount_bits": 12, + "size": 100 +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:51 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/qemu/img + diff --git a/docs/api/examples/compute_put_projectsprojectidcloudnodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectidcloudnodesnodeid.txt new file mode 100644 index 00000000..efc9fb2c --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectidcloudnodesnodeid.txt @@ -0,0 +1,181 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/35d71fe5-356d-440e-a170-d88e35258f06' -d '{"name": "test"}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/cloud/nodes/35d71fe5-356d-440e-a170-d88e35258f06 HTTP/1.1 +{ + "name": "test" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 3852 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:41 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/cloud/nodes/{node_id} + +{ + "interfaces": [ + { + "name": "bridge0", + "special": true, + "type": "ethernet" + }, + { + "name": "en0", + "special": false, + "type": "ethernet" + }, + { + "name": "en1", + "special": false, + "type": "ethernet" + }, + { + "name": "en2", + "special": false, + "type": "ethernet" + }, + { + "name": "fw0", + "special": true, + "type": "ethernet" + }, + { + "name": "lo0", + "special": true, + "type": "ethernet" + }, + { + "name": "p2p0", + "special": true, + "type": "ethernet" + }, + { + "name": "utun0", + "special": false, + "type": "ethernet" + }, + { + "name": "vboxnet0", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet1", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet2", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet3", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet4", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet5", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet6", + "special": true, + "type": "ethernet" + }, + { + "name": "vboxnet7", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet1", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet10", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet2", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet3", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet4", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet5", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet6", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet7", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet8", + "special": true, + "type": "ethernet" + }, + { + "name": "vmnet9", + "special": true, + "type": "ethernet" + } + ], + "name": "test", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/builtin/35d71fe5-356d-440e-a170-d88e35258f06", + "node_id": "35d71fe5-356d-440e-a170-d88e35258f06", + "ports_mapping": [ + { + "interface": "en0", + "name": "en0", + "port_number": 0, + "type": "ethernet" + }, + { + "interface": "en1", + "name": "en1", + "port_number": 1, + "type": "ethernet" + }, + { + "interface": "en2", + "name": "en2", + "port_number": 2, + "type": "ethernet" + }, + { + "interface": "utun0", + "name": "utun0", + "port_number": 3, + "type": "ethernet" + } + ], + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "status": "started" +} diff --git a/docs/api/examples/compute_put_projectsprojectiddockernodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectiddockernodesnodeid.txt new file mode 100644 index 00000000..74614c22 --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectiddockernodesnodeid.txt @@ -0,0 +1,37 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/8df7b67d-41b8-48b7-a8b3-f25248b9af21' -d '{"console": 5006, "environment": "GNS3=1\nGNS4=0", "name": "test", "start_command": "yes"}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/docker/nodes/8df7b67d-41b8-48b7-a8b3-f25248b9af21 HTTP/1.1 +{ + "console": 5006, + "environment": "GNS3=1\nGNS4=0", + "name": "test", + "start_command": "yes" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 653 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:42 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/docker/nodes/{node_id} + +{ + "adapters": 2, + "aux": 5005, + "console": 5006, + "console_http_path": "/", + "console_http_port": 80, + "console_resolution": "1280x1024", + "console_type": "telnet", + "container_id": "8bd8153ea8f5", + "environment": "GNS3=1\nGNS4=0", + "image": "nginx:latest", + "name": "test", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/docker/8df7b67d-41b8-48b7-a8b3-f25248b9af21", + "node_id": "8df7b67d-41b8-48b7-a8b3-f25248b9af21", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "start_command": "yes", + "status": "stopped" +} diff --git a/docs/api/examples/compute_put_projectsprojectidiounodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectidiounodesnodeid.txt new file mode 100644 index 00000000..96bcda1f --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectidiounodesnodeid.txt @@ -0,0 +1,47 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/8b936d3d-8b50-437f-a205-15ce77fd4240' -d '{"console": 5005, "ethernet_adapters": 4, "iourc_content": "test", "l1_keepalives": true, "name": "test", "nvram": 2048, "ram": 512, "serial_adapters": 0, "startup_config_content": "hostname test", "use_default_iou_values": true}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/iou/nodes/8b936d3d-8b50-437f-a205-15ce77fd4240 HTTP/1.1 +{ + "console": 5005, + "ethernet_adapters": 4, + "iourc_content": "test", + "l1_keepalives": true, + "name": "test", + "nvram": 2048, + "ram": 512, + "serial_adapters": 0, + "startup_config_content": "hostname test", + "use_default_iou_values": true +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 790 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:44 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/iou/nodes/{node_id} + +{ + "command_line": "", + "console": 5005, + "console_type": "telnet", + "ethernet_adapters": 4, + "l1_keepalives": true, + "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c", + "name": "test", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_json5/project-files/iou/8b936d3d-8b50-437f-a205-15ce77fd4240", + "node_id": "8b936d3d-8b50-437f-a205-15ce77fd4240", + "nvram": 2048, + "path": "iou.bin", + "private_config": null, + "private_config_content": null, + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 512, + "serial_adapters": 0, + "startup_config": "startup-config.cfg", + "startup_config_content": "hostname test", + "status": "stopped", + "use_default_iou_values": true +} diff --git a/docs/api/examples/compute_put_projectsprojectidnatnodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectidnatnodesnodeid.txt new file mode 100644 index 00000000..5541b4f5 --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectidnatnodesnodeid.txt @@ -0,0 +1,30 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/94f5a8c9-1e9e-42b0-bbba-5937d05c9c24' -d '{"name": "test"}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/nat/nodes/94f5a8c9-1e9e-42b0-bbba-5937d05c9c24 HTTP/1.1 +{ + "name": "test" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 334 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:46 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/nat/nodes/{node_id} + +{ + "name": "test", + "node_id": "94f5a8c9-1e9e-42b0-bbba-5937d05c9c24", + "ports_mapping": [ + { + "interface": "virbr0", + "name": "nat0", + "port_number": 0, + "type": "ethernet" + } + ], + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "status": "started" +} diff --git a/docs/api/examples/compute_put_projectsprojectidqemunodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectidqemunodesnodeid.txt new file mode 100644 index 00000000..e6bd3665 --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectidqemunodesnodeid.txt @@ -0,0 +1,64 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/a88ca6cb-fea5-40c2-ada6-73f056e94eb7' -d '{"console": 5006, "hdb_disk_image": "linux\u8f7d.img", "name": "test", "ram": 1024}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/qemu/nodes/a88ca6cb-fea5-40c2-ada6-73f056e94eb7 HTTP/1.1 +{ + "console": 5006, + "hdb_disk_image": "linux\u8f7d.img", + "name": "test", + "ram": 1024 +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 1509 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:49 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/qemu/nodes/{node_id} + +{ + "acpi_shutdown": false, + "adapter_type": "e1000", + "adapters": 1, + "bios_image": "", + "bios_image_md5sum": null, + "boot_priority": "c", + "cdrom_image": "", + "cdrom_image_md5sum": null, + "command_line": "", + "console": 5006, + "console_type": "telnet", + "cpu_throttling": 0, + "cpus": 1, + "hda_disk_image": "", + "hda_disk_image_md5sum": null, + "hda_disk_interface": "ide", + "hdb_disk_image": "linux\u8f7d.img", + "hdb_disk_image_md5sum": "c4ca4238a0b923820dcc509a6f75849b", + "hdb_disk_interface": "ide", + "hdc_disk_image": "", + "hdc_disk_image_md5sum": null, + "hdc_disk_interface": "ide", + "hdd_disk_image": "", + "hdd_disk_image_md5sum": null, + "hdd_disk_interface": "ide", + "initrd": "", + "initrd_md5sum": null, + "kernel_command_line": "", + "kernel_image": "", + "kernel_image_md5sum": null, + "legacy_networking": false, + "mac_address": "00:dd:80:4e:b7:00", + "name": "test", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/qemu/a88ca6cb-fea5-40c2-ada6-73f056e94eb7", + "node_id": "a88ca6cb-fea5-40c2-ada6-73f056e94eb7", + "options": "", + "platform": "x86_64", + "process_priority": "low", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "qemu_path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp9s3gyopf/qemu-system-x86_64", + "ram": 1024, + "status": "stopped", + "usage": "" +} diff --git a/docs/api/examples/compute_put_projectsprojectidvirtualboxnodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectidvirtualboxnodesnodeid.txt new file mode 100644 index 00000000..0f5bc0c8 --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectidvirtualboxnodesnodeid.txt @@ -0,0 +1,34 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/26188067-49b1-40f6-8b2c-11ed74c7ac18' -d '{"console": 5005, "name": "test"}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/virtualbox/nodes/26188067-49b1-40f6-8b2c-11ed74c7ac18 HTTP/1.1 +{ + "console": 5005, + "name": "test" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 463 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:53 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/virtualbox/nodes/{node_id} + +{ + "acpi_shutdown": false, + "adapter_type": "Intel PRO/1000 MT Desktop (82540EM)", + "adapters": 0, + "console": 5005, + "console_type": "telnet", + "headless": false, + "linked_clone": false, + "name": "test", + "node_directory": null, + "node_id": "26188067-49b1-40f6-8b2c-11ed74c7ac18", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "ram": 0, + "status": "stopped", + "use_any_adapter": false, + "vmname": "VMTEST" +} diff --git a/docs/api/examples/compute_put_projectsprojectidvpcsnodesnodeid.txt b/docs/api/examples/compute_put_projectsprojectidvpcsnodesnodeid.txt new file mode 100644 index 00000000..a231fe7a --- /dev/null +++ b/docs/api/examples/compute_put_projectsprojectidvpcsnodesnodeid.txt @@ -0,0 +1,29 @@ +curl -i -X PUT 'http://localhost:3080/v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/550cc2b9-d124-467d-9407-3754c6bc287d' -d '{"console": 5006, "name": "test"}' + +PUT /v2/compute/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/vpcs/nodes/550cc2b9-d124-467d-9407-3754c6bc287d HTTP/1.1 +{ + "console": 5006, + "name": "test" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 484 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/compute/projects/{project_id}/vpcs/nodes/{node_id} + +{ + "command_line": "", + "console": 5006, + "console_type": "telnet", + "name": "test", + "node_directory": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0ha7d1aj/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80/project-files/vpcs/550cc2b9-d124-467d-9407-3754c6bc287d", + "node_id": "550cc2b9-d124-467d-9407-3754c6bc287d", + "project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80", + "startup_script": null, + "startup_script_path": null, + "status": "stopped" +} diff --git a/docs/api/examples/controller_delete_computescomputeid.txt b/docs/api/examples/controller_delete_computescomputeid.txt new file mode 100644 index 00000000..dc020a2f --- /dev/null +++ b/docs/api/examples/controller_delete_computescomputeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/computes/my_compute_id' + +DELETE /v2/computes/my_compute_id HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes/{compute_id} + diff --git a/docs/api/examples/controller_delete_projectsprojectid.txt b/docs/api/examples/controller_delete_projectsprojectid.txt new file mode 100644 index 00000000..ecd91052 --- /dev/null +++ b/docs/api/examples/controller_delete_projectsprojectid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/projects/1dec0fc5-4480-403e-b86a-3c356920a828' + +DELETE /v2/projects/1dec0fc5-4480-403e-b86a-3c356920a828 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:32:02 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id} + diff --git a/docs/api/examples/controller_delete_projectsprojectiddrawingsdrawingid.txt b/docs/api/examples/controller_delete_projectsprojectiddrawingsdrawingid.txt new file mode 100644 index 00000000..aada0189 --- /dev/null +++ b/docs/api/examples/controller_delete_projectsprojectiddrawingsdrawingid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/projects/24ef7002-5dd6-4054-bf8a-d2aface0885e/drawings/b2f8b12f-a4cc-4621-affc-cf3dcd4ba513' + +DELETE /v2/projects/24ef7002-5dd6-4054-bf8a-d2aface0885e/drawings/b2f8b12f-a4cc-4621-affc-cf3dcd4ba513 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:56 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/drawings/{drawing_id} + diff --git a/docs/api/examples/controller_delete_projectsprojectidlinkslinkid.txt b/docs/api/examples/controller_delete_projectsprojectidlinkslinkid.txt new file mode 100644 index 00000000..eaee40f8 --- /dev/null +++ b/docs/api/examples/controller_delete_projectsprojectidlinkslinkid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/projects/42a1b682-b5bf-4de4-b5af-5366fc20a111/links/105966d0-8a04-4cf5-95a4-ff13f1de7660' + +DELETE /v2/projects/42a1b682-b5bf-4de4-b5af-5366fc20a111/links/105966d0-8a04-4cf5-95a4-ff13f1de7660 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:58 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/links/{link_id} + diff --git a/docs/api/examples/controller_delete_projectsprojectidnodesnodeid.txt b/docs/api/examples/controller_delete_projectsprojectidnodesnodeid.txt new file mode 100644 index 00000000..e9771f4f --- /dev/null +++ b/docs/api/examples/controller_delete_projectsprojectidnodesnodeid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/projects/856d9a5f-f0fc-4a14-ab9c-6cd61abde4f6/nodes/5d7c89f2-3a82-4ad5-918d-798dc70aefb3' + +DELETE /v2/projects/856d9a5f-f0fc-4a14-ab9c-6cd61abde4f6/nodes/5d7c89f2-3a82-4ad5-918d-798dc70aefb3 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id} + diff --git a/docs/api/examples/controller_delete_projectsprojectidsnapshotssnapshotid.txt b/docs/api/examples/controller_delete_projectsprojectidsnapshotssnapshotid.txt new file mode 100644 index 00000000..42dbb8fb --- /dev/null +++ b/docs/api/examples/controller_delete_projectsprojectidsnapshotssnapshotid.txt @@ -0,0 +1,14 @@ +curl -i -X DELETE 'http://localhost:3080/v2/projects/c84befb2-e203-4357-9958-770bd92cb1f2/snapshots/c65dfead-1080-45a1-85bf-57b0fe5983a2' + +DELETE /v2/projects/c84befb2-e203-4357-9958-770bd92cb1f2/snapshots/c65dfead-1080-45a1-85bf-57b0fe5983a2 HTTP/1.1 + + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:32:04 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/snapshots/{snapshot_id} + diff --git a/docs/api/examples/controller_get_computes.txt b/docs/api/examples/controller_get_computes.txt new file mode 100644 index 00000000..fcddc113 --- /dev/null +++ b/docs/api/examples/controller_get_computes.txt @@ -0,0 +1,31 @@ +curl -i -X GET 'http://localhost:3080/v2/computes' + +GET /v2/computes HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 387 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes + +[ + { + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute_id", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "My super server", + "port": 84, + "protocol": "http", + "user": "julien" + } +] diff --git a/docs/api/examples/controller_get_computescomputeid.txt b/docs/api/examples/controller_get_computescomputeid.txt new file mode 100644 index 00000000..91b74f80 --- /dev/null +++ b/docs/api/examples/controller_get_computescomputeid.txt @@ -0,0 +1,29 @@ +curl -i -X GET 'http://localhost:3080/v2/computes/my_compute_id' + +GET /v2/computes/my_compute_id HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 334 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes/{compute_id} + +{ + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute_id", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "http://julien@localhost:84", + "port": 84, + "protocol": "http", + "user": "julien" +} diff --git a/docs/api/examples/controller_get_computescomputeidemulatoraction.txt b/docs/api/examples/controller_get_computescomputeidemulatoraction.txt new file mode 100644 index 00000000..5f732660 --- /dev/null +++ b/docs/api/examples/controller_get_computescomputeidemulatoraction.txt @@ -0,0 +1,15 @@ +curl -i -X GET 'http://localhost:3080/v2/computes/my_compute/virtualbox/vms' + +GET /v2/computes/my_compute/virtualbox/vms HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 2 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:56 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes/{compute_id}/{emulator}/{action:.+} + +[] diff --git a/docs/api/examples/controller_get_computescomputeidemulatorimages.txt b/docs/api/examples/controller_get_computescomputeidemulatorimages.txt new file mode 100644 index 00000000..4bf53f78 --- /dev/null +++ b/docs/api/examples/controller_get_computescomputeidemulatorimages.txt @@ -0,0 +1,22 @@ +curl -i -X GET 'http://localhost:3080/v2/computes/my_compute/qemu/images' + +GET /v2/computes/my_compute/qemu/images HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 95 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes/{compute_id}/{emulator}/images + +[ + { + "filename": "linux.qcow2" + }, + { + "filename": "asav.qcow2" + } +] diff --git a/docs/api/examples/controller_get_gns3vm.txt b/docs/api/examples/controller_get_gns3vm.txt new file mode 100644 index 00000000..930c664a --- /dev/null +++ b/docs/api/examples/controller_get_gns3vm.txt @@ -0,0 +1,23 @@ +curl -i -X GET 'http://localhost:3080/v2/gns3vm' + +GET /v2/gns3vm HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 148 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:57 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/gns3vm + +{ + "enable": false, + "engine": "vmware", + "headless": false, + "ram": 2048, + "vcpus": 1, + "vmname": null, + "when_exit": "stop" +} diff --git a/docs/api/examples/controller_get_gns3vmengines.txt b/docs/api/examples/controller_get_gns3vmengines.txt new file mode 100644 index 00000000..516840ed --- /dev/null +++ b/docs/api/examples/controller_get_gns3vmengines.txt @@ -0,0 +1,40 @@ +curl -i -X GET 'http://localhost:3080/v2/gns3vm/engines' + +GET /v2/gns3vm/engines HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 1110 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:57 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/gns3vm/engines + +[ + { + "description": "VMware is the recommended choice for best performances.
The GNS3 VM can be downloaded here.", + "engine_id": "vmware", + "name": "VMware Fusion", + "support_headless": true, + "support_ram": true, + "support_when_exit": true + }, + { + "description": "VirtualBox doesn't support nested virtualization, this means running Qemu based VM could be very slow.
The GNS3 VM can be downloaded here", + "engine_id": "virtualbox", + "name": "VirtualBox", + "support_headless": true, + "support_ram": true, + "support_when_exit": true + }, + { + "description": "Use a remote GNS3 server as the GNS3 VM.", + "engine_id": "remote", + "name": "Remote", + "support_headless": false, + "support_ram": false, + "support_when_exit": false + } +] diff --git a/docs/api/examples/controller_get_gns3vmenginesenginevms.txt b/docs/api/examples/controller_get_gns3vmenginesenginevms.txt new file mode 100644 index 00000000..11980c5e --- /dev/null +++ b/docs/api/examples/controller_get_gns3vmenginesenginevms.txt @@ -0,0 +1,19 @@ +curl -i -X GET 'http://localhost:3080/v2/gns3vm/engines/vmware/vms' + +GET /v2/gns3vm/engines/vmware/vms HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 40 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:57 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/gns3vm/engines/{engine}/vms + +[ + { + "vmname": "test" + } +] diff --git a/docs/api/examples/controller_get_projects.txt b/docs/api/examples/controller_get_projects.txt new file mode 100644 index 00000000..872279f8 --- /dev/null +++ b/docs/api/examples/controller_get_projects.txt @@ -0,0 +1,28 @@ +curl -i -X GET 'http://localhost:3080/v2/projects' + +GET /v2/projects HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 428 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:01 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects + +[ + { + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_list_projects1", + "project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" + } +] diff --git a/docs/api/examples/controller_get_projectsprojectid.txt b/docs/api/examples/controller_get_projectsprojectid.txt new file mode 100644 index 00000000..66604d36 --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectid.txt @@ -0,0 +1,26 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/30013d5e-b284-4098-a12b-435d9ffdfc50' + +GET /v2/projects/30013d5e-b284-4098-a12b-435d9ffdfc50 HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 379 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:02 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id} + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpoa69sgpa/projects/30013d5e-b284-4098-a12b-435d9ffdfc50", + "project_id": "30013d5e-b284-4098-a12b-435d9ffdfc50", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_get_projectsprojectiddrawings.txt b/docs/api/examples/controller_get_projectsprojectiddrawings.txt new file mode 100644 index 00000000..93a1fb77 --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectiddrawings.txt @@ -0,0 +1,25 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/adb641a0-8ec9-4b5a-b8df-cc993638c601/drawings' + +GET /v2/projects/adb641a0-8ec9-4b5a-b8df-cc993638c601/drawings HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 363 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:56 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/drawings + +[ + { + "drawing_id": "377bccc0-779a-44b0-ab5e-98dfd6dc46cd", + "project_id": "adb641a0-8ec9-4b5a-b8df-cc993638c601", + "rotation": 0, + "svg": "", + "x": 10, + "y": 20, + "z": 0 + } +] diff --git a/docs/api/examples/controller_get_projectsprojectidlinks.txt b/docs/api/examples/controller_get_projectsprojectidlinks.txt new file mode 100644 index 00000000..3840f352 --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectidlinks.txt @@ -0,0 +1,50 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/19def516-231c-4a43-8fdb-1d49333c1f8e/links' + +GET /v2/projects/19def516-231c-4a43-8fdb-1d49333c1f8e/links HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 1111 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:58 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/links + +[ + { + "capture_file_name": null, + "capture_file_path": null, + "capturing": false, + "link_id": "9b74fb50-652a-47de-aa7a-f936fad2623a", + "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": "009935d3-bb71-48ee-8f8c-4160ecf36a1f", + "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": "efd15e6d-cc6d-4b85-8e11-0389806f7231", + "port_number": 4 + } + ], + "project_id": "19def516-231c-4a43-8fdb-1d49333c1f8e" + } +] diff --git a/docs/api/examples/controller_get_projectsprojectidnodes.txt b/docs/api/examples/controller_get_projectsprojectidnodes.txt new file mode 100644 index 00000000..e3f06cc0 --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectidnodes.txt @@ -0,0 +1,60 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/387fb37d-314e-43b4-8fbd-4f1266662100/nodes' + +GET /v2/projects/387fb37d-314e-43b4-8fbd-4f1266662100/nodes HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 1303 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes + +[ + { + "command_line": null, + "compute_id": "example.com", + "console": 2048, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "af74aa64-c387-4903-9879-16e5fe26c0df", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "387fb37d-314e-43b4-8fbd-4f1266662100", + "properties": { + "startup_script": "echo test" + }, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 + } +] diff --git a/docs/api/examples/controller_get_projectsprojectidnodesnodeid.txt b/docs/api/examples/controller_get_projectsprojectidnodesnodeid.txt new file mode 100644 index 00000000..5c8ce23c --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectidnodesnodeid.txt @@ -0,0 +1,58 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/b97cbb09-8eef-4def-b338-ab29d9942bc2/nodes/8d4fce2b-5b61-446d-b7a7-93b07e4cabac' + +GET /v2/projects/b97cbb09-8eef-4def-b338-ab29d9942bc2/nodes/8d4fce2b-5b61-446d-b7a7-93b07e4cabac HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 1123 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id} + +{ + "command_line": null, + "compute_id": "example.com", + "console": 2048, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "8d4fce2b-5b61-446d-b7a7-93b07e4cabac", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "b97cbb09-8eef-4def-b338-ab29d9942bc2", + "properties": { + "startup_script": "echo test" + }, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/examples/controller_get_projectsprojectidnodesnodeiddynamipsautoidlepc.txt b/docs/api/examples/controller_get_projectsprojectidnodesnodeiddynamipsautoidlepc.txt new file mode 100644 index 00000000..f976b40d --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectidnodesnodeiddynamipsautoidlepc.txt @@ -0,0 +1,17 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/5892e20f-136f-4a75-821d-004f039a7db4/nodes/3e529564-a1cd-4852-a4cc-2193da8782df/dynamips/auto_idlepc' + +GET /v2/projects/5892e20f-136f-4a75-821d-004f039a7db4/nodes/3e529564-a1cd-4852-a4cc-2193da8782df/dynamips/auto_idlepc HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 30 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id}/dynamips/auto_idlepc + +{ + "idlepc": "0x60606f54" +} diff --git a/docs/api/examples/controller_get_projectsprojectidnodesnodeiddynamipsidlepcproposals.txt b/docs/api/examples/controller_get_projectsprojectidnodesnodeiddynamipsidlepcproposals.txt new file mode 100644 index 00000000..f2a07df5 --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectidnodesnodeiddynamipsidlepcproposals.txt @@ -0,0 +1,18 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/f6d48c79-bbf2-48e9-87dd-706fcf40eb7b/nodes/3a1aa9c0-8ea9-4372-874a-412edc9022d5/dynamips/idlepc_proposals' + +GET /v2/projects/f6d48c79-bbf2-48e9-87dd-706fcf40eb7b/nodes/3a1aa9c0-8ea9-4372-874a-412edc9022d5/dynamips/idlepc_proposals HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 38 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:01 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id}/dynamips/idlepc_proposals + +[ + "0x60606f54", + "0x33805a22" +] diff --git a/docs/api/examples/controller_get_projectsprojectidsnapshots.txt b/docs/api/examples/controller_get_projectsprojectidsnapshots.txt new file mode 100644 index 00000000..a11c3fbb --- /dev/null +++ b/docs/api/examples/controller_get_projectsprojectidsnapshots.txt @@ -0,0 +1,22 @@ +curl -i -X GET 'http://localhost:3080/v2/projects/ea93460a-c843-4c89-b8ad-5cfd322292fc/snapshots' + +GET /v2/projects/ea93460a-c843-4c89-b8ad-5cfd322292fc/snapshots HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 197 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:04 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/snapshots + +[ + { + "created_at": 1490088724, + "name": "test", + "project_id": "ea93460a-c843-4c89-b8ad-5cfd322292fc", + "snapshot_id": "2f250c44-3f80-437a-bac7-b03e66e0482a" + } +] diff --git a/docs/api/examples/controller_get_settings.txt b/docs/api/examples/controller_get_settings.txt new file mode 100644 index 00000000..22b2d16b --- /dev/null +++ b/docs/api/examples/controller_get_settings.txt @@ -0,0 +1,17 @@ +curl -i -X GET 'http://localhost:3080/v2/settings' + +GET /v2/settings HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 20 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:04 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/settings + +{ + "test": true +} diff --git a/docs/api/examples/controller_get_symbols.txt b/docs/api/examples/controller_get_symbols.txt new file mode 100644 index 00000000..da476709 --- /dev/null +++ b/docs/api/examples/controller_get_symbols.txt @@ -0,0 +1,221 @@ +curl -i -X GET 'http://localhost:3080/v2/symbols' + +GET /v2/symbols HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 5174 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:05 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/symbols + +[ + { + "builtin": true, + "filename": "PBX.svg", + "symbol_id": ":/symbols/PBX.svg" + }, + { + "builtin": true, + "filename": "PIX_firewall.svg", + "symbol_id": ":/symbols/PIX_firewall.svg" + }, + { + "builtin": true, + "filename": "access_point.svg", + "symbol_id": ":/symbols/access_point.svg" + }, + { + "builtin": true, + "filename": "access_server.svg", + "symbol_id": ":/symbols/access_server.svg" + }, + { + "builtin": true, + "filename": "asa.svg", + "symbol_id": ":/symbols/asa.svg" + }, + { + "builtin": true, + "filename": "atm_bridge.svg", + "symbol_id": ":/symbols/atm_bridge.svg" + }, + { + "builtin": true, + "filename": "atm_switch.svg", + "symbol_id": ":/symbols/atm_switch.svg" + }, + { + "builtin": true, + "filename": "call_manager.svg", + "symbol_id": ":/symbols/call_manager.svg" + }, + { + "builtin": true, + "filename": "cloud.svg", + "symbol_id": ":/symbols/cloud.svg" + }, + { + "builtin": true, + "filename": "computer.svg", + "symbol_id": ":/symbols/computer.svg" + }, + { + "builtin": true, + "filename": "docker_guest.svg", + "symbol_id": ":/symbols/docker_guest.svg" + }, + { + "builtin": true, + "filename": "dslam.svg", + "symbol_id": ":/symbols/dslam.svg" + }, + { + "builtin": true, + "filename": "edge_label_switch_router.svg", + "symbol_id": ":/symbols/edge_label_switch_router.svg" + }, + { + "builtin": true, + "filename": "ethernet_switch.svg", + "symbol_id": ":/symbols/ethernet_switch.svg" + }, + { + "builtin": true, + "filename": "firewall.svg", + "symbol_id": ":/symbols/firewall.svg" + }, + { + "builtin": true, + "filename": "frame_relay_switch.svg", + "symbol_id": ":/symbols/frame_relay_switch.svg" + }, + { + "builtin": true, + "filename": "gateway.svg", + "symbol_id": ":/symbols/gateway.svg" + }, + { + "builtin": true, + "filename": "hub.svg", + "symbol_id": ":/symbols/hub.svg" + }, + { + "builtin": true, + "filename": "ids.svg", + "symbol_id": ":/symbols/ids.svg" + }, + { + "builtin": true, + "filename": "iosv_l2_virl.svg", + "symbol_id": ":/symbols/iosv_l2_virl.svg" + }, + { + "builtin": true, + "filename": "iosv_virl.svg", + "symbol_id": ":/symbols/iosv_virl.svg" + }, + { + "builtin": true, + "filename": "ip_phone.svg", + "symbol_id": ":/symbols/ip_phone.svg" + }, + { + "builtin": true, + "filename": "label_switch_router.svg", + "symbol_id": ":/symbols/label_switch_router.svg" + }, + { + "builtin": true, + "filename": "lightweight_ap.svg", + "symbol_id": ":/symbols/lightweight_ap.svg" + }, + { + "builtin": true, + "filename": "multilayer_switch.svg", + "symbol_id": ":/symbols/multilayer_switch.svg" + }, + { + "builtin": true, + "filename": "optical_router.svg", + "symbol_id": ":/symbols/optical_router.svg" + }, + { + "builtin": true, + "filename": "printer.svg", + "symbol_id": ":/symbols/printer.svg" + }, + { + "builtin": true, + "filename": "qemu_guest.svg", + "symbol_id": ":/symbols/qemu_guest.svg" + }, + { + "builtin": true, + "filename": "route_switch_processor.svg", + "symbol_id": ":/symbols/route_switch_processor.svg" + }, + { + "builtin": true, + "filename": "router.awp.svg", + "symbol_id": ":/symbols/router.awp.svg" + }, + { + "builtin": true, + "filename": "router.svg", + "symbol_id": ":/symbols/router.svg" + }, + { + "builtin": true, + "filename": "router_firewall.svg", + "symbol_id": ":/symbols/router_firewall.svg" + }, + { + "builtin": true, + "filename": "router_netflow.svg", + "symbol_id": ":/symbols/router_netflow.svg" + }, + { + "builtin": true, + "filename": "server.svg", + "symbol_id": ":/symbols/server.svg" + }, + { + "builtin": true, + "filename": "sip_server.svg", + "symbol_id": ":/symbols/sip_server.svg" + }, + { + "builtin": true, + "filename": "vbox_guest.svg", + "symbol_id": ":/symbols/vbox_guest.svg" + }, + { + "builtin": true, + "filename": "vmware_guest.svg", + "symbol_id": ":/symbols/vmware_guest.svg" + }, + { + "builtin": true, + "filename": "voice_access_server.svg", + "symbol_id": ":/symbols/voice_access_server.svg" + }, + { + "builtin": true, + "filename": "voice_router.svg", + "symbol_id": ":/symbols/voice_router.svg" + }, + { + "builtin": true, + "filename": "vpcs_guest.svg", + "symbol_id": ":/symbols/vpcs_guest.svg" + }, + { + "builtin": true, + "filename": "wlan_controller.svg", + "symbol_id": ":/symbols/wlan_controller.svg" + } +] diff --git a/docs/api/examples/controller_get_version.txt b/docs/api/examples/controller_get_version.txt new file mode 100644 index 00000000..efdc73d0 --- /dev/null +++ b/docs/api/examples/controller_get_version.txt @@ -0,0 +1,18 @@ +curl -i -X GET 'http://localhost:3080/v2/version' + +GET /v2/version HTTP/1.1 + + + +HTTP/1.1 200 +Connection: close +Content-Length: 50 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:05 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/version + +{ + "local": true, + "version": "2.0.0dev11" +} diff --git a/docs/api/examples/controller_post_computes.txt b/docs/api/examples/controller_post_computes.txt new file mode 100644 index 00000000..210fe8ad --- /dev/null +++ b/docs/api/examples/controller_post_computes.txt @@ -0,0 +1,36 @@ +curl -i -X POST 'http://localhost:3080/v2/computes' -d '{"compute_id": "my_compute_id", "host": "localhost", "password": "secure", "port": 84, "protocol": "http", "user": "julien"}' + +POST /v2/computes HTTP/1.1 +{ + "compute_id": "my_compute_id", + "host": "localhost", + "password": "secure", + "port": 84, + "protocol": "http", + "user": "julien" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 334 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes + +{ + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute_id", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "http://julien@localhost:84", + "port": 84, + "protocol": "http", + "user": "julien" +} diff --git a/docs/api/examples/controller_post_computescomputeidemulatoraction.txt b/docs/api/examples/controller_post_computescomputeidemulatoraction.txt new file mode 100644 index 00000000..0b4165ab --- /dev/null +++ b/docs/api/examples/controller_post_computescomputeidemulatoraction.txt @@ -0,0 +1,17 @@ +curl -i -X POST 'http://localhost:3080/v2/computes/my_compute/qemu/img' -d '{"path": "/test"}' + +POST /v2/computes/my_compute/qemu/img HTTP/1.1 +{ + "path": "/test" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 2 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:56 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes/{compute_id}/{emulator}/{action:.+} + +[] diff --git a/docs/api/examples/controller_post_projects.txt b/docs/api/examples/controller_post_projects.txt new file mode 100644 index 00000000..01b0b1a5 --- /dev/null +++ b/docs/api/examples/controller_post_projects.txt @@ -0,0 +1,29 @@ +curl -i -X POST 'http://localhost:3080/v2/projects' -d '{"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f"}' + +POST /v2/projects HTTP/1.1 +{ + "name": "test", + "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 379 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:01 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpvvmlo0a7/projects/10010203-0405-0607-0809-0a0b0c0d0e0f", + "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_post_projectsload.txt b/docs/api/examples/controller_post_projectsload.txt new file mode 100644 index 00000000..f837e4a9 --- /dev/null +++ b/docs/api/examples/controller_post_projectsload.txt @@ -0,0 +1,28 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/load' -d '{"path": "/tmp/test.gns3"}' + +POST /v2/projects/load HTTP/1.1 +{ + "path": "/tmp/test.gns3" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 379 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:02 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/load + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpdmzj8ewe/projects/6f6fbad5-35c3-4138-82bd-42ba3d91d686", + "project_id": "6f6fbad5-35c3-4138-82bd-42ba3d91d686", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_post_projectsprojectidclose.txt b/docs/api/examples/controller_post_projectsprojectidclose.txt new file mode 100644 index 00000000..e88afe00 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidclose.txt @@ -0,0 +1,26 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/c9676cae-5a4b-45f7-a579-e95a094a34c5/close' -d '{}' + +POST /v2/projects/c9676cae-5a4b-45f7-a579-e95a094a34c5/close HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 379 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:02 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/close + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpcc0rph8f/projects/c9676cae-5a4b-45f7-a579-e95a094a34c5", + "project_id": "c9676cae-5a4b-45f7-a579-e95a094a34c5", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_post_projectsprojectiddrawings.txt b/docs/api/examples/controller_post_projectsprojectiddrawings.txt new file mode 100644 index 00000000..dab71e73 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectiddrawings.txt @@ -0,0 +1,28 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/cfd8b048-cac1-4bf4-a47d-cdcc731e4a89/drawings' -d '{"svg": "", "x": 10, "y": 20, "z": 0}' + +POST /v2/projects/cfd8b048-cac1-4bf4-a47d-cdcc731e4a89/drawings HTTP/1.1 +{ + "svg": "", + "x": 10, + "y": 20, + "z": 0 +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 323 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:56 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/drawings + +{ + "drawing_id": "a00d5332-87f1-4637-87d5-a92a34ad684d", + "project_id": "cfd8b048-cac1-4bf4-a47d-cdcc731e4a89", + "rotation": 0, + "svg": "", + "x": 10, + "y": 20, + "z": 0 +} diff --git a/docs/api/examples/controller_post_projectsprojectidduplicate.txt b/docs/api/examples/controller_post_projectsprojectidduplicate.txt new file mode 100644 index 00000000..4e5c6c08 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidduplicate.txt @@ -0,0 +1,28 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/6f0141f9-5caa-4650-afd8-823df4aa7f8f/duplicate' -d '{"name": "hello"}' + +POST /v2/projects/6f0141f9-5caa-4650-afd8-823df4aa7f8f/duplicate HTTP/1.1 +{ + "name": "hello" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 350 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:03 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/duplicate + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "hello.gns3", + "name": "hello", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp04wueli7/projects/hello", + "project_id": "2f6d7639-ba59-44b8-a0b9-cbe62c48c2be", + "scene_height": 1000, + "scene_width": 2000, + "status": "closed" +} diff --git a/docs/api/examples/controller_post_projectsprojectidlinks.txt b/docs/api/examples/controller_post_projectsprojectidlinks.txt new file mode 100644 index 00000000..22e2e5bd --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidlinks.txt @@ -0,0 +1,36 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/b5301c53-908d-459c-8e27-46ca1b62968f/links' -d '{"nodes": [{"adapter_number": 0, "label": {"text": "Text", "x": 42, "y": 0}, "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49", "port_number": 3}, {"adapter_number": 0, "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49", "port_number": 4}]}' + +POST /v2/projects/b5301c53-908d-459c-8e27-46ca1b62968f/links HTTP/1.1 +{ + "nodes": [ + { + "adapter_number": 0, + "label": { + "text": "Text", + "x": 42, + "y": 0 + }, + "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49", + "port_number": 3 + }, + { + "adapter_number": 0, + "node_id": "3e38d20a-5059-40b7-93d8-91d7f61f3f49", + "port_number": 4 + } + ] +} + + +HTTP/1.1 409 +Connection: close +Content-Length: 64 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:57 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/links + +{ + "message": "Cannot connect to itself", + "status": 409 +} diff --git a/docs/api/examples/controller_post_projectsprojectidlinkslinkidstartcapture.txt b/docs/api/examples/controller_post_projectsprojectidlinkslinkidstartcapture.txt new file mode 100644 index 00000000..403c81ca --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidlinkslinkidstartcapture.txt @@ -0,0 +1,23 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/7f25b14b-4f3d-4259-aa4c-f60f02354636/links/43bc51b2-9cea-4fc2-af09-d61b895aaaf7/start_capture' -d '{}' + +POST /v2/projects/7f25b14b-4f3d-4259-aa4c-f60f02354636/links/43bc51b2-9cea-4fc2-af09-d61b895aaaf7/start_capture HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 247 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:58 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/links/{link_id}/start_capture + +{ + "capture_file_name": null, + "capture_file_path": null, + "capturing": false, + "link_id": "43bc51b2-9cea-4fc2-af09-d61b895aaaf7", + "link_type": "ethernet", + "nodes": [], + "project_id": "7f25b14b-4f3d-4259-aa4c-f60f02354636" +} diff --git a/docs/api/examples/controller_post_projectsprojectidlinkslinkidstopcapture.txt b/docs/api/examples/controller_post_projectsprojectidlinkslinkidstopcapture.txt new file mode 100644 index 00000000..650fead4 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidlinkslinkidstopcapture.txt @@ -0,0 +1,23 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/ec55ad9d-ced7-4add-bb2f-3c940aca7c94/links/dee1b6ce-c548-4636-bbc3-5a98f0e05a47/stop_capture' -d '{}' + +POST /v2/projects/ec55ad9d-ced7-4add-bb2f-3c940aca7c94/links/dee1b6ce-c548-4636-bbc3-5a98f0e05a47/stop_capture HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 247 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:58 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/links/{link_id}/stop_capture + +{ + "capture_file_name": null, + "capture_file_path": null, + "capturing": false, + "link_id": "dee1b6ce-c548-4636-bbc3-5a98f0e05a47", + "link_type": "ethernet", + "nodes": [], + "project_id": "ec55ad9d-ced7-4add-bb2f-3c940aca7c94" +} diff --git a/docs/api/examples/controller_post_projectsprojectidnodes.txt b/docs/api/examples/controller_post_projectsprojectidnodes.txt new file mode 100644 index 00000000..81c5fffb --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodes.txt @@ -0,0 +1,65 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/9f93fd51-3c14-44aa-ba4c-14e5b18869c3/nodes' -d '{"compute_id": "example.com", "name": "test", "node_type": "vpcs", "properties": {"startup_script": "echo test"}}' + +POST /v2/projects/9f93fd51-3c14-44aa-ba4c-14e5b18869c3/nodes HTTP/1.1 +{ + "compute_id": "example.com", + "name": "test", + "node_type": "vpcs", + "properties": { + "startup_script": "echo test" + } +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 1123 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes + +{ + "command_line": null, + "compute_id": "example.com", + "console": 2048, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "6bf6a6b4-0684-4beb-9e59-c750eb7de03c", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "9f93fd51-3c14-44aa-ba4c-14e5b18869c3", + "properties": { + "startup_script": "echo test" + }, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/examples/controller_post_projectsprojectidnodesnodeidreload.txt b/docs/api/examples/controller_post_projectsprojectidnodesnodeidreload.txt new file mode 100644 index 00000000..ece8ce4a --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesnodeidreload.txt @@ -0,0 +1,56 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/9308ed57-be12-456a-b03e-8cd5540ddd57/nodes/106ec4fa-bda5-4de7-9047-c8343699c9df/reload' -d '{}' + +POST /v2/projects/9308ed57-be12-456a-b03e-8cd5540ddd57/nodes/106ec4fa-bda5-4de7-9047-c8343699c9df/reload HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 1080 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id}/reload + +{ + "command_line": null, + "compute_id": "example.com", + "console": null, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "106ec4fa-bda5-4de7-9047-c8343699c9df", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "9308ed57-be12-456a-b03e-8cd5540ddd57", + "properties": {}, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/examples/controller_post_projectsprojectidnodesnodeidstart.txt b/docs/api/examples/controller_post_projectsprojectidnodesnodeidstart.txt new file mode 100644 index 00000000..f4b010ba --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesnodeidstart.txt @@ -0,0 +1,56 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/f1fdf311-f82e-45eb-a9c3-af5502e3d8ff/nodes/051900ed-fcca-4a60-a880-c3fd0fb8bada/start' -d '{}' + +POST /v2/projects/f1fdf311-f82e-45eb-a9c3-af5502e3d8ff/nodes/051900ed-fcca-4a60-a880-c3fd0fb8bada/start HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 1080 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id}/start + +{ + "command_line": null, + "compute_id": "example.com", + "console": null, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "051900ed-fcca-4a60-a880-c3fd0fb8bada", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "f1fdf311-f82e-45eb-a9c3-af5502e3d8ff", + "properties": {}, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/examples/controller_post_projectsprojectidnodesnodeidstop.txt b/docs/api/examples/controller_post_projectsprojectidnodesnodeidstop.txt new file mode 100644 index 00000000..4e46e18d --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesnodeidstop.txt @@ -0,0 +1,56 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/be72d628-c67d-47ff-bcd2-ace813efcfce/nodes/cb7b936c-ad81-46e8-9dd4-28bd8e9f53ef/stop' -d '{}' + +POST /v2/projects/be72d628-c67d-47ff-bcd2-ace813efcfce/nodes/cb7b936c-ad81-46e8-9dd4-28bd8e9f53ef/stop HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 1080 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id}/stop + +{ + "command_line": null, + "compute_id": "example.com", + "console": null, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "cb7b936c-ad81-46e8-9dd4-28bd8e9f53ef", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "be72d628-c67d-47ff-bcd2-ace813efcfce", + "properties": {}, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/examples/controller_post_projectsprojectidnodesnodeidsuspend.txt b/docs/api/examples/controller_post_projectsprojectidnodesnodeidsuspend.txt new file mode 100644 index 00000000..fa17f8d8 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesnodeidsuspend.txt @@ -0,0 +1,56 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/072f522f-9b04-4137-9e70-66c04b1c7d5c/nodes/8a9ab8d0-3491-4823-a165-0e4229eef451/suspend' -d '{}' + +POST /v2/projects/072f522f-9b04-4137-9e70-66c04b1c7d5c/nodes/8a9ab8d0-3491-4823-a165-0e4229eef451/suspend HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 1080 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id}/suspend + +{ + "command_line": null, + "compute_id": "example.com", + "console": null, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "8a9ab8d0-3491-4823-a165-0e4229eef451", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "072f522f-9b04-4137-9e70-66c04b1c7d5c", + "properties": {}, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/examples/controller_post_projectsprojectidnodesreload.txt b/docs/api/examples/controller_post_projectsprojectidnodesreload.txt new file mode 100644 index 00000000..b569bf07 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesreload.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/815d273f-becd-43f1-919f-25d1f18fa016/nodes/reload' -d '{}' + +POST /v2/projects/815d273f-becd-43f1-919f-25d1f18fa016/nodes/reload HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:32:00 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/reload + diff --git a/docs/api/examples/controller_post_projectsprojectidnodesstart.txt b/docs/api/examples/controller_post_projectsprojectidnodesstart.txt new file mode 100644 index 00000000..7cc4f628 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesstart.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/2a2af1f9-c4c6-4c5a-8e4b-f7dae87aa23a/nodes/start' -d '{}' + +POST /v2/projects/2a2af1f9-c4c6-4c5a-8e4b-f7dae87aa23a/nodes/start HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/start + diff --git a/docs/api/examples/controller_post_projectsprojectidnodesstop.txt b/docs/api/examples/controller_post_projectsprojectidnodesstop.txt new file mode 100644 index 00000000..fc5b4b58 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodesstop.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/64f23d4a-961e-415b-bf20-4920518c0fb9/nodes/stop' -d '{}' + +POST /v2/projects/64f23d4a-961e-415b-bf20-4920518c0fb9/nodes/stop HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/stop + diff --git a/docs/api/examples/controller_post_projectsprojectidnodessuspend.txt b/docs/api/examples/controller_post_projectsprojectidnodessuspend.txt new file mode 100644 index 00000000..46436634 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidnodessuspend.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/6e4d2757-cd4c-4026-9dcb-58a032ee0ba9/nodes/suspend' -d '{}' + +POST /v2/projects/6e4d2757-cd4c-4026-9dcb-58a032ee0ba9/nodes/suspend HTTP/1.1 +{} + + +HTTP/1.1 204 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/suspend + diff --git a/docs/api/examples/controller_post_projectsprojectidopen.txt b/docs/api/examples/controller_post_projectsprojectidopen.txt new file mode 100644 index 00000000..1d9cb700 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidopen.txt @@ -0,0 +1,26 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/17cf04b6-bd2f-4c10-b2de-9de04f2c1169/open' -d '{}' + +POST /v2/projects/17cf04b6-bd2f-4c10-b2de-9de04f2c1169/open HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 379 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:02 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/open + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpymtoa9p4/projects/17cf04b6-bd2f-4c10-b2de-9de04f2c1169", + "project_id": "17cf04b6-bd2f-4c10-b2de-9de04f2c1169", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_post_projectsprojectidsnapshots.txt b/docs/api/examples/controller_post_projectsprojectidsnapshots.txt new file mode 100644 index 00000000..8fb6a693 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidsnapshots.txt @@ -0,0 +1,22 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/ca0187d8-c183-49b1-a714-b7160264172b/snapshots' -d '{"name": "snap1"}' + +POST /v2/projects/ca0187d8-c183-49b1-a714-b7160264172b/snapshots HTTP/1.1 +{ + "name": "snap1" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 170 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:04 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/snapshots + +{ + "created_at": 1490088724, + "name": "snap1", + "project_id": "ca0187d8-c183-49b1-a714-b7160264172b", + "snapshot_id": "b5fed8f7-3482-435c-9df0-d25b9afa9cec" +} diff --git a/docs/api/examples/controller_post_projectsprojectidsnapshotssnapshotidrestore.txt b/docs/api/examples/controller_post_projectsprojectidsnapshotssnapshotidrestore.txt new file mode 100644 index 00000000..6c9e2ceb --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidsnapshotssnapshotidrestore.txt @@ -0,0 +1,26 @@ +curl -i -X POST 'http://localhost:3080/v2/projects/ecb64cf5-aec7-469a-a367-3d16f4377cd7/snapshots/7e0bb824-e0aa-4ff1-b4f8-8453e99cb1bd/restore' -d '{}' + +POST /v2/projects/ecb64cf5-aec7-469a-a367-3d16f4377cd7/snapshots/7e0bb824-e0aa-4ff1-b4f8-8453e99cb1bd/restore HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 379 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:04 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/snapshots/{snapshot_id}/restore + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp3anabqsm/projects/ecb64cf5-aec7-469a-a367-3d16f4377cd7", + "project_id": "ecb64cf5-aec7-469a-a367-3d16f4377cd7", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_post_settings.txt b/docs/api/examples/controller_post_settings.txt new file mode 100644 index 00000000..27eb451a --- /dev/null +++ b/docs/api/examples/controller_post_settings.txt @@ -0,0 +1,19 @@ +curl -i -X POST 'http://localhost:3080/v2/settings' -d '{"test": true}' + +POST /v2/settings HTTP/1.1 +{ + "test": true +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 20 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:04 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/settings + +{ + "test": true +} diff --git a/docs/api/examples/controller_post_shutdown.txt b/docs/api/examples/controller_post_shutdown.txt new file mode 100644 index 00000000..b9ac8f24 --- /dev/null +++ b/docs/api/examples/controller_post_shutdown.txt @@ -0,0 +1,14 @@ +curl -i -X POST 'http://localhost:3080/v2/shutdown' -d '{}' + +POST /v2/shutdown HTTP/1.1 +{} + + +HTTP/1.1 201 +Connection: close +Content-Length: 0 +Content-Type: application/octet-stream +Date: Tue, 21 Mar 2017 09:32:03 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/shutdown + diff --git a/docs/api/examples/controller_post_version.txt b/docs/api/examples/controller_post_version.txt new file mode 100644 index 00000000..73517351 --- /dev/null +++ b/docs/api/examples/controller_post_version.txt @@ -0,0 +1,19 @@ +curl -i -X POST 'http://localhost:3080/v2/version' -d '{"version": "2.0.0dev11"}' + +POST /v2/version HTTP/1.1 +{ + "version": "2.0.0dev11" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 31 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:05 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/version + +{ + "version": "2.0.0dev11" +} diff --git a/docs/api/examples/controller_put_computescomputeid.txt b/docs/api/examples/controller_put_computescomputeid.txt new file mode 100644 index 00000000..5f1d33cf --- /dev/null +++ b/docs/api/examples/controller_put_computescomputeid.txt @@ -0,0 +1,36 @@ +curl -i -X PUT 'http://localhost:3080/v2/computes/my_compute_id' -d '{"compute_id": "my_compute_id", "host": "localhost", "password": "secure", "port": 84, "protocol": "https", "user": "julien"}' + +PUT /v2/computes/my_compute_id HTTP/1.1 +{ + "compute_id": "my_compute_id", + "host": "localhost", + "password": "secure", + "port": 84, + "protocol": "https", + "user": "julien" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 335 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:55 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/computes/{compute_id} + +{ + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute_id", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "http://julien@localhost:84", + "port": 84, + "protocol": "https", + "user": "julien" +} diff --git a/docs/api/examples/controller_put_gns3vm.txt b/docs/api/examples/controller_put_gns3vm.txt new file mode 100644 index 00000000..1fd398ce --- /dev/null +++ b/docs/api/examples/controller_put_gns3vm.txt @@ -0,0 +1,19 @@ +curl -i -X PUT 'http://localhost:3080/v2/gns3vm' -d '{"vmname": "TEST VM"}' + +PUT /v2/gns3vm HTTP/1.1 +{ + "vmname": "TEST VM" +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 27 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:57 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/gns3vm + +{ + "vmname": "TEST VM" +} diff --git a/docs/api/examples/controller_put_projectsprojectid.txt b/docs/api/examples/controller_put_projectsprojectid.txt new file mode 100644 index 00000000..f97fd733 --- /dev/null +++ b/docs/api/examples/controller_put_projectsprojectid.txt @@ -0,0 +1,28 @@ +curl -i -X PUT 'http://localhost:3080/v2/projects/10010203-0405-0607-0809-0a0b0c0d0e0f' -d '{"name": "test2"}' + +PUT /v2/projects/10010203-0405-0607-0809-0a0b0c0d0e0f HTTP/1.1 +{ + "name": "test2" +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 380 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:32:01 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id} + +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test2", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpe4g8gdv7/projects/10010203-0405-0607-0809-0a0b0c0d0e0f", + "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} diff --git a/docs/api/examples/controller_put_projectsprojectiddrawingsdrawingid.txt b/docs/api/examples/controller_put_projectsprojectiddrawingsdrawingid.txt new file mode 100644 index 00000000..d316b7b3 --- /dev/null +++ b/docs/api/examples/controller_put_projectsprojectiddrawingsdrawingid.txt @@ -0,0 +1,25 @@ +curl -i -X PUT 'http://localhost:3080/v2/projects/8f53f0f7-9967-4a01-884f-36ea1800e5ef/drawings/d86ab88f-28bf-4f22-aa4e-e6d3c423b98c' -d '{"x": 42}' + +PUT /v2/projects/8f53f0f7-9967-4a01-884f-36ea1800e5ef/drawings/d86ab88f-28bf-4f22-aa4e-e6d3c423b98c HTTP/1.1 +{ + "x": 42 +} + + +HTTP/1.1 201 +Connection: close +Content-Length: 323 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:56 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/drawings/{drawing_id} + +{ + "drawing_id": "d86ab88f-28bf-4f22-aa4e-e6d3c423b98c", + "project_id": "8f53f0f7-9967-4a01-884f-36ea1800e5ef", + "rotation": 0, + "svg": "", + "x": 42, + "y": 20, + "z": 0 +} diff --git a/docs/api/examples/controller_put_projectsprojectidnodesnodeid.txt b/docs/api/examples/controller_put_projectsprojectidnodesnodeid.txt new file mode 100644 index 00000000..0ee03603 --- /dev/null +++ b/docs/api/examples/controller_put_projectsprojectidnodesnodeid.txt @@ -0,0 +1,63 @@ +curl -i -X PUT 'http://localhost:3080/v2/projects/2071abcf-98b8-42b8-a6e7-6e0e5571e223/nodes/86b1aa27-5c82-4596-8246-3f7384f853a1' -d '{"compute_id": "example.com", "name": "test", "node_type": "vpcs", "properties": {"startup_script": "echo test"}}' + +PUT /v2/projects/2071abcf-98b8-42b8-a6e7-6e0e5571e223/nodes/86b1aa27-5c82-4596-8246-3f7384f853a1 HTTP/1.1 +{ + "compute_id": "example.com", + "name": "test", + "node_type": "vpcs", + "properties": { + "startup_script": "echo test" + } +} + + +HTTP/1.1 200 +Connection: close +Content-Length: 1080 +Content-Type: application/json +Date: Tue, 21 Mar 2017 09:31:59 GMT +Server: Python/3.6 GNS3/2.0.0dev11 +X-Route: /v2/projects/{project_id}/nodes/{node_id} + +{ + "command_line": null, + "compute_id": "example.com", + "console": 2048, + "console_host": "", + "console_type": null, + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-size: 10;font-familly: Verdana", + "text": "test", + "x": null, + "y": -40 + }, + "name": "test", + "node_directory": null, + "node_id": "86b1aa27-5c82-4596-8246-3f7384f853a1", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "2071abcf-98b8-42b8-a6e7-6e0e5571e223", + "properties": {}, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": 0, + "y": 0, + "z": 0 +} diff --git a/docs/api/notifications/compute.created.json b/docs/api/notifications/compute.created.json new file mode 100644 index 00000000..48759ae3 --- /dev/null +++ b/docs/api/notifications/compute.created.json @@ -0,0 +1,15 @@ +{ + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "http://julien@localhost:84", + "port": 84, + "protocol": "http", + "user": "julien" +} \ No newline at end of file diff --git a/docs/api/notifications/compute.deleted.json b/docs/api/notifications/compute.deleted.json new file mode 100644 index 00000000..2c489ad4 --- /dev/null +++ b/docs/api/notifications/compute.deleted.json @@ -0,0 +1,15 @@ +{ + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute_id", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "http://julien@localhost:84", + "port": 84, + "protocol": "http", + "user": "julien" +} \ No newline at end of file diff --git a/docs/api/notifications/compute.updated.json b/docs/api/notifications/compute.updated.json new file mode 100644 index 00000000..75d786f7 --- /dev/null +++ b/docs/api/notifications/compute.updated.json @@ -0,0 +1,15 @@ +{ + "capabilities": { + "node_types": [], + "version": null + }, + "compute_id": "my_compute_id", + "connected": false, + "cpu_usage_percent": null, + "host": "localhost", + "memory_usage_percent": null, + "name": "http://julien@localhost:84", + "port": 84, + "protocol": "https", + "user": "julien" +} \ No newline at end of file diff --git a/docs/api/notifications/drawing.created.json b/docs/api/notifications/drawing.created.json new file mode 100644 index 00000000..aae49b31 --- /dev/null +++ b/docs/api/notifications/drawing.created.json @@ -0,0 +1,9 @@ +{ + "drawing_id": "377bccc0-779a-44b0-ab5e-98dfd6dc46cd", + "project_id": "adb641a0-8ec9-4b5a-b8df-cc993638c601", + "rotation": 0, + "svg": "", + "x": 10, + "y": 20, + "z": 0 +} \ No newline at end of file diff --git a/docs/api/notifications/drawing.deleted.json b/docs/api/notifications/drawing.deleted.json new file mode 100644 index 00000000..3d9bb8a5 --- /dev/null +++ b/docs/api/notifications/drawing.deleted.json @@ -0,0 +1,9 @@ +{ + "drawing_id": "b2f8b12f-a4cc-4621-affc-cf3dcd4ba513", + "project_id": "24ef7002-5dd6-4054-bf8a-d2aface0885e", + "rotation": 0, + "svg": "", + "x": 0, + "y": 0, + "z": 0 +} \ No newline at end of file diff --git a/docs/api/notifications/drawing.updated.json b/docs/api/notifications/drawing.updated.json new file mode 100644 index 00000000..9e645a8c --- /dev/null +++ b/docs/api/notifications/drawing.updated.json @@ -0,0 +1,8 @@ +{ + "drawing_id": "d86ab88f-28bf-4f22-aa4e-e6d3c423b98c", + "project_id": "8f53f0f7-9967-4a01-884f-36ea1800e5ef", + "rotation": 0, + "x": 42, + "y": 20, + "z": 0 +} \ No newline at end of file diff --git a/docs/api/notifications/ignore.json b/docs/api/notifications/ignore.json new file mode 100644 index 00000000..9bf8f5c3 --- /dev/null +++ b/docs/api/notifications/ignore.json @@ -0,0 +1,3 @@ +{ + "project_id": 42 +} \ No newline at end of file diff --git a/docs/api/notifications/link.created.json b/docs/api/notifications/link.created.json new file mode 100644 index 00000000..904f713b --- /dev/null +++ b/docs/api/notifications/link.created.json @@ -0,0 +1,34 @@ +{ + "capture_file_name": null, + "capture_file_path": null, + "capturing": false, + "link_id": "9b74fb50-652a-47de-aa7a-f936fad2623a", + "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": "009935d3-bb71-48ee-8f8c-4160ecf36a1f", + "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": "efd15e6d-cc6d-4b85-8e11-0389806f7231", + "port_number": 4 + } + ], + "project_id": "19def516-231c-4a43-8fdb-1d49333c1f8e" +} \ No newline at end of file diff --git a/docs/api/notifications/link.deleted.json b/docs/api/notifications/link.deleted.json new file mode 100644 index 00000000..41fc2297 --- /dev/null +++ b/docs/api/notifications/link.deleted.json @@ -0,0 +1,9 @@ +{ + "capture_file_name": null, + "capture_file_path": null, + "capturing": false, + "link_id": "105966d0-8a04-4cf5-95a4-ff13f1de7660", + "link_type": "ethernet", + "nodes": [], + "project_id": "42a1b682-b5bf-4de4-b5af-5366fc20a111" +} \ No newline at end of file diff --git a/docs/api/notifications/link.updated.json b/docs/api/notifications/link.updated.json new file mode 100644 index 00000000..e0a0ff7a --- /dev/null +++ b/docs/api/notifications/link.updated.json @@ -0,0 +1,32 @@ +{ + "capture_file_name": null, + "capture_file_path": null, + "capturing": false, + "link_id": "fab9fae2-1ca7-48a5-a3bf-e6cdebf7d89f", + "link_type": "ethernet", + "nodes": [ + { + "adapter_number": 0, + "label": { + "text": "Hello", + "x": 64, + "y": 0 + }, + "node_id": "d978c6d1-4503-46ce-a11c-432b7dace22c", + "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": "d1779d19-320a-471b-9d50-91dd3d3f3ecd", + "port_number": 4 + } + ], + "project_id": "e49cdc9f-ce2d-48b4-a317-7107f4c2c520" +} \ No newline at end of file diff --git a/docs/api/notifications/log.error.json b/docs/api/notifications/log.error.json new file mode 100644 index 00000000..aaf314d7 --- /dev/null +++ b/docs/api/notifications/log.error.json @@ -0,0 +1,3 @@ +{ + "message": "Permission denied on /tmp" +} \ No newline at end of file diff --git a/docs/api/notifications/log.info.json b/docs/api/notifications/log.info.json new file mode 100644 index 00000000..f77299a5 --- /dev/null +++ b/docs/api/notifications/log.info.json @@ -0,0 +1,3 @@ +{ + "message": "Image uploaded" +} \ No newline at end of file diff --git a/docs/api/notifications/log.warning.json b/docs/api/notifications/log.warning.json new file mode 100644 index 00000000..5d630354 --- /dev/null +++ b/docs/api/notifications/log.warning.json @@ -0,0 +1,3 @@ +{ + "message": "Warning ASA 8 is not officialy supported by GNS3" +} \ No newline at end of file diff --git a/docs/api/notifications/node.created.json b/docs/api/notifications/node.created.json new file mode 100644 index 00000000..e24038fa --- /dev/null +++ b/docs/api/notifications/node.created.json @@ -0,0 +1,3 @@ +{ + "a": "b" +} \ No newline at end of file diff --git a/docs/api/notifications/node.updated.json b/docs/api/notifications/node.updated.json new file mode 100644 index 00000000..2c043193 --- /dev/null +++ b/docs/api/notifications/node.updated.json @@ -0,0 +1,45 @@ +{ + "command_line": "", + "compute_id": "local", + "console": 5006, + "console_host": "localhost", + "console_type": "telnet", + "first_port_name": null, + "height": 59, + "label": { + "rotation": 0, + "style": "font-family: TypeWriter;font-size: 10;font-weight: bold;fill: #000000;fill-opacity: 1.0;", + "text": "PC2", + "x": 18, + "y": -25 + }, + "name": "PC2", + "node_directory": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-of-noplay/pytest-51/test_open0/project-files/vpcs/748bcd89-624a-40eb-a8d3-1d2e85c99b51", + "node_id": "748bcd89-624a-40eb-a8d3-1d2e85c99b51", + "node_type": "vpcs", + "port_name_format": "Ethernet{0}", + "port_segment_size": 0, + "ports": [ + { + "adapter_number": 0, + "data_link_types": { + "Ethernet": "DLT_EN10MB" + }, + "link_type": "ethernet", + "name": "Ethernet0", + "port_number": 0, + "short_name": "e0" + } + ], + "project_id": "3c1be6f9-b4ba-4737-b209-63c47c23359f", + "properties": { + "startup_script": "", + "startup_script_path": "startup.vpc" + }, + "status": "stopped", + "symbol": ":/symbols/computer.svg", + "width": 65, + "x": -71, + "y": -98, + "z": 1 +} \ No newline at end of file diff --git a/docs/api/notifications/ping.json b/docs/api/notifications/ping.json new file mode 100644 index 00000000..4df2d436 --- /dev/null +++ b/docs/api/notifications/ping.json @@ -0,0 +1,3 @@ +{ + "compute_id": 12 +} \ No newline at end of file diff --git a/docs/api/notifications/project.closed.json b/docs/api/notifications/project.closed.json new file mode 100644 index 00000000..72618444 --- /dev/null +++ b/docs/api/notifications/project.closed.json @@ -0,0 +1,12 @@ +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp0vixjsro/projects/74bd9388-bd2e-41cc-b8da-d014cfb9f908", + "project_id": "74bd9388-bd2e-41cc-b8da-d014cfb9f908", + "scene_height": 1000, + "scene_width": 2000, + "status": "closed" +} \ No newline at end of file diff --git a/docs/api/notifications/project.updated.json b/docs/api/notifications/project.updated.json new file mode 100644 index 00000000..7d3091b0 --- /dev/null +++ b/docs/api/notifications/project.updated.json @@ -0,0 +1,12 @@ +{ + "auto_close": true, + "auto_open": false, + "auto_start": false, + "filename": "test.gns3", + "name": "test2", + "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpe4g8gdv7/projects/10010203-0405-0607-0809-0a0b0c0d0e0f", + "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f", + "scene_height": 1000, + "scene_width": 2000, + "status": "opened" +} \ No newline at end of file diff --git a/docs/api/notifications/settings.updated.json b/docs/api/notifications/settings.updated.json new file mode 100644 index 00000000..69fbf10a --- /dev/null +++ b/docs/api/notifications/settings.updated.json @@ -0,0 +1,3 @@ +{ + "test": true +} \ No newline at end of file diff --git a/docs/api/notifications/snapshot.restored.json b/docs/api/notifications/snapshot.restored.json new file mode 100644 index 00000000..9dd96166 --- /dev/null +++ b/docs/api/notifications/snapshot.restored.json @@ -0,0 +1,6 @@ +{ + "created_at": 1490088724, + "name": "test", + "project_id": "ecb64cf5-aec7-469a-a367-3d16f4377cd7", + "snapshot_id": "7e0bb824-e0aa-4ff1-b4f8-8453e99cb1bd" +} \ No newline at end of file diff --git a/docs/api/notifications/test.json b/docs/api/notifications/test.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/docs/api/notifications/test.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/docs/api/v2/compute/capabilities/capabilities.rst b/docs/api/v2/compute/capabilities/capabilities.rst index d0685663..7c6f7fcc 100644 --- a/docs/api/v2/compute/capabilities/capabilities.rst +++ b/docs/api/v2/compute/capabilities/capabilities.rst @@ -22,3 +22,9 @@ Output version ✔ ['string', 'null'] Version number +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_capabilities.txt + diff --git a/docs/api/v2/compute/cloud/projectsprojectidcloudnodes.rst b/docs/api/v2/compute/cloud/projectsprojectidcloudnodes.rst index c9a5338e..abf7208e 100644 --- a/docs/api/v2/compute/cloud/projectsprojectidcloudnodes.rst +++ b/docs/api/v2/compute/cloud/projectsprojectidcloudnodes.rst @@ -61,3 +61,9 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidcloudnodes.txt + diff --git a/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeid.rst b/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeid.rst index ec97be6e..35577308 100644 --- a/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeid.rst +++ b/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeid.rst @@ -33,6 +33,12 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectidcloudnodesnodeid.txt + PUT /v2/compute/projects/**{project_id}**/cloud/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -97,6 +103,12 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectidcloudnodesnodeid.txt + DELETE /v2/compute/projects/**{project_id}**/cloud/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -113,3 +125,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidcloudnodesnodeid.txt + diff --git a/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.rst index 693ea808..a1f38f2b 100644 --- a/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/cloud/projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/cloud/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidcloudnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeid.rst b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeid.rst index 4de9efa8..14d6f50a 100644 --- a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeid.rst +++ b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeid.rst @@ -83,3 +83,9 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectiddockernodesnodeid.txt + diff --git a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.rst index 9728e7c2..58c2ce73 100644 --- a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/docker/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst index b224ea50..12b041d4 100644 --- a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst +++ b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst @@ -31,3 +31,9 @@ Input data_link_type enum Possible values: DLT_ATM_RFC1483, DLT_EN10MB, DLT_FRELAY, DLT_C_HDLC, DLT_PPP_SERIAL +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt + diff --git a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst index 4cc91dd6..e227f8a0 100644 --- a/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst +++ b/docs/api/v2/compute/docker/projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst @@ -21,3 +21,9 @@ Response status codes - **404**: Instance doesn't exist - **409**: Container not started +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt + diff --git a/docs/api/v2/compute/iou/iouimages.rst b/docs/api/v2/compute/iou/iouimages.rst index f2b0d7ab..95456098 100644 --- a/docs/api/v2/compute/iou/iouimages.rst +++ b/docs/api/v2/compute/iou/iouimages.rst @@ -11,3 +11,9 @@ Response status codes ********************** - **200**: List of IOU images +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_iouimages.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodes.rst b/docs/api/v2/compute/iou/projectsprojectidiounodes.rst index 6bfcc865..46e44b20 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodes.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodes.rst @@ -71,3 +71,9 @@ Output use_default_iou_values ['boolean', 'null'] Use default IOU values +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodes.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeid.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeid.rst index b7b93742..557883a2 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeid.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeid.rst @@ -47,6 +47,12 @@ Output use_default_iou_values ['boolean', 'null'] Use default IOU values +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectidiounodesnodeid.txt + PUT /v2/compute/projects/**{project_id}**/iou/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -122,6 +128,12 @@ Output use_default_iou_values ['boolean', 'null'] Use default IOU values +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectidiounodesnodeid.txt + DELETE /v2/compute/projects/**{project_id}**/iou/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -138,3 +150,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidiounodesnodeid.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.rst index 6f58909e..3036a9dd 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/iou/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst index 12670a6c..e957b80b 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.rst @@ -31,3 +31,9 @@ Input data_link_type enum Possible values: DLT_ATM_RFC1483, DLT_EN10MB, DLT_FRELAY, DLT_C_HDLC, DLT_PPP_SERIAL +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst index 2ea2fc51..6cd4afb9 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.rst @@ -21,3 +21,9 @@ Response status codes - **404**: Instance doesn't exist - **409**: VM not started +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidreload.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidreload.rst index 7f6d6262..19af3275 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidreload.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidreload.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodesnodeidreload.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstart.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstart.rst index c8eda9d1..3df8062a 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstart.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstart.rst @@ -56,3 +56,9 @@ Output use_default_iou_values ['boolean', 'null'] Use default IOU values +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodesnodeidstart.txt + diff --git a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstop.rst b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstop.rst index d9348673..7934e045 100644 --- a/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstop.rst +++ b/docs/api/v2/compute/iou/projectsprojectidiounodesnodeidstop.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidiounodesnodeidstop.txt + diff --git a/docs/api/v2/compute/nat/projectsprojectidnatnodes.rst b/docs/api/v2/compute/nat/projectsprojectidnatnodes.rst index 4d64ab54..1d6e2672 100644 --- a/docs/api/v2/compute/nat/projectsprojectidnatnodes.rst +++ b/docs/api/v2/compute/nat/projectsprojectidnatnodes.rst @@ -43,3 +43,9 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidnatnodes.txt + diff --git a/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeid.rst b/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeid.rst index fbaff64d..7507a612 100644 --- a/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeid.rst +++ b/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeid.rst @@ -31,6 +31,12 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectidnatnodesnodeid.txt + PUT /v2/compute/projects/**{project_id}**/nat/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -74,6 +80,12 @@ Output status enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectidnatnodesnodeid.txt + DELETE /v2/compute/projects/**{project_id}**/nat/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -90,3 +102,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidnatnodesnodeid.txt + diff --git a/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.rst index 4563f285..7dc12995 100644 --- a/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/nat/projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/nat/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidnatnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/network/networkinterfaces.rst b/docs/api/v2/compute/network/networkinterfaces.rst index 61d1ed3d..66f40f0d 100644 --- a/docs/api/v2/compute/network/networkinterfaces.rst +++ b/docs/api/v2/compute/network/networkinterfaces.rst @@ -11,3 +11,9 @@ Response status codes ********************** - **200**: OK +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_networkinterfaces.txt + diff --git a/docs/api/v2/compute/network/projectsprojectidportsudp.rst b/docs/api/v2/compute/network/projectsprojectidportsudp.rst index 0c6f0090..ca5f9b03 100644 --- a/docs/api/v2/compute/network/projectsprojectidportsudp.rst +++ b/docs/api/v2/compute/network/projectsprojectidportsudp.rst @@ -16,3 +16,9 @@ Response status codes - **201**: UDP port allocated - **404**: The project doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidportsudp.txt + diff --git a/docs/api/v2/compute/project/projects.rst b/docs/api/v2/compute/project/projects.rst index 36379831..1ead42be 100644 --- a/docs/api/v2/compute/project/projects.rst +++ b/docs/api/v2/compute/project/projects.rst @@ -11,6 +11,12 @@ Response status codes ********************** - **200**: Project list +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projects.txt + POST /v2/compute/projects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -54,3 +60,9 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projects.txt + diff --git a/docs/api/v2/compute/project/projectsprojectid.rst b/docs/api/v2/compute/project/projectsprojectid.rst index 606c1c78..373b19a2 100644 --- a/docs/api/v2/compute/project/projectsprojectid.rst +++ b/docs/api/v2/compute/project/projectsprojectid.rst @@ -34,6 +34,12 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectid.txt + DELETE /v2/compute/projects/**{project_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -48,3 +54,9 @@ Response status codes - **204**: Changes have been written on disk - **404**: The project doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectid.txt + diff --git a/docs/api/v2/compute/project/projectsprojectidclose.rst b/docs/api/v2/compute/project/projectsprojectidclose.rst index c651d88d..b507cae8 100644 --- a/docs/api/v2/compute/project/projectsprojectidclose.rst +++ b/docs/api/v2/compute/project/projectsprojectidclose.rst @@ -16,3 +16,9 @@ Response status codes - **204**: Project closed - **404**: The project doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidclose.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodes.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodes.rst index b6b1b2f2..6ab2e8f1 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodes.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodes.rst @@ -116,3 +116,9 @@ Output usage ✔ string How to use the QEMU VM +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodes.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeid.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeid.rst index bc82ed07..ced6f8d5 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeid.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeid.rst @@ -69,6 +69,12 @@ Output usage ✔ string How to use the QEMU VM +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectidqemunodesnodeid.txt + PUT /v2/compute/projects/**{project_id}**/qemu/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -184,6 +190,12 @@ Output usage ✔ string How to use the QEMU VM +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectidqemunodesnodeid.txt + DELETE /v2/compute/projects/**{project_id}**/qemu/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -200,3 +212,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidqemunodesnodeid.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.rst index c83d8fa3..8aaa9c02 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/qemu/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidqemunodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidreload.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidreload.rst index 8bee2ec1..f7346523 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidreload.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidreload.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodesnodeidreload.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidresume.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidresume.rst index 938c5ad0..f6c35a56 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidresume.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidresume.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodesnodeidresume.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstart.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstart.rst index 4b59d12c..82150273 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstart.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstart.rst @@ -69,3 +69,9 @@ Output usage ✔ string How to use the QEMU VM +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodesnodeidstart.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstop.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstop.rst index 90b6447e..405185e7 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstop.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstop.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodesnodeidstop.txt + diff --git a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidsuspend.rst b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidsuspend.rst index f41b998b..78af62ee 100644 --- a/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidsuspend.rst +++ b/docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidsuspend.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidqemunodesnodeidsuspend.txt + diff --git a/docs/api/v2/compute/qemu/qemubinaries.rst b/docs/api/v2/compute/qemu/qemubinaries.rst index 572aa802..f1a4173b 100644 --- a/docs/api/v2/compute/qemu/qemubinaries.rst +++ b/docs/api/v2/compute/qemu/qemubinaries.rst @@ -22,3 +22,9 @@ Input archs array Architectures to filter binaries with +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_qemubinaries.txt + diff --git a/docs/api/v2/compute/qemu/qemucapabilities.rst b/docs/api/v2/compute/qemu/qemucapabilities.rst index f1a5b841..eeb70e2f 100644 --- a/docs/api/v2/compute/qemu/qemucapabilities.rst +++ b/docs/api/v2/compute/qemu/qemucapabilities.rst @@ -20,3 +20,9 @@ Output kvm array Architectures that KVM is enabled for +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_qemucapabilities.txt + diff --git a/docs/api/v2/compute/qemu/qemuimg.rst b/docs/api/v2/compute/qemu/qemuimg.rst index efa21555..b64f4d8d 100644 --- a/docs/api/v2/compute/qemu/qemuimg.rst +++ b/docs/api/v2/compute/qemu/qemuimg.rst @@ -31,3 +31,9 @@ Input zeroed_grain enum Possible values: on, off +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_qemuimg.txt + diff --git a/docs/api/v2/compute/server/version.rst b/docs/api/v2/compute/server/version.rst index d58dc956..b4947701 100644 --- a/docs/api/v2/compute/server/version.rst +++ b/docs/api/v2/compute/server/version.rst @@ -21,3 +21,9 @@ Output version ✔ string Version number +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_version.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodes.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodes.rst index 710eed0c..04ce4503 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodes.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodes.rst @@ -60,3 +60,9 @@ Output vmname string VirtualBox VM name (in VirtualBox itself) +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodes.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeid.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeid.rst index 461089b6..5af6251e 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeid.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeid.rst @@ -41,6 +41,12 @@ Output vmname string VirtualBox VM name (in VirtualBox itself) +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectidvirtualboxnodesnodeid.txt + PUT /v2/compute/projects/**{project_id}**/virtualbox/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -104,6 +110,12 @@ Output vmname string VirtualBox VM name (in VirtualBox itself) +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectidvirtualboxnodesnodeid.txt + DELETE /v2/compute/projects/**{project_id}**/virtualbox/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.rst index 2bfdd646..98db45ad 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/virtualbox/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidvirtualboxnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidreload.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidreload.rst index 58a62435..87344ad3 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidreload.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidreload.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodesnodeidreload.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidresume.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidresume.rst index 2e4f8523..72a76026 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidresume.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidresume.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodesnodeidresume.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstart.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstart.rst index 506d8663..1efeb459 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstart.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstart.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodesnodeidstart.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstop.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstop.rst index 6050655a..6b747d82 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstop.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidstop.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodesnodeidstop.txt + diff --git a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidsuspend.rst b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidsuspend.rst index dc24b777..7fba3344 100644 --- a/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidsuspend.rst +++ b/docs/api/v2/compute/virtualbox/projectsprojectidvirtualboxnodesnodeidsuspend.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxnodesnodeidsuspend.txt + diff --git a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodes.rst b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodes.rst index d0fb80de..3afe7156 100644 --- a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodes.rst +++ b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodes.rst @@ -49,3 +49,9 @@ Output status ✔ enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvpcsnodes.txt + diff --git a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeid.rst b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeid.rst index 330e3490..edfa0920 100644 --- a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeid.rst +++ b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeid.rst @@ -36,6 +36,12 @@ Output status ✔ enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_get_projectsprojectidvpcsnodesnodeid.txt + PUT /v2/compute/projects/**{project_id}**/vpcs/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -84,6 +90,12 @@ Output status ✔ enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_put_projectsprojectidvpcsnodesnodeid.txt + DELETE /v2/compute/projects/**{project_id}**/vpcs/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -100,3 +112,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidvpcsnodesnodeid.txt + diff --git a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.rst b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.rst index 62e23572..89141be5 100644 --- a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.rst +++ b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.rst @@ -20,6 +20,12 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + DELETE /v2/compute/projects/**{project_id}**/vpcs/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,3 +44,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_delete_projectsprojectidvpcsnodesnodeidadaptersadapternumberdportsportnumberdnio.txt + diff --git a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidreload.rst b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidreload.rst index 0f721c01..b8f95b67 100644 --- a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidreload.rst +++ b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidreload.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvpcsnodesnodeidreload.txt + diff --git a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstart.rst b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstart.rst index 7a579b26..50a42ea1 100644 --- a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstart.rst +++ b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstart.rst @@ -36,3 +36,9 @@ Output status ✔ enum Possible values: started, stopped, suspended +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvpcsnodesnodeidstart.txt + diff --git a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstop.rst b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstop.rst index 1f1fff3c..3c1b34ae 100644 --- a/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstop.rst +++ b/docs/api/v2/compute/vpcs/projectsprojectidvpcsnodesnodeidstop.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/compute_post_projectsprojectidvpcsnodesnodeidstop.txt + diff --git a/docs/api/v2/controller/drawing/projectsprojectiddrawings.rst b/docs/api/v2/controller/drawing/projectsprojectiddrawings.rst index 972354dc..6886511c 100644 --- a/docs/api/v2/controller/drawing/projectsprojectiddrawings.rst +++ b/docs/api/v2/controller/drawing/projectsprojectiddrawings.rst @@ -15,6 +15,12 @@ Response status codes ********************** - **200**: List of drawings returned +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectiddrawings.txt + POST /v2/projects/**{project_id}**/drawings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -59,3 +65,9 @@ Output z integer Z property +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectiddrawings.txt + diff --git a/docs/api/v2/controller/drawing/projectsprojectiddrawingsdrawingid.rst b/docs/api/v2/controller/drawing/projectsprojectiddrawingsdrawingid.rst index 6f16c063..3ff0b4a5 100644 --- a/docs/api/v2/controller/drawing/projectsprojectiddrawingsdrawingid.rst +++ b/docs/api/v2/controller/drawing/projectsprojectiddrawingsdrawingid.rst @@ -47,6 +47,12 @@ Output z integer Z property +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_put_projectsprojectiddrawingsdrawingid.txt + DELETE /v2/projects/**{project_id}**/drawings/**{drawing_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -62,3 +68,9 @@ Response status codes - **204**: Drawing deleted - **400**: Invalid request +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_delete_projectsprojectiddrawingsdrawingid.txt + diff --git a/docs/api/v2/controller/gns3_vm/gns3vm.rst b/docs/api/v2/controller/gns3_vm/gns3vm.rst index e6acb4e4..423ff461 100644 --- a/docs/api/v2/controller/gns3_vm/gns3vm.rst +++ b/docs/api/v2/controller/gns3_vm/gns3vm.rst @@ -11,6 +11,12 @@ Response status codes ********************** - **200**: GNS3 VM settings returned +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_gns3vm.txt + PUT /v2/gns3vm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -20,3 +26,9 @@ Response status codes ********************** - **201**: GNS3 VM updated +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_put_gns3vm.txt + diff --git a/docs/api/v2/controller/gns3_vm/gns3vmengines.rst b/docs/api/v2/controller/gns3_vm/gns3vmengines.rst index 6ee79e12..1c9f5c29 100644 --- a/docs/api/v2/controller/gns3_vm/gns3vmengines.rst +++ b/docs/api/v2/controller/gns3_vm/gns3vmengines.rst @@ -11,3 +11,9 @@ Response status codes ********************** - **200**: OK +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_gns3vmengines.txt + diff --git a/docs/api/v2/controller/gns3_vm/gns3vmenginesenginevms.rst b/docs/api/v2/controller/gns3_vm/gns3vmenginesenginevms.rst index b6158597..4b5cc690 100644 --- a/docs/api/v2/controller/gns3_vm/gns3vmenginesenginevms.rst +++ b/docs/api/v2/controller/gns3_vm/gns3vmenginesenginevms.rst @@ -16,3 +16,9 @@ Response status codes - **200**: Success - **400**: Invalid request +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_gns3vmenginesenginevms.txt + diff --git a/docs/api/v2/controller/link/projectsprojectidlinks.rst b/docs/api/v2/controller/link/projectsprojectidlinks.rst index 1c8c739e..1916606f 100644 --- a/docs/api/v2/controller/link/projectsprojectidlinks.rst +++ b/docs/api/v2/controller/link/projectsprojectidlinks.rst @@ -15,6 +15,12 @@ Response status codes ********************** - **200**: List of links returned +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectidlinks.txt + POST /v2/projects/**{project_id}**/links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -59,3 +65,9 @@ Output project_id string Project UUID +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidlinks.txt + diff --git a/docs/api/v2/controller/link/projectsprojectidlinkslinkid.rst b/docs/api/v2/controller/link/projectsprojectidlinkslinkid.rst index 65716bea..834a34b0 100644 --- a/docs/api/v2/controller/link/projectsprojectidlinkslinkid.rst +++ b/docs/api/v2/controller/link/projectsprojectidlinkslinkid.rst @@ -62,3 +62,9 @@ Response status codes - **204**: Link deleted - **400**: Invalid request +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_delete_projectsprojectidlinkslinkid.txt + diff --git a/docs/api/v2/controller/link/projectsprojectidlinkslinkidstartcapture.rst b/docs/api/v2/controller/link/projectsprojectidlinkslinkidstartcapture.rst index 37a0e4f5..888ef4b2 100644 --- a/docs/api/v2/controller/link/projectsprojectidlinkslinkidstartcapture.rst +++ b/docs/api/v2/controller/link/projectsprojectidlinkslinkidstartcapture.rst @@ -42,3 +42,9 @@ Output project_id string Project UUID +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidlinkslinkidstartcapture.txt + diff --git a/docs/api/v2/controller/link/projectsprojectidlinkslinkidstopcapture.rst b/docs/api/v2/controller/link/projectsprojectidlinkslinkidstopcapture.rst index ec1f0ccd..51ec1be7 100644 --- a/docs/api/v2/controller/link/projectsprojectidlinkslinkidstopcapture.rst +++ b/docs/api/v2/controller/link/projectsprojectidlinkslinkidstopcapture.rst @@ -17,3 +17,9 @@ Response status codes - **201**: Capture stopped - **400**: Invalid request +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidlinkslinkidstopcapture.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodes.rst b/docs/api/v2/controller/node/projectsprojectidnodes.rst index d2177317..58bc8ea3 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodes.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodes.rst @@ -78,6 +78,12 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodes.txt + GET /v2/projects/**{project_id}**/nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -91,3 +97,9 @@ Response status codes ********************** - **200**: List of nodes returned +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectidnodes.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeid.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeid.rst index 3258a098..08c66a42 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeid.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeid.rst @@ -44,6 +44,12 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectidnodesnodeid.txt + PUT /v2/projects/**{project_id}**/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -117,6 +123,12 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_put_projectsprojectidnodesnodeid.txt + DELETE /v2/projects/**{project_id}**/nodes/**{node_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -133,3 +145,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_delete_projectsprojectidnodesnodeid.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsautoidlepc.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsautoidlepc.rst index 83e3b94c..28d3bbfa 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsautoidlepc.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsautoidlepc.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectidnodesnodeiddynamipsautoidlepc.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsidlepcproposals.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsidlepcproposals.rst index 8affe5a1..bc42aeca 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsidlepcproposals.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeiddynamipsidlepcproposals.rst @@ -18,3 +18,9 @@ Response status codes - **400**: Invalid request - **404**: Instance doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectidnodesnodeiddynamipsidlepcproposals.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeidreload.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeidreload.rst index 994a8c2d..299cffd1 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeidreload.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeidreload.rst @@ -49,3 +49,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesnodeidreload.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeidstart.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeidstart.rst index afdf56e8..a05b8d1b 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeidstart.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeidstart.rst @@ -49,3 +49,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesnodeidstart.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeidstop.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeidstop.rst index 7eba9826..32b19365 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeidstop.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeidstop.rst @@ -49,3 +49,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesnodeidstop.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesnodeidsuspend.rst b/docs/api/v2/controller/node/projectsprojectidnodesnodeidsuspend.rst index dcf6474d..1c64e4a8 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesnodeidsuspend.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesnodeidsuspend.rst @@ -49,3 +49,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesnodeidsuspend.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesreload.rst b/docs/api/v2/controller/node/projectsprojectidnodesreload.rst index 66719c66..7da934b0 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesreload.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesreload.rst @@ -48,3 +48,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesreload.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesstart.rst b/docs/api/v2/controller/node/projectsprojectidnodesstart.rst index 6ec39708..32eb740d 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesstart.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesstart.rst @@ -48,3 +48,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesstart.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodesstop.rst b/docs/api/v2/controller/node/projectsprojectidnodesstop.rst index 94a3c5f1..3e19dafc 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodesstop.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodesstop.rst @@ -48,3 +48,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodesstop.txt + diff --git a/docs/api/v2/controller/node/projectsprojectidnodessuspend.rst b/docs/api/v2/controller/node/projectsprojectidnodessuspend.rst index 595b4740..f32e5935 100644 --- a/docs/api/v2/controller/node/projectsprojectidnodessuspend.rst +++ b/docs/api/v2/controller/node/projectsprojectidnodessuspend.rst @@ -48,3 +48,9 @@ Output z integer Z position of the node +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidnodessuspend.txt + diff --git a/docs/api/v2/controller/project/projects.rst b/docs/api/v2/controller/project/projects.rst index cfc45158..78bf8367 100644 --- a/docs/api/v2/controller/project/projects.rst +++ b/docs/api/v2/controller/project/projects.rst @@ -44,6 +44,12 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projects.txt + GET /v2/projects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -53,3 +59,9 @@ Response status codes ********************** - **200**: List of projects +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projects.txt + diff --git a/docs/api/v2/controller/project/projectsload.rst b/docs/api/v2/controller/project/projectsload.rst index 8f018a42..e59bc766 100644 --- a/docs/api/v2/controller/project/projectsload.rst +++ b/docs/api/v2/controller/project/projectsload.rst @@ -43,3 +43,9 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsload.txt + diff --git a/docs/api/v2/controller/project/projectsprojectid.rst b/docs/api/v2/controller/project/projectsprojectid.rst index 3a257af0..6d084b30 100644 --- a/docs/api/v2/controller/project/projectsprojectid.rst +++ b/docs/api/v2/controller/project/projectsprojectid.rst @@ -16,6 +16,12 @@ Response status codes - **200**: Project information returned - **404**: The project doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectid.txt + PUT /v2/projects/**{project_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -60,6 +66,12 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_put_projectsprojectid.txt + DELETE /v2/projects/**{project_id}** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -74,3 +86,9 @@ Response status codes - **204**: Changes have been written on disk - **404**: The project doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_delete_projectsprojectid.txt + diff --git a/docs/api/v2/controller/project/projectsprojectidclose.rst b/docs/api/v2/controller/project/projectsprojectidclose.rst index 72c36ddb..a9a44218 100644 --- a/docs/api/v2/controller/project/projectsprojectidclose.rst +++ b/docs/api/v2/controller/project/projectsprojectidclose.rst @@ -34,3 +34,9 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidclose.txt + diff --git a/docs/api/v2/controller/project/projectsprojectidduplicate.rst b/docs/api/v2/controller/project/projectsprojectidduplicate.rst index 17a0611a..da438b74 100644 --- a/docs/api/v2/controller/project/projectsprojectidduplicate.rst +++ b/docs/api/v2/controller/project/projectsprojectidduplicate.rst @@ -49,3 +49,9 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidduplicate.txt + diff --git a/docs/api/v2/controller/project/projectsprojectidopen.rst b/docs/api/v2/controller/project/projectsprojectidopen.rst index 9af3191a..02c3e627 100644 --- a/docs/api/v2/controller/project/projectsprojectidopen.rst +++ b/docs/api/v2/controller/project/projectsprojectidopen.rst @@ -34,3 +34,9 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidopen.txt + diff --git a/docs/api/v2/controller/server/settings.rst b/docs/api/v2/controller/server/settings.rst index 8d9d6f63..ff3cac61 100644 --- a/docs/api/v2/controller/server/settings.rst +++ b/docs/api/v2/controller/server/settings.rst @@ -11,6 +11,12 @@ Response status codes ********************** - **200**: OK +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_settings.txt + POST /v2/settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -20,3 +26,9 @@ Response status codes ********************** - **201**: Writed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_settings.txt + diff --git a/docs/api/v2/controller/server/shutdown.rst b/docs/api/v2/controller/server/shutdown.rst index 8a1849d1..27d95fed 100644 --- a/docs/api/v2/controller/server/shutdown.rst +++ b/docs/api/v2/controller/server/shutdown.rst @@ -12,3 +12,9 @@ Response status codes - **201**: Server is shutting down - **403**: Server shutdown refused +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_shutdown.txt + diff --git a/docs/api/v2/controller/server/version.rst b/docs/api/v2/controller/server/version.rst index b43d4d0b..70c5f5db 100644 --- a/docs/api/v2/controller/server/version.rst +++ b/docs/api/v2/controller/server/version.rst @@ -21,6 +21,12 @@ Output version ✔ string Version number +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_version.txt + POST /v2/version ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -51,3 +57,9 @@ Output version ✔ string Version number +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_version.txt + diff --git a/docs/api/v2/controller/snapshot/projectsprojectidsnapshots.rst b/docs/api/v2/controller/snapshot/projectsprojectidsnapshots.rst index 4c537bbe..c37b5788 100644 --- a/docs/api/v2/controller/snapshot/projectsprojectidsnapshots.rst +++ b/docs/api/v2/controller/snapshot/projectsprojectidsnapshots.rst @@ -37,6 +37,12 @@ Output snapshot_id ✔ string Snapshot UUID +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidsnapshots.txt + GET /v2/projects/**{project_id}**/snapshots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -51,3 +57,9 @@ Response status codes - **200**: Snasphot list returned - **404**: The project doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_projectsprojectidsnapshots.txt + diff --git a/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotid.rst b/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotid.rst index 3540c7bd..bf3a0e59 100644 --- a/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotid.rst +++ b/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotid.rst @@ -17,3 +17,9 @@ Response status codes - **204**: Changes have been written on disk - **404**: The project or snapshot doesn't exist +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_delete_projectsprojectidsnapshotssnapshotid.txt + diff --git a/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotidrestore.rst b/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotidrestore.rst index e8885eb2..7c55a564 100644 --- a/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotidrestore.rst +++ b/docs/api/v2/controller/snapshot/projectsprojectidsnapshotssnapshotidrestore.rst @@ -35,3 +35,9 @@ Output status enum Possible values: opened, closed +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidsnapshotssnapshotidrestore.txt + diff --git a/docs/api/v2/controller/symbol/symbols.rst b/docs/api/v2/controller/symbol/symbols.rst index a58a8b66..d6ed5aa6 100644 --- a/docs/api/v2/controller/symbol/symbols.rst +++ b/docs/api/v2/controller/symbol/symbols.rst @@ -11,3 +11,9 @@ Response status codes ********************** - **200**: Symbols list returned +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_get_symbols.txt + diff --git a/docs/index.rst b/docs/index.rst index 1acea149..c02cea54 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,5 +31,4 @@ GNS3 developements .. toctree:: development file_format - port_name_format diff --git a/docs/port_name_format.rst b/docs/port_name_format.rst deleted file mode 100644 index 2c5a5d77..00000000 --- a/docs/port_name_format.rst +++ /dev/null @@ -1,40 +0,0 @@ -Port name formatting -#################### - -Some node like qemu allow you to personnalize the name of ports in order to match the name of the interfaces inside the emulator. - -Simple syntax -============== -The first {} will be replace by the interface number - -For example: "eth{}" will give: -* eth0 -* eth1 -* eth2 - -Or more verbose "eth{port0}" and "eth{0}" will do the same. - -Use segments -============ - -Segment allow you to split your interface in multiple ports - -For example "Ethernet{segment0}/{port0}" with a segment size of 3: - -- Ethernet0/0 -- Ethernet0/1 -- Ethernet0/2 -- Ethernet1/0 -- Ethernet1/1 - -You can also change the start number. - -For example "Ethernet{segment1}/{port1}" with a segment size of 3: - -- Ethernet1/1 -- Ethernet1/2 -- Ethernet1/3 -- Ethernet2/1 -- Ethernet2/2 - -This work from port0 to port9 if you need a bigger range ask us. diff --git a/gns3server/compute/base_node.py b/gns3server/compute/base_node.py index b728401b..b536a271 100644 --- a/gns3server/compute/base_node.py +++ b/gns3server/compute/base_node.py @@ -28,7 +28,7 @@ import platform from gns3server.utils.interfaces import interfaces from ..compute.port_manager import PortManager -from ..utils.asyncio import wait_run_in_executor +from ..utils.asyncio import wait_run_in_executor, locked_coroutine from ..utils.asyncio.telnet_server import AsyncioTelnetServer from ..ubridge.hypervisor import Hypervisor from ..ubridge.ubridge_error import UbridgeError @@ -519,12 +519,16 @@ class BaseNode: except UbridgeError as e: raise UbridgeError("{}: {}".format(e, self._ubridge_hypervisor.read_stdout())) - @asyncio.coroutine + @locked_coroutine def _start_ubridge(self): """ Starts uBridge (handles connections to and from this node). """ + # Prevent us to start multiple ubridge + if self._ubridge_hypervisor and self._ubridge_hypervisor.is_running(): + return + if self.ubridge_path is None: raise NodeError("uBridge is not available, path doesn't exist, or you just installed GNS3 and need to restart your user session to refresh user permissions.") diff --git a/gns3server/compute/docker/__init__.py b/gns3server/compute/docker/__init__.py index 1ff3430d..835e7cd1 100644 --- a/gns3server/compute/docker/__init__.py +++ b/gns3server/compute/docker/__init__.py @@ -24,14 +24,14 @@ import asyncio import logging import aiohttp import json -import sys from gns3server.utils import parse_version +from gns3server.utils.asyncio import locked_coroutine +from gns3server.compute.base_manager import BaseManager +from gns3server.compute.docker.docker_vm import DockerVM +from gns3server.compute.docker.docker_error import DockerError, DockerHttp304Error, DockerHttp404Error log = logging.getLogger(__name__) -from ..base_manager import BaseManager -from .docker_vm import DockerVM -from .docker_error import * DOCKER_MINIMUM_API_VERSION = "1.21" @@ -46,30 +46,38 @@ class Docker(BaseManager): self._connected = False # Allow locking during ubridge operations self.ubridge_lock = asyncio.Lock() + self._connector = None + self._session = None @asyncio.coroutine - def connector(self): - if not self._connected or self._connector.closed: - if not sys.platform.startswith("linux"): - raise DockerError("Docker is supported only on Linux") - + def _check_connection(self): + if not self._connected: try: - self._connector = aiohttp.connector.UnixConnector(self._server_url, conn_timeout=2) self._connected = True + connector = self.connector() version = yield from self.query("GET", "version") except (aiohttp.errors.ClientOSError, FileNotFoundError): self._connected = False raise DockerError("Can't connect to docker daemon") - if parse_version(version["ApiVersion"]) < parse_version(DOCKER_MINIMUM_API_VERSION): raise DockerError("Docker API version is {}. GNS3 requires a minimum API version of {}".format(version["ApiVersion"], DOCKER_MINIMUM_API_VERSION)) + + def connector(self): + if self._connector is None or self._connector.closed: + if not sys.platform.startswith("linux"): + raise DockerError("Docker is supported only on Linux") + try: + self._connector = aiohttp.connector.UnixConnector(self._server_url, conn_timeout=2, limit=None) + except (aiohttp.errors.ClientOSError, FileNotFoundError): + raise DockerError("Can't connect to docker daemon") return self._connector @asyncio.coroutine def unload(self): yield from super().unload() if self._connected: - self._connector.close() + if self._connector and not self._connector.closed: + yield from self._connector.close() @asyncio.coroutine def query(self, method, path, data={}, params={}): @@ -84,7 +92,7 @@ class Docker(BaseManager): response = yield from self.http_query(method, path, data=data, params=params) body = yield from response.read() - if len(body): + if body and len(body): if response.headers['CONTENT-TYPE'] == 'application/json': body = json.loads(body.decode("utf-8")) else: @@ -93,7 +101,7 @@ class Docker(BaseManager): return body @asyncio.coroutine - def http_query(self, method, path, data={}, params={}): + def http_query(self, method, path, data={}, params={}, timeout=300): """ Make a query to the docker daemon @@ -101,18 +109,28 @@ class Docker(BaseManager): :param path: Endpoint in API :param data: Dictionnary with the body. Will be transformed to a JSON :param params: Parameters added as a query arg + :param timeout: Timeout :returns: HTTP response """ data = json.dumps(data) url = "http://docker/" + path + + if timeout is None: + timeout = 60 * 60 * 24 * 31 # One month timeout + try: - response = yield from aiohttp.request( + if path != "version": # version is use by check connection + yield from self._check_connection() + if self._session is None or self._session.closed: + connector = self.connector() + self._session = aiohttp.ClientSession(connector=connector) + response = yield from self._session.request( method, url, - connector=(yield from self.connector()), params=params, data=data, headers={"content-type": "application/json", }, + timeout=timeout ) except (aiohttp.ClientResponseError, aiohttp.ClientOSError) as e: raise DockerError("Docker has returned an error: {}".format(str(e))) @@ -143,11 +161,50 @@ class Docker(BaseManager): url = "http://docker/" + path connection = yield from aiohttp.ws_connect(url, - connector=(yield from self.connector()), + connector=self.connector(), origin="http://docker", autoping=True) return connection + @locked_coroutine + def pull_image(self, image, progress_callback=None): + """ + Pull image from docker repository + + :params image: Image name + :params progress_callback: A function that receive a log message about image download progress + """ + + try: + yield from self.query("GET", "images/{}/json".format(image)) + return # We already have the image skip the download + except DockerHttp404Error: + pass + + if progress_callback: + progress_callback("Pull {} from docker hub".format(image)) + response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None) + # The pull api will stream status via an HTTP JSON stream + content = "" + while True: + chunk = yield from response.content.read(1024) + if not chunk: + break + content += chunk.decode("utf-8") + + try: + while True: + content = content.lstrip(" \r\n\t") + answer, index = json.JSONDecoder().raw_decode(content) + if "progress" in answer and progress_callback: + progress_callback("Pulling image {}:{}: {}".format(image, answer["id"], answer["progress"])) + content = content[index:] + except ValueError: # Partial JSON + pass + response.close() + if progress_callback: + progress_callback("Success pulling image {}".format(image)) + @asyncio.coroutine def list_images(self): """Gets Docker image list. diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index ccfbbaf8..0ac110ac 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -24,7 +24,6 @@ import shutil import psutil import shlex import aiohttp -import json import os from gns3server.utils.asyncio.telnet_server import AsyncioTelnetServer @@ -767,26 +766,9 @@ class DockerVM(BaseNode): """ Pull image from docker repository """ - log.info("Pull %s from docker hub", image) - response = yield from self.manager.http_query("POST", "images/create", params={"fromImage": image}) - # The pull api will stream status via an HTTP JSON stream - content = "" - while True: - chunk = yield from response.content.read(1024) - if not chunk: - break - content += chunk.decode("utf-8") - - try: - while True: - content = content.lstrip(" \r\n\t") - answer, index = json.JSONDecoder().raw_decode(content) - if "progress" in answer: - self.project.emit("log.info", {"message": "Pulling image {}:{}: {}".format(self._image, answer["id"], answer["progress"])}) - content = content[index:] - except ValueError: # Partial JSON - pass - self.project.emit("log.info", {"message": "Success pulling image {}".format(self._image)}) + def callback(msg): + self.project.emit("log.info", {"message": msg}) + yield from self.manager.pull_image(image, progress_callback=callback) @asyncio.coroutine def _start_ubridge_capture(self, adapter_number, output_file): diff --git a/gns3server/compute/dynamips/nodes/ethernet_switch.py b/gns3server/compute/dynamips/nodes/ethernet_switch.py index 52d7c4ab..5798b1e4 100644 --- a/gns3server/compute/dynamips/nodes/ethernet_switch.py +++ b/gns3server/compute/dynamips/nodes/ethernet_switch.py @@ -88,7 +88,7 @@ class EthernetSwitch(Device): :param ports: ports info """ if ports != self._ports: - if len(self._nios) > 0: + if len(self._nios) > 0 and len(ports) != len(self._ports): raise NodeError("Can't modify a switch already connected.") port_number = 0 @@ -99,6 +99,13 @@ class EthernetSwitch(Device): self._ports = ports + @asyncio.coroutine + def update_port_settings(self): + for port_settings in self._ports: + port_number = port_settings["port_number"] + if port_number in self._nios and self._nios[port_number] is not None: + yield from self.set_port_settings(port_number, port_settings) + @asyncio.coroutine def create(self): diff --git a/gns3server/compute/dynamips/nodes/frame_relay_switch.py b/gns3server/compute/dynamips/nodes/frame_relay_switch.py index 943e3d02..6e8a242a 100644 --- a/gns3server/compute/dynamips/nodes/frame_relay_switch.py +++ b/gns3server/compute/dynamips/nodes/frame_relay_switch.py @@ -239,10 +239,10 @@ class FrameRelaySwitch(Device): """ if port1 not in self._nios: - raise DynamipsError("Port {} is not allocated".format(port1)) + return if port2 not in self._nios: - raise DynamipsError("Port {} is not allocated".format(port2)) + return nio1 = self._nios[port1] nio2 = self._nios[port2] diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 200c0b20..2823e751 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -566,7 +566,7 @@ class IOUVM(BaseNode): self._terminate_process_iou() if returncode != 0: - if returncode == 11: + if returncode == -11: message = "{} process has stopped, return code: {}. This could be an issue with the image using a different image can fix the issue.\n{}".format(process_name, returncode, self.read_iou_stdout()) else: message = "{} process has stopped, return code: {}\n{}".format(process_name, returncode, self.read_iou_stdout()) diff --git a/gns3server/compute/project.py b/gns3server/compute/project.py index adcecffb..34401f82 100644 --- a/gns3server/compute/project.py +++ b/gns3server/compute/project.py @@ -74,7 +74,7 @@ class Project: try: if os.path.exists(self.tmp_working_directory()): shutil.rmtree(self.tmp_working_directory()) - except OSError: + except OSError as e: raise aiohttp.web.HTTPInternalServerError(text="Could not clean project directory: {}".format(e)) log.info("Project {id} with path '{path}' created".format(path=self._path, id=self._id)) diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index 77466ec9..55de04dd 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -1014,7 +1014,9 @@ class VirtualBoxVM(BaseNode): if self.ubridge: yield from self._ubridge_send("bridge delete {name}".format(name="VBOX-{}-{}".format(self._id, adapter_number))) - yield from self._control_vm("setlinkstate{} off".format(adapter_number + 1)) + vm_state = yield from self._get_vm_state() + if vm_state == "running": + yield from self._control_vm("setlinkstate{} off".format(adapter_number + 1)) else: vm_state = yield from self._get_vm_state() if vm_state == "running": diff --git a/gns3server/compute/vmware/__init__.py b/gns3server/compute/vmware/__init__.py index 54303b17..db0591d5 100644 --- a/gns3server/compute/vmware/__init__.py +++ b/gns3server/compute/vmware/__init__.py @@ -396,7 +396,7 @@ class VMware(BaseManager): try: stdout_data, _ = yield from asyncio.wait_for(process.communicate(), timeout=timeout) except asyncio.TimeoutError: - raise VMwareError("vmrun has timed out after {} seconds!\nTry to run {} in a terminal to see more informations.\nAnd make sure GNS3 and VMware run under the same user.".format(timeout, command_string)) + raise VMwareError("vmrun has timed out after {} seconds!\nTry to run {} in a terminal to see more informations.\n\nMake sure GNS3 and VMware run under the same user and whitelist vmrun.exe in your antivirus.".format(timeout, command_string)) if process.returncode: # vmrun print errors on stdout diff --git a/gns3server/config.py b/gns3server/config.py index 8d7ad5f3..0e4b80c4 100644 --- a/gns3server/config.py +++ b/gns3server/config.py @@ -50,6 +50,7 @@ class Config: # Monitor configuration files for changes self._watched_files = {} + self._watch_callback = [] if sys.platform.startswith("win"): @@ -116,6 +117,12 @@ class Config: self.clear() self._watch_config_file() + def listen_for_config_changes(self, callback): + """ + Call the callback when the configuration file change + """ + self._watch_callback.append(callback) + @property def profile(self): """ @@ -143,6 +150,8 @@ class Config: self.read_config() for section in self._override_config: self.set_section_config(section, self._override_config[section]) + for callback in self._watch_callback: + callback() def reload(self): """ diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index c397d522..e916947a 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -16,7 +16,9 @@ # along with this program. If not, see . import os +import sys import json +import uuid import socket import shutil import asyncio @@ -55,7 +57,7 @@ class Controller: # Store settings shared by the different GUI will be replace by dedicated API later self._settings = None - + self._local_server = None self._config_file = os.path.join(Config.instance().config_dir, "gns3_controller.conf") log.info("Load controller configuration file {}".format(self._config_file)) @@ -75,6 +77,7 @@ class Controller: log.info("Start controller") self.load_base_files() server_config = Config.instance().get_section_config("Server") + Config.instance().listen_for_config_changes(self._update_config) host = server_config.get("host", "localhost") # If console_host is 0.0.0.0 client will use the ip they use @@ -88,15 +91,19 @@ class Controller: name = "Main server" computes = yield from self._load_controller_settings() - yield from self.add_compute(compute_id="local", - name=name, - protocol=server_config.get("protocol", "http"), - host=host, - console_host=console_host, - port=server_config.getint("port", 3080), - user=server_config.get("user", ""), - password=server_config.get("password", ""), - force=True) + try: + self._local_server = yield from self.add_compute(compute_id="local", + name=name, + protocol=server_config.get("protocol", "http"), + host=host, + console_host=console_host, + port=server_config.getint("port", 3080), + user=server_config.get("user", ""), + password=server_config.get("password", ""), + force=True) + except aiohttp.web_exceptions.HTTPConflict as e: + log.fatal("Can't acces to the local server, make sure anything else is not running on the same port") + sys.exit(1) for c in computes: try: yield from self.add_compute(**c) @@ -106,6 +113,16 @@ class Controller: yield from self.gns3vm.auto_start_vm() yield from self._project_auto_open() + def _update_config(self): + """ + Call this when the server configuration file + change + """ + if self._local_server: + server_config = Config.instance().get_section_config("Server") + self._local_server.user = server_config.get("user") + self._local_server.password = server_config.get("password") + @asyncio.coroutine def stop(self): log.info("Stop controller") @@ -239,14 +256,17 @@ class Controller: data = json.load(f) server_settings = data.get("Servers", {}) for remote in server_settings.get("remote_servers", []): - yield from self.add_compute( - host=remote.get("host", "localhost"), - port=remote.get("port", 3080), - protocol=remote.get("protocol", "http"), - name=remote.get("url"), - user=remote.get("user"), - password=remote.get("password") - ) + try: + yield from self.add_compute( + host=remote.get("host", "localhost"), + port=remote.get("port", 3080), + protocol=remote.get("protocol", "http"), + name=remote.get("url"), + user=remote.get("user"), + password=remote.get("password") + ) + except aiohttp.web.HTTPConflict: + pass # if the server is broken we skip it if "vm" in server_settings: vmname = None vm_settings = server_settings["vm"] @@ -282,12 +302,12 @@ class Controller: """ Store settings shared by the different GUI will be replace by dedicated API later. Dictionnary """ - assert self._settings is not None return self._settings @settings.setter def settings(self, val): self._settings = val + self._settings["modification_uuid"] = str(uuid.uuid4()) # We add a modification id to the settings it's help the gui to detect changes self.save() self.notification.emit("settings.updated", val) diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 85f10575..03e03257 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -128,7 +128,7 @@ class Compute: self._user = user.strip() if password: self._password = password.strip() - self._auth = aiohttp.BasicAuth(self._user, self._password) + self._auth = aiohttp.BasicAuth(self._user, self._password, "utf-8") else: self._password = None self._auth = aiohttp.BasicAuth(self._user, "") @@ -397,6 +397,8 @@ class Compute: raise aiohttp.web.HTTPConflict(text="Invalid auth for server {}".format(self._id)) except aiohttp.web.HTTPServiceUnavailable: raise aiohttp.web.HTTPConflict(text="The server {} is unavailable".format(self._id)) + except ValueError: + raise aiohttp.web.HTTPConflict(text="Invalid server url for server {}".format(self._id)) if "version" not in response.json: self._http_session.close() @@ -502,7 +504,7 @@ class Compute: response = yield from self._session().request(method, url, headers=headers, data=data, auth=self._auth, chunked=chunked, timeout=timeout) except asyncio.TimeoutError as e: raise ComputeError("Timeout error when connecting to {}".format(url)) - except (aiohttp.errors.ClientOSError, aiohttp.errors.ClientRequestError, aiohttp.ClientResponseError) as e: + except (aiohttp.errors.ClientOSError, aiohttp.errors.ClientRequestError, aiohttp.errors.ServerDisconnectedError, aiohttp.ClientResponseError, ValueError) as e: raise ComputeError(str(e)) body = yield from response.read() if body and not raw: diff --git a/gns3server/controller/export_project.py b/gns3server/controller/export_project.py index 1cc93a12..6f3f6556 100644 --- a/gns3server/controller/export_project.py +++ b/gns3server/controller/export_project.py @@ -191,3 +191,5 @@ def _export_images(project, image, z): arcname = os.path.join("images", directory, os.path.basename(image)) z.write(path, arcname) break + else: + raise aiohttp.web.HTTPConflict(text="Topology could not be exported because the image {} is not available. If you use multiple server, we need a copy of the image on the main server.".format(path)) diff --git a/gns3server/controller/import_project.py b/gns3server/controller/import_project.py index a29ff363..63dd4507 100644 --- a/gns3server/controller/import_project.py +++ b/gns3server/controller/import_project.py @@ -75,7 +75,10 @@ def import_project(controller, project_id, stream, location=None, name=None, kee else: projects_path = controller.projects_directory() path = os.path.join(projects_path, project_name) - os.makedirs(path, exist_ok=True) + try: + os.makedirs(path, exist_ok=True) + except UnicodeEncodeError as e: + raise aiohttp.web.HTTPConflict(text="The project name contain non supported or invalid characters") myzip.extractall(path) topology = load_topology(os.path.join(path, "project.gns3")) diff --git a/gns3server/controller/link.py b/gns3server/controller/link.py index 03c5f12c..90ec12fc 100644 --- a/gns3server/controller/link.py +++ b/gns3server/controller/link.py @@ -18,6 +18,7 @@ import os import re import uuid +import html import asyncio import aiohttp @@ -83,7 +84,7 @@ class Link: "x": -10, "y": -10, "rotation": 0, - "text": "{}/{}".format(adapter_number, port_number), + "text": html.escape("{}/{}".format(adapter_number, port_number)), "style": "font-size: 10; font-style: Verdana" } diff --git a/gns3server/controller/node.py b/gns3server/controller/node.py index 49337325..d43c3be6 100644 --- a/gns3server/controller/node.py +++ b/gns3server/controller/node.py @@ -17,6 +17,7 @@ import aiohttp import asyncio +import html import copy import uuid import os @@ -238,7 +239,7 @@ class Node: self._label = { "y": round(self._height / 2 + 10) * -1, - "text": self._name, + "text": html.escape(self._name), "style": style, "x": None, # None: mean the client should center it "rotation": 0 diff --git a/gns3server/controller/ports/port.py b/gns3server/controller/ports/port.py index a44e7f99..b801ddbf 100644 --- a/gns3server/controller/ports/port.py +++ b/gns3server/controller/ports/port.py @@ -66,7 +66,7 @@ class Port: # If port name format has change we use the port name as the short name (1.X behavior) if self._short_name: return self._short_name - elif not self._name.startswith(self.long_name_type()): + elif not self._name.startswith("{}{}".format(self.long_name_type(), self._interface_number)): return self._name return self.short_name_type + "{}/{}".format(self._interface_number, self._port_number) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index c6caa7bf..6622145f 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -637,7 +637,7 @@ class Project: for node in topology.get("nodes", []): compute = self.controller.get_compute(node.pop("compute_id")) name = node.pop("name") - node_id = node.pop("node_id") + node_id = node.pop("node_id", str(uuid.uuid4())) yield from self.add_node(compute, name, node_id, dump=False, **node) for link_data in topology.get("links", []): link = yield from self.add_link(link_id=link_data["link_id"]) @@ -663,7 +663,10 @@ class Project: pass self._status = "closed" self._loading = False - raise e + if isinstance(e, ComputeError): + raise aiohttp.web.HTTPConflict(text=str(e)) + else: + raise e try: os.remove(path + ".backup") except OSError: @@ -699,6 +702,7 @@ class Project: if self._status == "closed": yield from self.open() + self.dump() try: with tempfile.TemporaryDirectory() as tmpdir: zipstream = yield from export_project(self, tmpdir, keep_compute_id=True, allow_all_nodes=True) diff --git a/gns3server/controller/topology.py b/gns3server/controller/topology.py index bdb1a318..10e4de6a 100644 --- a/gns3server/controller/topology.py +++ b/gns3server/controller/topology.py @@ -16,6 +16,7 @@ # along with this program. If not, see . import os +import html import json import copy import uuid @@ -285,7 +286,10 @@ def _convert_1_3_later(topo, topo_path): for old_node in topo.get("nodes", []): node = {} node["console"] = old_node["properties"].get("console", None) - node["compute_id"] = server_id_to_compute_id[old_node["server_id"]] + try: + node["compute_id"] = server_id_to_compute_id[old_node["server_id"]] + except KeyError: + node["compute_id"] = "local" node["console_type"] = old_node["properties"].get("console_type", "telnet") node["name"] = old_node["label"]["text"] node["label"] = _convert_label(old_node["label"]) @@ -376,9 +380,11 @@ def _convert_1_3_later(topo, topo_path): node["symbol"] = ":/symbols/router.svg" elif old_node["type"] == "Cloud": - old_node["ports"] = _create_cloud(node, old_node, ":/symbols/cloud.svg") + symbol = old_node.get("symbol", ":/symbols/cloud.svg") + old_node["ports"] = _create_cloud(node, old_node, symbol) elif old_node["type"] == "Host": - old_node["ports"] = _create_cloud(node, old_node, ":/symbols/computer.svg") + symbol = old_node.get("symbol", ":/symbols/computer.svg") + old_node["ports"] = _create_cloud(node, old_node, symbol) else: raise NotImplementedError("Conversion of {} is not supported".format(old_node["type"])) @@ -463,7 +469,7 @@ def _convert_1_3_later(topo, topo_path): size=int(font_info[1]), weight=weight, style=style, - text=note["text"] + text=html.escape(note["text"]) ) new_note = { "drawing_id": str(uuid.uuid4()), @@ -550,7 +556,7 @@ def _convert_label(label): """ style = qt_font_to_style(label.get("font"), label.get("color")) return { - "text": label["text"], + "text": html.escape(label["text"]), "rotation": 0, "style": style, "x": int(label["x"]), diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index d5e350a5..defbe8e1 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -54,7 +54,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "sync+https://5b834577b69a4b77b112f020412237b5:b648d289253740daad5c08a939ceffd7@sentry.io/38482" + DSN = "sync+https://7c028290d17b4035916285b304d42311:ddf752e704c7423cacab93f8e34f713c@sentry.io/38482" if hasattr(sys, "frozen"): cacert = get_resource("cacert.pem") if cacert is not None and os.path.isfile(cacert): diff --git a/gns3server/handlers/api/compute/ethernet_switch_handler.py b/gns3server/handlers/api/compute/ethernet_switch_handler.py index 72a05107..608e5121 100644 --- a/gns3server/handlers/api/compute/ethernet_switch_handler.py +++ b/gns3server/handlers/api/compute/ethernet_switch_handler.py @@ -54,10 +54,10 @@ class EthernetSwitchHandler: # Use the Dynamips Ethernet switch to simulate this node dynamips_manager = Dynamips.instance() node = yield from dynamips_manager.create_node(request.json.pop("name"), - request.match_info["project_id"], - request.json.get("node_id"), - node_type="ethernet_switch", - ports=request.json.get("ports_mapping")) + request.match_info["project_id"], + request.json.get("node_id"), + node_type="ethernet_switch", + ports=request.json.get("ports_mapping")) # On Linux, use the generic switch # builtin_manager = Builtin.instance() @@ -114,6 +114,7 @@ class EthernetSwitchHandler: yield from node.set_name(request.json["name"]) if "ports_mapping" in request.json: node.ports_mapping = request.json["ports_mapping"] + yield from node.update_port_settings() # builtin_manager = Builtin.instance() # node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"]) diff --git a/gns3server/handlers/api/compute/virtualbox_handler.py b/gns3server/handlers/api/compute/virtualbox_handler.py index f7ee4b45..5e74592d 100644 --- a/gns3server/handlers/api/compute/virtualbox_handler.py +++ b/gns3server/handlers/api/compute/virtualbox_handler.py @@ -22,6 +22,7 @@ from gns3server.web.route import Route from gns3server.schemas.nio import NIO_SCHEMA from gns3server.schemas.node import NODE_CAPTURE_SCHEMA from gns3server.compute.virtualbox import VirtualBox +from gns3server.compute.virtualbox.virtualbox_error import VirtualBoxError from gns3server.compute.project_manager import ProjectManager from gns3server.schemas.virtualbox import ( @@ -116,9 +117,15 @@ class VirtualBoxHandler: name = request.json.pop("name") vmname = request.json.pop("vmname", None) if name != vm.name: + oldname = vm.name vm.name = name if vm.linked_clone: - yield from vm.set_vmname(vm.name) + try: + yield from vm.set_vmname(vm.name) + except VirtualBoxError as e: # In case of error we rollback (we can't change the name when running) + vm.name = oldname + vm.updated() + raise e if "adapters" in request.json: adapters = int(request.json.pop("adapters")) diff --git a/gns3server/handlers/api/controller/server_handler.py b/gns3server/handlers/api/controller/server_handler.py index f6551550..a0208a69 100644 --- a/gns3server/handlers/api/controller/server_handler.py +++ b/gns3server/handlers/api/controller/server_handler.py @@ -103,7 +103,15 @@ class ServerHandler: description="Retrieve gui settings from the server. Temporary will we removed in later release") def read_settings(request, response): - response.json(Controller.instance().settings) + settings = None + while True: + # The init of the server could take some times + # we ensure settings are loaded before returning them + settings = Controller.instance().settings + if settings is not None: + break + yield from asyncio.sleep(0.5) + response.json(settings) @Route.post( r"/settings", @@ -113,6 +121,8 @@ class ServerHandler: }) def write_settings(request, response): controller = Controller.instance() + if controller.settings is None: # Server is not loaded ignore settings update to prevent buggy client sync issue + return controller.settings = request.json try: controller.save() diff --git a/gns3server/handlers/api/controller/symbol_handler.py b/gns3server/handlers/api/controller/symbol_handler.py index ac225233..7122a2e3 100644 --- a/gns3server/handlers/api/controller/symbol_handler.py +++ b/gns3server/handlers/api/controller/symbol_handler.py @@ -49,7 +49,7 @@ class SymbolHandler: controller = Controller.instance() try: yield from response.file(controller.symbols.get_path(request.match_info["symbol_id"])) - except (KeyError, FileNotFoundError): + except (KeyError, FileNotFoundError, PermissionError): response.set_status(404) @Route.post( diff --git a/gns3server/run.py b/gns3server/run.py index 41421b17..ccfb1a9d 100644 --- a/gns3server/run.py +++ b/gns3server/run.py @@ -26,9 +26,7 @@ import datetime import sys import locale import argparse -import shutil import psutil -import asyncio from gns3server.web.web_server import WebServer @@ -107,7 +105,6 @@ def parse_arguments(argv): parser.add_argument("--daemon", action="store_true", help="start as a daemon") parser.add_argument("--pid", help="store process pid") parser.add_argument("--profile", help="Settings profile (blank will use default settings files)") - parser.add_argument("--discovery", action="store_true", help="Make server discoverable on the network") args = parser.parse_args(argv) if args.config: @@ -128,8 +125,7 @@ def parse_arguments(argv): "allow": config.getboolean("allow_remote_console", False), "quiet": config.getboolean("quiet", False), "debug": config.getboolean("debug", False), - "logfile": config.getboolean("logfile", ""), - "server_discovery": config.getboolean("server_discovery", False) + "logfile": config.getboolean("logfile", "") } parser.set_defaults(**defaults) diff --git a/gns3server/ubridge/hypervisor.py b/gns3server/ubridge/hypervisor.py index 452e2524..1e6ae825 100644 --- a/gns3server/ubridge/hypervisor.py +++ b/gns3server/ubridge/hypervisor.py @@ -174,7 +174,7 @@ class Hypervisor(UBridgeHypervisor): except (OSError, PermissionError, subprocess.SubprocessError) as e: ubridge_stdout = self.read_stdout() log.error("Could not start ubridge: {}\n{}".format(e, ubridge_stdout)) - raise UBridgeHypervisor("Could not start ubridge: {}\n{}".format(e, ubridge_stdout)) + raise UbridgeError("Could not start ubridge: {}\n{}".format(e, ubridge_stdout)) def _termination_callback(self, returncode): """ @@ -201,7 +201,10 @@ class Hypervisor(UBridgeHypervisor): except asyncio.TimeoutError: if self._process.returncode is None: log.warn("uBridge process {} is still running... killing it".format(self._process.pid)) - self._process.kill() + try: + self._process.kill() + except ProcessLookupError: + pass if self._stdout_file and os.access(self._stdout_file, os.W_OK): try: diff --git a/gns3server/utils/images.py b/gns3server/utils/images.py index fd867aa6..0f7bc8f5 100644 --- a/gns3server/utils/images.py +++ b/gns3server/utils/images.py @@ -58,7 +58,7 @@ def list_images(type): if filename.endswith(".md5sum") or filename.startswith("."): continue elif ((filename.endswith(".image") or filename.endswith(".bin")) and type == "dynamips") \ - or (filename.endswith(".bin") and type == "iou") \ + or ((filename.endswith(".bin") or filename.startswith("i86bi")) and type == "iou") \ or (not filename.endswith(".bin") and not filename.endswith(".image") and type == "qemu"): files.add(filename) diff --git a/gns3server/utils/picture.py b/gns3server/utils/picture.py index 0fd740d8..50d17996 100644 --- a/gns3server/utils/picture.py +++ b/gns3server/utils/picture.py @@ -99,8 +99,8 @@ def get_size(data, default_width=0, default_height=0): root = tree.getroot() try: - width = _svg_convert_size(root.attrib["width"]) - height = _svg_convert_size(root.attrib["height"]) + width = _svg_convert_size(root.attrib.get("width", "0")) + height = _svg_convert_size(root.attrib.get("height", "0")) except IndexError: raise ValueError("Invalid SVG file") diff --git a/gns3server/web/route.py b/gns3server/web/route.py index 3f5a153c..7c06952b 100644 --- a/gns3server/web/route.py +++ b/gns3server/web/route.py @@ -21,7 +21,6 @@ import urllib import asyncio import aiohttp import logging -import urllib import traceback import jsonschema @@ -114,7 +113,7 @@ class Route(object): return if "AUTHORIZATION" in request.headers: - if request.headers["AUTHORIZATION"] == aiohttp.helpers.BasicAuth(user, password).encode(): + if request.headers["AUTHORIZATION"] == aiohttp.helpers.BasicAuth(user, password, "utf-8").encode(): return log.error("Invalid auth. Username should %s", user) diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index bccb3083..1e8bd1b8 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -22,11 +22,7 @@ Set up and run the server. import os import sys import signal -import socket -import json -import ipaddress import asyncio -import threading import aiohttp import aiohttp_cors import functools @@ -38,7 +34,6 @@ from ..config import Config from ..compute import MODULES from ..compute.port_manager import PortManager from ..controller import Controller -from ..version import __version__ # do not delete this import @@ -191,63 +186,12 @@ class WebServer: atexit.register(close_asyncio_loop) - def _udp_server_discovery(self): + @asyncio.coroutine + def _on_startup(self, *args): """ - UDP multicast and broadcast server discovery (Linux only) + Called when the HTTP server start """ - - import ctypes - uint32_t = ctypes.c_uint32 - in_addr_t = uint32_t - - class in_addr(ctypes.Structure): - _fields_ = [('s_addr', in_addr_t)] - - class in_pktinfo(ctypes.Structure): - _fields_ = [('ipi_ifindex', ctypes.c_int), - ('ipi_spec_dst', in_addr), - ('ipi_addr', in_addr)] - - IP_PKTINFO = 8 - with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock: - membership = socket.inet_aton("239.42.42.1") + socket.inet_aton("0.0.0.0") - sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, membership) - sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) - sock.setsockopt(socket.SOL_IP, IP_PKTINFO, 1) - try: - sock.bind(("", self._port)) - except OSError as e: - log.error("UDP server discovery could not bind on port {}: {}".format(self._port, e)) - return - - log.info("UDP server discovery started on port {}".format(self._port)) - while self._loop.is_running(): - try: - data, ancdata, _, address = sock.recvmsg(255, socket.CMSG_LEN(255)) - except OSError as e: - log.error("Error while receiving UDP server discovery request: {}".format(e)) - continue - cmsg_level, cmsg_type, cmsg_data = ancdata[0] - if cmsg_level == socket.SOL_IP and cmsg_type == IP_PKTINFO: - pktinfo = in_pktinfo.from_buffer_copy(cmsg_data) - request_address = ipaddress.IPv4Address(memoryview(pktinfo.ipi_addr).tobytes()) - receiving_interface = socket.if_indextoname(pktinfo.ipi_ifindex) - log.debug("UDP server discovery request received on {} using {}".format(receiving_interface, - request_address)) - local_address = ipaddress.IPv4Address(memoryview(pktinfo.ipi_spec_dst).tobytes()) - if self._host != "0.0.0.0" and self._host != str(local_address): - log.debug("Ignoring UDP discovery request received on {} instead of {}".format(local_address, - self._host)) - continue - server_info = {"version": __version__, - "ip": str(local_address), - "port": self._port} - data = json.dumps(server_info) - sock.sendto(data.encode(), address) - log.debug("Sent server info to {}:{} {}".format(address[0], address[1], data)) - time.sleep(1) # this is to prevent too many request to slow down the server - log.debug("UDP server discovery stopped") + yield from Controller.instance().start() def run(self): """ @@ -288,8 +232,9 @@ class WebServer: for key, val in os.environ.items(): log.debug("ENV %s=%s", key, val) - self._loop.run_until_complete(Controller.instance().start()) self._app = aiohttp.web.Application() + # Background task started with the server + self._app.on_startup.append(self._on_startup) # Allow CORS for this domains cors = aiohttp_cors.setup(self._app, defaults={ @@ -322,11 +267,6 @@ class WebServer: if server_config.getboolean("shell"): asyncio.async(self.start_shell()) - if sys.platform.startswith("linux") and server_config.getboolean("server_discovery"): - # UDP discovery is only supported on Linux - udp_server_discovery = threading.Thread(target=self._udp_server_discovery, daemon=True) - udp_server_discovery.start() - try: self._loop.run_forever() except TypeError as e: diff --git a/requirements.txt b/requirements.txt index c5400455..21a43549 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ jsonschema>=2.4.0 -aiohttp>=1.3.0,<=1.4.0 -aiohttp_cors>=0.4.0 -yarl>=0.9.8 +aiohttp>=1.3.5,<=1.4.0 # pyup: ignore +aiohttp-cors==0.5.1 # pyup: ignore +yarl>=0.9.8,<0.10 # pyup: ignore typing>=3.5.3.0 # Otherwise yarl fail with python 3.4 Jinja2>=2.7.3 raven>=5.23.0 diff --git a/scripts/remote-install.sh b/scripts/remote-install.sh index c89f40fb..260c8d8d 100644 --- a/scripts/remote-install.sh +++ b/scripts/remote-install.sh @@ -31,9 +31,7 @@ function help { } function log { - tput setaf 2 echo "=> $1" >&2 - tput sgr0 } lsb_release -d | grep "LTS" > /dev/null diff --git a/scripts/run_on_gns3vm.sh b/scripts/run_on_gns3vm.sh new file mode 100755 index 00000000..4bde8eb0 --- /dev/null +++ b/scripts/run_on_gns3vm.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This script will push current dev to a GNS3 VM and +# will also start the server in console + +SERVER_ADDRESS=$1 + +if [ "$SERVER_ADDRESS" == "" ] +then + echo "usage: run_on_gns3vm.sh VM_IP" + exit 1 +fi + +ssh gns3@$SERVER_ADDRESS "sudo service gns3 stop" +rsync -avz --exclude==".git/*" --exclude=='docs/*' --exclude="__pycache__" --exclude=='tests/*' . "gns3@$SERVER_ADDRESS:gns3server" + +ssh gns3@$SERVER_ADDRESS "killall python3;cd gns3server;python3 -m gns3server" diff --git a/setup.py b/setup.py index cdb37d9c..02663755 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand # we only support Python 3 version >= 3.4 -if sys.version_info < (3, 4): +if len(sys.argv) >= 2 and sys.argv[1] == "install" and sys.version_info < (3, 4): raise SystemExit("Python 3.4 or higher is required") diff --git a/tests/compute/docker/test_docker.py b/tests/compute/docker/test_docker.py index 79523543..25779ca6 100644 --- a/tests/compute/docker/test_docker.py +++ b/tests/compute/docker/test_docker.py @@ -19,17 +19,17 @@ import pytest import asyncio from unittest.mock import MagicMock -from tests.utils import asyncio_patch +from tests.utils import asyncio_patch, AsyncioMagicMock from gns3server.compute.docker import Docker -from gns3server.compute.docker.docker_error import DockerError +from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error @pytest.fixture def vm(): vm = Docker() vm._connected = True - vm._connector = MagicMock() - vm._connector.closed = False + vm._session = MagicMock() + vm._session.closed = False return vm @@ -44,14 +44,14 @@ def test_query_success(loop, vm): return b'{"c": false}' response.read.side_effect = read - with asyncio_patch("aiohttp.request", return_value=response) as mock: - data = loop.run_until_complete(asyncio.async(vm.query("POST", "test", data={"a": True}, params={"b": 1}))) - mock.assert_called_with('POST', - 'http://docker/test', - connector=vm._connector, - data='{"a": true}', - headers={'content-type': 'application/json'}, - params={'b': 1}) + vm._session.request = AsyncioMagicMock(return_value=response) + data = loop.run_until_complete(asyncio.async(vm.query("POST", "test", data={"a": True}, params={"b": 1}))) + vm._session.request.assert_called_with('POST', + 'http://docker/test', + data='{"a": true}', + headers={'content-type': 'application/json'}, + params={'b': 1}, + timeout=300) assert data == {"c": False} @@ -66,15 +66,15 @@ def test_query_error(loop, vm): return b"NOT FOUND" response.read.side_effect = read - with asyncio_patch("aiohttp.request", return_value=response) as mock: - with pytest.raises(DockerError): - data = loop.run_until_complete(asyncio.async(vm.query("POST", "test", data={"a": True}, params={"b": 1}))) - mock.assert_called_with('POST', - 'http://docker/test', - connector=vm._connector, - data='{"a": true}', - headers={'content-type': 'application/json'}, - params={'b': 1}) + vm._session.request = AsyncioMagicMock(return_value=response) + with pytest.raises(DockerError): + data = loop.run_until_complete(asyncio.async(vm.query("POST", "test", data={"a": True}, params={"b": 1}))) + vm._session.request.assert_called_with('POST', + 'http://docker/test', + data='{"a": true}', + headers={'content-type': 'application/json'}, + params={'b': 1}, + timeout=300) def test_query_error_json(loop, vm): @@ -87,15 +87,15 @@ def test_query_error_json(loop, vm): return b'{"message": "Error"}' response.read.side_effect = read - with asyncio_patch("aiohttp.request", return_value=response) as mock: - with pytest.raises(DockerError): - data = loop.run_until_complete(asyncio.async(vm.query("POST", "test", data={"a": True}, params={"b": 1}))) - mock.assert_called_with('POST', - 'http://docker/test', - connector=vm._connector, - data='{"a": true}', - headers={'content-type': 'application/json'}, - params={'b': 1}) + vm._session.request = AsyncioMagicMock(return_value=response) + with pytest.raises(DockerError): + data = loop.run_until_complete(asyncio.async(vm.query("POST", "test", data={"a": True}, params={"b": 1}))) + vm._session.request.assert_called_with('POST', + 'http://docker/test', + data='{"a": true}', + headers={'content-type': 'application/json'}, + params={'b': 1}, + timeout=300) def test_list_images(loop): @@ -134,3 +134,31 @@ def test_list_images(loop): assert {"image": "ubuntu:latest"} in images assert {"image": "ubuntu:12.10"} in images assert {"image": "ubuntu:quantal"} in images + + +def test_pull_image(loop): + class Response: + """ + Simulate a response splitted in multiple packets + """ + + def __init__(self): + self._read = -1 + + @asyncio.coroutine + def read(self, size): + self._read += 1 + if self._read == 0: + return b'{"progress": "0/100",' + elif self._read == 1: + return '"id": 42}' + else: + None + + mock_query = MagicMock() + mock_query.content.return_value = Response() + + with asyncio_patch("gns3server.compute.docker.Docker.query", side_effect=DockerHttp404Error("404")): + with asyncio_patch("gns3server.compute.docker.Docker.http_query", return_value=mock_query) as mock: + images = loop.run_until_complete(asyncio.async(Docker.instance().pull_image("ubuntu"))) + mock.assert_called_with("POST", "images/create", params={"fromImage": "ubuntu"}, timeout=None) diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index d55b411e..70517b5b 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -795,33 +795,6 @@ def test_adapter_remove_nio_binding_invalid_adapter(vm, loop): loop.run_until_complete(asyncio.async(vm.adapter_remove_nio_binding(12))) -def test_pull_image(loop, vm): - class Response: - """ - Simulate a response splitted in multiple packets - """ - - def __init__(self): - self._read = -1 - - @asyncio.coroutine - def read(self, size): - self._read += 1 - if self._read == 0: - return b'{"progress": "0/100",' - elif self._read == 1: - return '"id": 42}' - else: - None - - mock_query = MagicMock() - mock_query.content.return_value = Response() - - with asyncio_patch("gns3server.compute.docker.Docker.http_query", return_value=mock_query) as mock: - images = loop.run_until_complete(asyncio.async(vm.pull_image("ubuntu"))) - mock.assert_called_with("POST", "images/create", params={"fromImage": "ubuntu"}) - - def test_start_capture(vm, tmpdir, manager, free_console_port, loop): output_file = str(tmpdir / "test.pcap") diff --git a/tests/controller/test_controller.py b/tests/controller/test_controller.py index f27b712b..f734300f 100644 --- a/tests/controller/test_controller.py +++ b/tests/controller/test_controller.py @@ -192,7 +192,8 @@ def test_import_remote_gns3vm_1_x(controller, controller_config_path, async_run) def test_settings(controller): controller._notification = MagicMock() controller.settings = {"a": 1} - controller._notification.emit.assert_called_with("settings.updated", {"a": 1}) + controller._notification.emit.assert_called_with("settings.updated", controller.settings) + assert controller.settings["modification_uuid"] is not None def test_load_projects(controller, projects_dir, async_run): diff --git a/tests/handlers/api/controller/test_settings.py b/tests/handlers/api/controller/test_settings.py index 2bc52f39..a87df472 100644 --- a/tests/handlers/api/controller/test_settings.py +++ b/tests/handlers/api/controller/test_settings.py @@ -29,4 +29,5 @@ def test_settings(http_controller): assert response.status == 201 response = http_controller.get('/settings', example=True) assert response.status == 200 - assert response.json == query + assert response.json["test"] is True + assert response.json["modification_uuid"] is not None