Complete documentation

This commit is contained in:
Julien Duponchelle 2015-01-27 15:06:55 +01:00
parent 29a4a0634d
commit f682e1c474
24 changed files with 86 additions and 58 deletions

View File

@ -5,9 +5,9 @@ DELETE /project/{uuid} HTTP/1.1
HTTP/1.1 204
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /project/{uuid}

View File

@ -5,9 +5,9 @@ DELETE /virtualbox/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1
HTTP/1.1 204
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /virtualbox/{uuid}/ports/{port_id:\d+}/nio

View File

@ -5,9 +5,9 @@ DELETE /vpcs/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1
HTTP/1.1 204
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /vpcs/{uuid}/ports/{port_id:\d+}/nio

View File

@ -5,11 +5,11 @@ GET /interfaces HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONTENT-LENGTH: 652
CONNECTION: keep-alive
CONTENT-LENGTH: 520
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /interfaces
[
@ -33,14 +33,14 @@ X-ROUTE: /interfaces
"id": "en1",
"name": "en1"
},
{
"id": "en2",
"name": "en2"
},
{
"id": "fw0",
"name": "fw0"
},
{
"id": "en2",
"name": "en2"
},
{
"id": "p2p0",
"name": "p2p0"
@ -48,13 +48,5 @@ X-ROUTE: /interfaces
{
"id": "bridge0",
"name": "bridge0"
},
{
"id": "vboxnet0",
"name": "vboxnet0"
},
{
"id": "vboxnet1",
"name": "vboxnet1"
}
]

View File

@ -5,11 +5,11 @@ GET /project/{uuid} HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 102
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /project/{uuid}
{

View File

@ -5,11 +5,11 @@ GET /version HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 29
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /version
{

View File

@ -5,11 +5,11 @@ GET /virtualbox/{uuid} HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 375
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /virtualbox/{uuid}
{
@ -22,6 +22,6 @@ X-ROUTE: /virtualbox/{uuid}
"linked_clone": false,
"name": "VMTEST",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "9b8874fe-919e-4a30-874b-68614da8d42f",
"uuid": "be1fa0fe-cd51-41e0-9806-2bac0f5f50ba",
"vmname": "VMTEST"
}

View File

@ -5,11 +5,11 @@ GET /vpcs/{uuid} HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 213
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /vpcs/{uuid}
{
@ -18,5 +18,5 @@ X-ROUTE: /vpcs/{uuid}
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"script_file": null,
"startup_script": null,
"uuid": "417eef12-d13b-4cb4-8a1f-1ff12963e570"
"uuid": "a474c92d-c9d2-4f53-bbe2-64493f8f07cc"
}

View File

@ -5,9 +5,9 @@ POST /project/{uuid}/close HTTP/1.1
HTTP/1.1 204
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /project/{uuid}/close

View File

@ -5,9 +5,9 @@ POST /project/{uuid}/commit HTTP/1.1
HTTP/1.1 204
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /project/{uuid}/commit

View File

@ -0,0 +1,17 @@
curl -i -X POST 'http://localhost:8000/udp' -d '{}'
POST /udp HTTP/1.1
{}
HTTP/1.1 201
CONNECTION: keep-alive
CONTENT-LENGTH: 25
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /udp
{
"udp_port": 10000
}

View File

@ -7,11 +7,11 @@ POST /version HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 29
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /version
{

View File

@ -10,11 +10,11 @@ POST /virtualbox HTTP/1.1
HTTP/1.1 201
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 369
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /virtualbox
{
@ -27,6 +27,6 @@ X-ROUTE: /virtualbox
"linked_clone": false,
"name": "VM1",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "455cc5f9-22f2-4121-973a-45d525110970",
"uuid": "8b5bbfa3-0682-4d65-ae8b-a1aea9dc40e5",
"vmname": "VM1"
}

View File

@ -10,11 +10,11 @@ POST /virtualbox/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1
HTTP/1.1 201
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /virtualbox/{uuid}/ports/{port_id:\d+}/nio
{

View File

@ -8,11 +8,11 @@ POST /vpcs HTTP/1.1
HTTP/1.1 201
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 213
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /vpcs
{
@ -21,5 +21,5 @@ X-ROUTE: /vpcs
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"script_file": null,
"startup_script": null,
"uuid": "7c5d69c1-ba5a-4c2a-b1a7-da721aa58044"
"uuid": "688ff2f8-08c5-4218-8e19-99f1ac7fc20d"
}

View File

@ -10,11 +10,11 @@ POST /vpcs/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1
HTTP/1.1 201
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /vpcs/{uuid}/ports/{port_id:\d+}/nio
{

View File

@ -7,15 +7,15 @@ PUT /project/{uuid} HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONNECTION: keep-alive
CONTENT-LENGTH: 158
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /project/{uuid}
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpivbrfsdh",
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpf9hmfoxi",
"temporary": false,
"uuid": "0442fdb6-fc77-4f1c-b996-675b98dc032e"
"uuid": "6cc80657-e8f3-445b-8c1a-e2081ac7d042"
}

View File

@ -11,3 +11,9 @@ Response status codes
**********************
- **201**: UDP port allocated
Sample session
***************
.. literalinclude:: examples/post_udp.txt

View File

@ -9,8 +9,8 @@ Start a packet capture on a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the port to start a packet capture
- **uuid**: Instance UUID
- **port_id**: ID of the port to start a packet capture
Response status codes
**********************

View File

@ -9,8 +9,8 @@ Stop a packet capture on a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the port to stop a packet capture
- **uuid**: Instance UUID
- **port_id**: ID of the port to stop a packet capture
Response status codes
**********************

View File

@ -9,8 +9,8 @@ Add a NIO to a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the port where the nio should be added
- **uuid**: Instance UUID
- **port_id**: ID of the port where the nio should be added
Response status codes
**********************
@ -31,8 +31,8 @@ Remove a NIO from a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the port from where the nio should be removed
- **uuid**: Instance UUID
- **port_id**: ID of the port from where the nio should be removed
Response status codes
**********************

View File

@ -0,0 +1,13 @@
/virtualbox/vms
---------------------------------------------
.. contents::
GET /virtualbox/vms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get all VirtualBox VMs available
Response status codes
**********************
- **200**: Success

View File

@ -9,8 +9,8 @@ Add a NIO to a VPCS instance
Parameters
**********
- **port_id**: ID of the port where the nio should be added
- **uuid**: Instance UUID
- **port_id**: ID of the port where the nio should be added
Response status codes
**********************
@ -31,8 +31,8 @@ Remove a NIO from a VPCS instance
Parameters
**********
- **port_id**: ID of the port from where the nio should be removed
- **uuid**: Instance UUID
- **port_id**: ID of the port from where the nio should be removed
Response status codes
**********************

View File

@ -17,7 +17,7 @@
def test_udp_allocation(server):
response = server.post('/udp', {})
response = server.post('/udp', {}, example=True)
assert response.status == 201
assert response.json == {'udp_port': 10000}