Update documentation

This commit is contained in:
Julien Duponchelle 2015-02-03 21:27:15 +01:00
parent f572f3fc95
commit a12f753136
25 changed files with 320 additions and 45 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

@ -0,0 +1,13 @@
curl -i -X DELETE 'http://localhost:8000/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio'
DELETE /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio HTTP/1.1
HTTP/1.1 204
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio

View File

@ -0,0 +1,13 @@
curl -i -X DELETE 'http://localhost:8000/vpcs/{uuid}/ports/{port_number:\d+}/nio'
DELETE /vpcs/{uuid}/ports/{port_number:\d+}/nio HTTP/1.1
HTTP/1.1 204
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /vpcs/{uuid}/ports/{port_number:\d+}/nio

View File

@ -5,36 +5,56 @@ GET /interfaces HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONTENT-LENGTH: 364
CONNECTION: keep-alive
CONTENT-LENGTH: 652
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
[
{
"id": "lo",
"name": "lo"
"id": "lo0",
"name": "lo0"
},
{
"id": "eth0",
"name": "eth0"
"id": "gif0",
"name": "gif0"
},
{
"id": "wlan0",
"name": "wlan0"
"id": "stf0",
"name": "stf0"
},
{
"id": "vmnet1",
"name": "vmnet1"
"id": "en0",
"name": "en0"
},
{
"id": "vmnet8",
"name": "vmnet8"
"id": "en1",
"name": "en1"
},
{
"id": "fw0",
"name": "fw0"
},
{
"id": "en2",
"name": "en2"
},
{
"id": "p2p0",
"name": "p2p0"
},
{
"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: 348
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}
{
@ -21,6 +21,6 @@ X-ROUTE: /virtualbox/{uuid}
"headless": false,
"name": "VMTEST",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "0d15855e-8fb4-41af-81b0-a150c7576d5a",
"uuid": "c6b74706-54b6-405d-8aea-9c48a94987e8",
"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": "2ddb0fa3-1010-4f48-b295-caa1c414b4a2"
"uuid": "aceec3c0-f02d-44ee-88a6-85c3120c22ca"
}

View File

@ -0,0 +1,17 @@
curl -i -X POST 'http://localhost:8000/ports/udp' -d '{}'
POST /ports/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: /ports/udp
{
"udp_port": 10000
}

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

@ -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: 342
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
{
@ -26,6 +26,6 @@ X-ROUTE: /virtualbox
"headless": false,
"name": "VM1",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "33217631-7c24-4acf-b462-c40e0012537a",
"uuid": "7ba9ddf4-0a6a-48a0-8483-3450a9f305df",
"vmname": "VM1"
}

View File

@ -0,0 +1,25 @@
curl -i -X POST 'http://localhost:8000/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
POST /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio HTTP/1.1
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}
HTTP/1.1 201
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}

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": "b0ed8aae-4d50-4a0c-9d91-0875a5aca533"
"uuid": "896e7bbd-936c-4a6f-9268-c89f8eb91f5e"
}

View File

@ -0,0 +1,25 @@
curl -i -X POST 'http://localhost:8000/vpcs/{uuid}/ports/{port_number:\d+}/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
POST /vpcs/{uuid}/ports/{port_number:\d+}/nio HTTP/1.1
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}
HTTP/1.1 201
CONNECTION: keep-alive
CONTENT-LENGTH: 89
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /vpcs/{uuid}/ports/{port_number:\d+}/nio
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}

View File

@ -7,15 +7,15 @@ PUT /project/{uuid} HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONTENT-LENGTH: 114
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": "/tmp/tmpi95b_dec",
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmphb8dmyls",
"temporary": false,
"uuid": "e30bf585-b257-4e14-8f7f-a5e0bdd126dd"
"uuid": "1aa054dd-e672-4961-90c3-fef730fc6301"
}

19
docs/api/portsudp.rst Normal file
View File

@ -0,0 +1,19 @@
/ports/udp
---------------------------------------------
.. contents::
POST /ports/udp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allocate an UDP port on the server
Response status codes
**********************
- **201**: UDP port allocated
Sample session
***************
.. literalinclude:: examples/post_portsudp.txt

View File

@ -19,7 +19,7 @@ Input
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>location</td> <td> </td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr>
<tr><td>temporary</td> <td> </td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
<tr><td>uuid</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>uuid</td> <td> </td> <td>['string', 'null']</td> <td>Project UUID</td> </tr>
</table>
Output

View File

@ -0,0 +1,48 @@
/virtualbox/{uuid}/adapters/{adapter_id:\d+}/nio
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/adapters/**{adapter_id:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add a NIO to a VirtualBox VM instance
Parameters
**********
- **adapter_id**: Adapter where the nio should be added
- **uuid**: Instance UUID
Response status codes
**********************
- **400**: Invalid instance UUID
- **201**: NIO created
- **404**: Instance doesn't exist
Sample session
***************
.. literalinclude:: examples/post_virtualboxuuidadaptersadapteriddnio.txt
DELETE /virtualbox/**{uuid}**/adapters/**{adapter_id:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove a NIO from a VirtualBox VM instance
Parameters
**********
- **adapter_id**: Adapter from where the nio should be removed
- **uuid**: Instance UUID
Response status codes
**********************
- **400**: Invalid instance UUID
- **404**: Instance doesn't exist
- **204**: NIO deleted
Sample session
***************
.. literalinclude:: examples/delete_virtualboxuuidadaptersadapteriddnio.txt

View File

@ -0,0 +1,29 @@
/virtualbox/{uuid}/capture/{adapter_id:\d+}/start
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/capture/**{adapter_id:\d+}**/start
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start a packet capture on a VirtualBox VM instance
Parameters
**********
- **adapter_id**: Adapter to start a packet capture
- **uuid**: Instance UUID
Response status codes
**********************
- **200**: Capture started
- **400**: Invalid instance UUID
- **404**: Instance doesn't exist
Input
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>capture_filename</td> <td>&#10004;</td> <td>string</td> <td>Capture file name</td> </tr>
</table>

View File

@ -0,0 +1,20 @@
/virtualbox/{uuid}/capture/{adapter_id:\d+}/stop
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/capture/**{adapter_id:\d+}**/stop
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stop a packet capture on a VirtualBox VM instance
Parameters
**********
- **adapter_id**: Adapter to stop a packet capture
- **uuid**: Instance UUID
Response status codes
**********************
- **400**: Invalid instance UUID
- **404**: Instance doesn't exist
- **204**: Capture stopped

View File

@ -22,7 +22,6 @@ Input
<tr><td>console</td> <td> </td> <td>['integer', 'null']</td> <td>console TCP port</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VPCS device name</td> </tr>
<tr><td>project_uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>script_file</td> <td> </td> <td>['string', 'null']</td> <td>VPCS startup script</td> </tr>
<tr><td>startup_script</td> <td> </td> <td>['string', 'null']</td> <td>Content of the VPCS startup script</td> </tr>
<tr><td>uuid</td> <td> </td> <td>string</td> <td>VPCS device UUID</td> </tr>
<tr><td>vpcs_id</td> <td> </td> <td>integer</td> <td>VPCS device instance ID (for project created before GNS3 1.3)</td> </tr>

View File

@ -59,7 +59,6 @@ Input
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>console</td> <td> </td> <td>['integer', 'null']</td> <td>console TCP port</td> </tr>
<tr><td>name</td> <td> </td> <td>['string', 'null']</td> <td>VPCS device name</td> </tr>
<tr><td>script_file</td> <td> </td> <td>['string', 'null']</td> <td>VPCS startup script</td> </tr>
<tr><td>startup_script</td> <td> </td> <td>['string', 'null']</td> <td>Content of the VPCS startup script</td> </tr>
</table>

View File

@ -0,0 +1,48 @@
/vpcs/{uuid}/ports/{port_number:\d+}/nio
---------------------------------------------
.. contents::
POST /vpcs/**{uuid}**/ports/**{port_number:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add a NIO to a VPCS instance
Parameters
**********
- **port_number**: Port where the nio should be added
- **uuid**: Instance UUID
Response status codes
**********************
- **400**: Invalid instance UUID
- **201**: NIO created
- **404**: Instance doesn't exist
Sample session
***************
.. literalinclude:: examples/post_vpcsuuidportsportnumberdnio.txt
DELETE /vpcs/**{uuid}**/ports/**{port_number:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove a NIO from a VPCS instance
Parameters
**********
- **port_number**: Port from where the nio should be removed
- **uuid**: Instance UUID
Response status codes
**********************
- **400**: Invalid instance UUID
- **404**: Instance doesn't exist
- **204**: NIO deleted
Sample session
***************
.. literalinclude:: examples/delete_vpcsuuidportsportnumberdnio.txt