From c40981938274bed16d96a5a3da226a06410d3019 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 26 Jan 2015 09:40:48 +0100 Subject: [PATCH] Add missing documentations and add julien email to travis build --- .travis.yml | 3 +- .../delete_virtualboxuuidportsportiddnio.txt | 13 +++ .../delete_vpcsuuidportsportiddnio.txt | 13 +++ docs/api/examples/get_interfaces.txt | 60 ++++++++++ docs/api/examples/get_virtualboxuuid.txt | 27 +++++ docs/api/examples/get_vpcsuuid.txt | 2 +- docs/api/examples/post_virtualbox.txt | 2 +- .../post_virtualboxuuidportsportiddnio.txt | 25 ++++ docs/api/examples/post_vpcs.txt | 2 +- .../examples/post_vpcsuuidportsportiddnio.txt | 25 ++++ docs/api/examples/put_projectuuid.txt | 4 +- docs/api/interfaces.rst | 19 ++++ docs/api/udp.rst | 13 +++ docs/api/virtualboxlist.rst | 13 +++ docs/api/virtualboxuuid.rst | 107 ++++++++++++++++++ .../api/virtualboxuuidcaptureportiddstart.rst | 29 +++++ docs/api/virtualboxuuidcaptureportiddstop.rst | 20 ++++ docs/api/virtualboxuuidportsportiddnio.rst | 48 ++++++++ docs/api/vpcsuuidportsportiddnio.rst | 48 ++++++++ 19 files changed, 467 insertions(+), 6 deletions(-) create mode 100644 docs/api/examples/delete_virtualboxuuidportsportiddnio.txt create mode 100644 docs/api/examples/delete_vpcsuuidportsportiddnio.txt create mode 100644 docs/api/examples/get_interfaces.txt create mode 100644 docs/api/examples/get_virtualboxuuid.txt create mode 100644 docs/api/examples/post_virtualboxuuidportsportiddnio.txt create mode 100644 docs/api/examples/post_vpcsuuidportsportiddnio.txt create mode 100644 docs/api/interfaces.rst create mode 100644 docs/api/udp.rst create mode 100644 docs/api/virtualboxlist.rst create mode 100644 docs/api/virtualboxuuid.rst create mode 100644 docs/api/virtualboxuuidcaptureportiddstart.rst create mode 100644 docs/api/virtualboxuuidcaptureportiddstop.rst create mode 100644 docs/api/virtualboxuuidportsportiddnio.rst create mode 100644 docs/api/vpcsuuidportsportiddnio.rst diff --git a/.travis.yml b/.travis.yml index 2c741583..1649f84b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ script: # - master notifications: - email: false + email: + - julien@gns3.net # irc: # channels: # - "chat.freenode.net#gns3" diff --git a/docs/api/examples/delete_virtualboxuuidportsportiddnio.txt b/docs/api/examples/delete_virtualboxuuidportsportiddnio.txt new file mode 100644 index 00000000..17a9dc1c --- /dev/null +++ b/docs/api/examples/delete_virtualboxuuidportsportiddnio.txt @@ -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 + diff --git a/docs/api/examples/delete_vpcsuuidportsportiddnio.txt b/docs/api/examples/delete_vpcsuuidportsportiddnio.txt new file mode 100644 index 00000000..9d2ac73f --- /dev/null +++ b/docs/api/examples/delete_vpcsuuidportsportiddnio.txt @@ -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 + diff --git a/docs/api/examples/get_interfaces.txt b/docs/api/examples/get_interfaces.txt new file mode 100644 index 00000000..1063f948 --- /dev/null +++ b/docs/api/examples/get_interfaces.txt @@ -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" + } +] diff --git a/docs/api/examples/get_virtualboxuuid.txt b/docs/api/examples/get_virtualboxuuid.txt new file mode 100644 index 00000000..27839d2c --- /dev/null +++ b/docs/api/examples/get_virtualboxuuid.txt @@ -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" +} diff --git a/docs/api/examples/get_vpcsuuid.txt b/docs/api/examples/get_vpcsuuid.txt index 64beb7dd..08e28bb7 100644 --- a/docs/api/examples/get_vpcsuuid.txt +++ b/docs/api/examples/get_vpcsuuid.txt @@ -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" } diff --git a/docs/api/examples/post_virtualbox.txt b/docs/api/examples/post_virtualbox.txt index 7142eb82..89badb75 100644 --- a/docs/api/examples/post_virtualbox.txt +++ b/docs/api/examples/post_virtualbox.txt @@ -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" } diff --git a/docs/api/examples/post_virtualboxuuidportsportiddnio.txt b/docs/api/examples/post_virtualboxuuidportsportiddnio.txt new file mode 100644 index 00000000..a7cffb9c --- /dev/null +++ b/docs/api/examples/post_virtualboxuuidportsportiddnio.txt @@ -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" +} diff --git a/docs/api/examples/post_vpcs.txt b/docs/api/examples/post_vpcs.txt index 9e657633..af3ed908 100644 --- a/docs/api/examples/post_vpcs.txt +++ b/docs/api/examples/post_vpcs.txt @@ -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" } diff --git a/docs/api/examples/post_vpcsuuidportsportiddnio.txt b/docs/api/examples/post_vpcsuuidportsportiddnio.txt new file mode 100644 index 00000000..09a955a5 --- /dev/null +++ b/docs/api/examples/post_vpcsuuidportsportiddnio.txt @@ -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" +} diff --git a/docs/api/examples/put_projectuuid.txt b/docs/api/examples/put_projectuuid.txt index 2b1f5409..a1baf6c8 100644 --- a/docs/api/examples/put_projectuuid.txt +++ b/docs/api/examples/put_projectuuid.txt @@ -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" } diff --git a/docs/api/interfaces.rst b/docs/api/interfaces.rst new file mode 100644 index 00000000..946e4c15 --- /dev/null +++ b/docs/api/interfaces.rst @@ -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 + diff --git a/docs/api/udp.rst b/docs/api/udp.rst new file mode 100644 index 00000000..f2cdb2ae --- /dev/null +++ b/docs/api/udp.rst @@ -0,0 +1,13 @@ +/udp +--------------------------------------------- + +.. contents:: + +POST /udp +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Allocate an UDP port on the server + +Response status codes +********************** +- **201**: UDP port allocated + diff --git a/docs/api/virtualboxlist.rst b/docs/api/virtualboxlist.rst new file mode 100644 index 00000000..f6944d15 --- /dev/null +++ b/docs/api/virtualboxlist.rst @@ -0,0 +1,13 @@ +/virtualbox/list +--------------------------------------------- + +.. contents:: + +GET /virtualbox/list +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Get all VirtualBox VMs available + +Response status codes +********************** +- **200**: Success + diff --git a/docs/api/virtualboxuuid.rst b/docs/api/virtualboxuuid.rst new file mode 100644 index 00000000..c744a107 --- /dev/null +++ b/docs/api/virtualboxuuid.rst @@ -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 + + + + + + + + + + + + + + +
Name Mandatory Type Description
adapter_start_index integer adapter index from which to start using adapters
adapter_type string VirtualBox adapter type
adapters integer number of adapters
console integer console TCP port
enable_remote_console boolean enable the remote console
headless boolean headless mode
linked_clone boolean either the VM is a linked clone or not
name string VirtualBox VM instance name
project_uuid string Project UUID
uuid string VirtualBox VM instance UUID
vmname string VirtualBox VM name (in VirtualBox itself)
+ +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 + + + + + + + + + + + +
Name Mandatory Type Description
adapter_start_index integer adapter index from which to start using adapters
adapter_type string VirtualBox adapter type
adapters integer number of adapters
console integer console TCP port
enable_remote_console boolean enable the remote console
headless boolean headless mode
name string VirtualBox VM instance name
vmname string VirtualBox VM name (in VirtualBox itself)
+ +Output +******* +.. raw:: html + + + + + + + + + + + + + + +
Name Mandatory Type Description
adapter_start_index integer adapter index from which to start using adapters
adapter_type string VirtualBox adapter type
adapters integer number of adapters
console integer console TCP port
enable_remote_console boolean enable the remote console
headless boolean headless mode
linked_clone boolean either the VM is a linked clone or not
name string VirtualBox VM instance name
project_uuid string Project UUID
uuid string VirtualBox VM instance UUID
vmname string VirtualBox VM name (in VirtualBox itself)
+ + +DELETE /virtualbox/**{uuid}** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Delete a VirtualBox VM instance + +Parameters +********** +- **uuid**: Instance UUID + +Response status codes +********************** +- **404**: Instance doesn't exist +- **204**: Instance deleted + diff --git a/docs/api/virtualboxuuidcaptureportiddstart.rst b/docs/api/virtualboxuuidcaptureportiddstart.rst new file mode 100644 index 00000000..b6a61ca0 --- /dev/null +++ b/docs/api/virtualboxuuidcaptureportiddstart.rst @@ -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 + + + + +
Name Mandatory Type Description
capture_filename string Capture file name
+ diff --git a/docs/api/virtualboxuuidcaptureportiddstop.rst b/docs/api/virtualboxuuidcaptureportiddstop.rst new file mode 100644 index 00000000..c336bf6c --- /dev/null +++ b/docs/api/virtualboxuuidcaptureportiddstop.rst @@ -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 + diff --git a/docs/api/virtualboxuuidportsportiddnio.rst b/docs/api/virtualboxuuidportsportiddnio.rst new file mode 100644 index 00000000..817dc47a --- /dev/null +++ b/docs/api/virtualboxuuidportsportiddnio.rst @@ -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 + diff --git a/docs/api/vpcsuuidportsportiddnio.rst b/docs/api/vpcsuuidportsportiddnio.rst new file mode 100644 index 00000000..a3075cd0 --- /dev/null +++ b/docs/api/vpcsuuidportsportiddnio.rst @@ -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 +