1
0
mirror of https://github.com/GNS3/gns3-server synced 2025-01-11 08:30:57 +00:00

Add missing documentations and add julien email to travis build

This commit is contained in:
Julien Duponchelle 2015-01-26 09:40:48 +01:00
parent 70faf76c10
commit c409819382
19 changed files with 467 additions and 6 deletions

View File

@ -20,7 +20,8 @@ script:
# - master
notifications:
email: false
email:
- julien@gns3.net
# irc:
# channels:
# - "chat.freenode.net#gns3"

View File

@ -0,0 +1,13 @@
curl -i -X DELETE 'http://localhost:8000/virtualbox/{uuid}/ports/{port_id:\d+}/nio'
DELETE /virtualbox/{uuid}/ports/{port_id:\d+}/nio HTTP/1.1
HTTP/1.1 204
CONNECTION: close
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /virtualbox/{uuid}/ports/{port_id:\d+}/nio

View File

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

View File

@ -0,0 +1,60 @@
curl -i -X GET 'http://localhost:8000/interfaces'
GET /interfaces HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONTENT-LENGTH: 652
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /interfaces
[
{
"id": "lo0",
"name": "lo0"
},
{
"id": "gif0",
"name": "gif0"
},
{
"id": "stf0",
"name": "stf0"
},
{
"id": "en0",
"name": "en0"
},
{
"id": "en1",
"name": "en1"
},
{
"id": "en2",
"name": "en2"
},
{
"id": "fw0",
"name": "fw0"
},
{
"id": "p2p0",
"name": "p2p0"
},
{
"id": "bridge0",
"name": "bridge0"
},
{
"id": "vboxnet0",
"name": "vboxnet0"
},
{
"id": "vboxnet1",
"name": "vboxnet1"
}
]

View File

@ -0,0 +1,27 @@
curl -i -X GET 'http://localhost:8000/virtualbox/{uuid}'
GET /virtualbox/{uuid} HTTP/1.1
HTTP/1.1 200
CONNECTION: close
CONTENT-LENGTH: 375
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /virtualbox/{uuid}
{
"adapter_start_index": 0,
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
"adapters": 0,
"console": 2001,
"enable_remote_console": false,
"headless": false,
"linked_clone": false,
"name": "VMTEST",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "9b8874fe-919e-4a30-874b-68614da8d42f",
"vmname": "VMTEST"
}

View File

@ -18,5 +18,5 @@ X-ROUTE: /vpcs/{uuid}
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"script_file": null,
"startup_script": null,
"uuid": "624e94fb-9e7e-45d0-a27d-4eeda19e98cd"
"uuid": "417eef12-d13b-4cb4-8a1f-1ff12963e570"
}

View File

@ -27,6 +27,6 @@ X-ROUTE: /virtualbox
"linked_clone": false,
"name": "VM1",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "bd6e0124-bb4b-4224-a71f-9a28c302df4e",
"uuid": "455cc5f9-22f2-4121-973a-45d525110970",
"vmname": "VM1"
}

View File

@ -0,0 +1,25 @@
curl -i -X POST 'http://localhost:8000/virtualbox/{uuid}/ports/{port_id:\d+}/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
POST /virtualbox/{uuid}/ports/{port_id:\d+}/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: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /virtualbox/{uuid}/ports/{port_id:\d+}/nio
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}

View File

@ -21,5 +21,5 @@ X-ROUTE: /vpcs
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"script_file": null,
"startup_script": null,
"uuid": "fc2b4d10-e4c6-4545-8b59-cd7a09bc3d33"
"uuid": "7c5d69c1-ba5a-4c2a-b1a7-da721aa58044"
}

View File

@ -0,0 +1,25 @@
curl -i -X POST 'http://localhost:8000/vpcs/{uuid}/ports/{port_id:\d+}/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
POST /vpcs/{uuid}/ports/{port_id:\d+}/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: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /vpcs/{uuid}/ports/{port_id:\d+}/nio
{
"lport": 4242,
"rhost": "127.0.0.1",
"rport": 4343,
"type": "nio_udp"
}

View File

@ -15,7 +15,7 @@ SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /project/{uuid}
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp2d1dq1sb",
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpivbrfsdh",
"temporary": false,
"uuid": "7a6d9fd4-c212-4368-950f-5513e518313a"
"uuid": "0442fdb6-fc77-4f1c-b996-675b98dc032e"
}

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

@ -0,0 +1,19 @@
/interfaces
---------------------------------------------
.. contents::
GET /interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List all the network interfaces available on the server
Response status codes
**********************
- **200**: OK
Sample session
***************
.. literalinclude:: examples/get_interfaces.txt

13
docs/api/udp.rst Normal file
View File

@ -0,0 +1,13 @@
/udp
---------------------------------------------
.. contents::
POST /udp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allocate an UDP port on the server
Response status codes
**********************
- **201**: UDP port allocated

View File

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

107
docs/api/virtualboxuuid.rst Normal file
View File

@ -0,0 +1,107 @@
/virtualbox/{uuid}
---------------------------------------------
.. contents::
GET /virtualbox/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get a VirtualBox VM instance
Parameters
**********
- **uuid**: Instance UUID
Response status codes
**********************
- **200**: Success
- **404**: Instance doesn't exist
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>adapter_start_index</td> <td> </td> <td>integer</td> <td>adapter index from which to start using adapters</td> </tr>
<tr><td>adapter_type</td> <td> </td> <td>string</td> <td>VirtualBox adapter type</td> </tr>
<tr><td>adapters</td> <td> </td> <td>integer</td> <td>number of adapters</td> </tr>
<tr><td>console</td> <td> </td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
<tr><td>linked_clone</td> <td> </td> <td>boolean</td> <td>either the VM is a linked clone or not</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
<tr><td>project_uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
</table>
Sample session
***************
.. literalinclude:: examples/get_virtualboxuuid.txt
PUT /virtualbox/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update a VirtualBox VM instance
Parameters
**********
- **uuid**: Instance UUID
Response status codes
**********************
- **200**: Instance updated
- **409**: Conflict
- **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>adapter_start_index</td> <td> </td> <td>integer</td> <td>adapter index from which to start using adapters</td> </tr>
<tr><td>adapter_type</td> <td> </td> <td>string</td> <td>VirtualBox adapter type</td> </tr>
<tr><td>adapters</td> <td> </td> <td>integer</td> <td>number of adapters</td> </tr>
<tr><td>console</td> <td> </td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
<tr><td>name</td> <td> </td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
</table>
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>adapter_start_index</td> <td> </td> <td>integer</td> <td>adapter index from which to start using adapters</td> </tr>
<tr><td>adapter_type</td> <td> </td> <td>string</td> <td>VirtualBox adapter type</td> </tr>
<tr><td>adapters</td> <td> </td> <td>integer</td> <td>number of adapters</td> </tr>
<tr><td>console</td> <td> </td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
<tr><td>linked_clone</td> <td> </td> <td>boolean</td> <td>either the VM is a linked clone or not</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
<tr><td>project_uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
</table>
DELETE /virtualbox/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Delete a VirtualBox VM instance
Parameters
**********
- **uuid**: Instance UUID
Response status codes
**********************
- **404**: Instance doesn't exist
- **204**: Instance deleted

View File

@ -0,0 +1,29 @@
/virtualbox/{uuid}/capture/{port_id:\d+}/start
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/capture/**{port_id:\d+}**/start
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start a packet capture on a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the port 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/{port_id:\d+}/stop
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/capture/**{port_id:\d+}**/stop
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stop a packet capture on a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the port 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

@ -0,0 +1,48 @@
/virtualbox/{uuid}/ports/{port_id:\d+}/nio
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/ports/**{port_id:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add a NIO to a VirtualBox VM instance
Parameters
**********
- **port_id**: ID of the 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_virtualboxuuidportsportiddnio.txt
DELETE /virtualbox/**{uuid}**/ports/**{port_id:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
Response status codes
**********************
- **400**: Invalid instance UUID
- **404**: Instance doesn't exist
- **204**: NIO deleted
Sample session
***************
.. literalinclude:: examples/delete_virtualboxuuidportsportiddnio.txt

View File

@ -0,0 +1,48 @@
/vpcs/{uuid}/ports/{port_id:\d+}/nio
---------------------------------------------
.. contents::
POST /vpcs/**{uuid}**/ports/**{port_id:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add a NIO to a VPCS instance
Parameters
**********
- **port_id**: ID of the 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_vpcsuuidportsportiddnio.txt
DELETE /vpcs/**{uuid}**/ports/**{port_id:\d+}**/nio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove a NIO from a VPCS instance
Parameters
**********
- **port_id**: ID of the 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_vpcsuuidportsportiddnio.txt