mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Better organisation of the API documentation
This commit is contained in:
parent
5170428913
commit
57348d0508
8
docs/api/dynamips_device.rst
Normal file
8
docs/api/dynamips_device.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Dynamips device
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
dynamips_device/*
|
@ -0,0 +1,43 @@
|
||||
/v1/projects/{project_id}/dynamips/devices
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/devices
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: Instance created
|
||||
- **409**: Conflict
|
||||
|
||||
Input
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>device_id</td> <td> </td> <td>string</td> <td>Dynamips device instance identifier</td> </tr>
|
||||
<tr><td>device_type</td> <td>✔</td> <td>string</td> <td>Dynamips device type</td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>Dynamips device name</td> </tr>
|
||||
</table>
|
||||
|
||||
Output
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>device_id</td> <td>✔</td> <td>string</td> <td>Dynamips router instance UUID</td> </tr>
|
||||
<tr><td>mappings</td> <td> </td> <td>object</td> <td></td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>Dynamips device instance name</td> </tr>
|
||||
<tr><td>ports</td> <td> </td> <td>array</td> <td></td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
</table>
|
||||
|
@ -0,0 +1,106 @@
|
||||
/v1/projects/{project_id}/dynamips/devices/{device_id}
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Success
|
||||
- **400**: Invalid request
|
||||
- **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>device_id</td> <td>✔</td> <td>string</td> <td>Dynamips router instance UUID</td> </tr>
|
||||
<tr><td>mappings</td> <td> </td> <td>object</td> <td></td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>Dynamips device instance name</td> </tr>
|
||||
<tr><td>ports</td> <td> </td> <td>array</td> <td></td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
</table>
|
||||
|
||||
|
||||
PUT /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Instance updated
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **409**: Conflict
|
||||
|
||||
Input
|
||||
*******
|
||||
Types
|
||||
+++++++++
|
||||
EthernetSwitchPort
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Ethernet switch port
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>port</td> <td>✔</td> <td>integer</td> <td>Port number</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: access, dot1q, qinq</td> </tr>
|
||||
<tr><td>vlan</td> <td>✔</td> <td>integer</td> <td>VLAN number</td> </tr>
|
||||
</table>
|
||||
|
||||
Body
|
||||
+++++++++
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>name</td> <td> </td> <td>string</td> <td>Dynamips device instance name</td> </tr>
|
||||
<tr><td>ports</td> <td> </td> <td>array</td> <td></td> </tr>
|
||||
</table>
|
||||
|
||||
Output
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>device_id</td> <td>✔</td> <td>string</td> <td>Dynamips router instance UUID</td> </tr>
|
||||
<tr><td>mappings</td> <td> </td> <td>object</td> <td></td> </tr>
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>Dynamips device instance name</td> </tr>
|
||||
<tr><td>ports</td> <td> </td> <td>array</td> <td></td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
</table>
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance deleted
|
||||
|
@ -0,0 +1,140 @@
|
||||
/v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:\d+}/nio
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Add a NIO to a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **port_number**: Port on the device
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: NIO created
|
||||
- **404**: Instance doesn't exist
|
||||
|
||||
Input
|
||||
*******
|
||||
Types
|
||||
+++++++++
|
||||
Ethernet
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Generic Ethernet Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>ethernet_device</td> <td>✔</td> <td>string</td> <td>Ethernet device name e.g. eth0</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_generic_ethernet</td> </tr>
|
||||
</table>
|
||||
|
||||
LinuxEthernet
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
Linux Ethernet Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>ethernet_device</td> <td>✔</td> <td>string</td> <td>Ethernet device name e.g. eth0</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_linux_ethernet</td> </tr>
|
||||
</table>
|
||||
|
||||
NULL
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
NULL Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_null</td> </tr>
|
||||
</table>
|
||||
|
||||
TAP
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
TAP Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>tap_device</td> <td>✔</td> <td>string</td> <td>TAP device name e.g. tap0</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_tap</td> </tr>
|
||||
</table>
|
||||
|
||||
UDP
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
UDP Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>lport</td> <td>✔</td> <td>integer</td> <td>Local port</td> </tr>
|
||||
<tr><td>rhost</td> <td>✔</td> <td>string</td> <td>Remote host</td> </tr>
|
||||
<tr><td>rport</td> <td>✔</td> <td>integer</td> <td>Remote port</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_udp</td> </tr>
|
||||
</table>
|
||||
|
||||
UNIX
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
UNIX Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>local_file</td> <td>✔</td> <td>string</td> <td>path to the UNIX socket file (local)</td> </tr>
|
||||
<tr><td>remote_file</td> <td>✔</td> <td>string</td> <td>path to the UNIX socket file (remote)</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_unix</td> </tr>
|
||||
</table>
|
||||
|
||||
VDE
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
VDE Network Input/Output
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>control_file</td> <td>✔</td> <td>string</td> <td>path to the VDE control file</td> </tr>
|
||||
<tr><td>local_file</td> <td>✔</td> <td>string</td> <td>path to the VDE control file</td> </tr>
|
||||
<tr><td>type</td> <td>✔</td> <td>enum</td> <td>Possible values: nio_vde</td> </tr>
|
||||
</table>
|
||||
|
||||
Body
|
||||
+++++++++
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>mappings</td> <td> </td> <td>object</td> <td></td> </tr>
|
||||
<tr><td>nio</td> <td>✔</td> <td>UDP, Ethernet, LinuxEthernet, TAP, UNIX, VDE, NULL</td> <td></td> </tr>
|
||||
<tr><td>port_settings</td> <td> </td> <td>object</td> <td>Ethernet switch</td> </tr>
|
||||
</table>
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Remove a NIO from a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **port_number**: Port on the device
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: NIO deleted
|
||||
|
@ -0,0 +1,31 @@
|
||||
/v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:\d+}/start_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**/ports/**{port_number:\d+}**/start_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a packet capture on a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **port_number**: Port on the device
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Capture started
|
||||
- **400**: Invalid request
|
||||
- **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_file_name</td> <td>✔</td> <td>string</td> <td>Capture file name</td> </tr>
|
||||
<tr><td>data_link_type</td> <td>✔</td> <td>string</td> <td>PCAP data link type</td> </tr>
|
||||
</table>
|
||||
|
@ -0,0 +1,21 @@
|
||||
/v1/projects/{project_id}/dynamips/devices/{device_id}/ports/{port_number:\d+}/stop_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/devices/**{device_id}**/ports/**{port_number:\d+}**/stop_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a packet capture on a Dynamips device instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **port_number**: Port on the device
|
||||
- **device_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Capture stopped
|
||||
|
8
docs/api/dynamips_vm.rst
Normal file
8
docs/api/dynamips_vm.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Dynamips vm
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
dynamips_vm/*
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get a Dynamips VM instance
|
||||
|
||||
Parameters
|
||||
@ -70,7 +70,7 @@ Output
|
||||
|
||||
|
||||
PUT /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a Dynamips VM instance
|
||||
|
||||
Parameters
|
||||
@ -184,7 +184,7 @@ Output
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -0,0 +1,40 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Add a NIO to a Dynamips VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter where the nio should be added
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: NIO created
|
||||
- **404**: Instance doesn't exist
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Remove a NIO from a Dynamips VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter from where the nio should be removed
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: NIO deleted
|
||||
|
@ -0,0 +1,32 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/start_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/start_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a packet capture on a Dynamips VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter to start a packet capture
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Capture started
|
||||
- **400**: Invalid request
|
||||
- **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_file_name</td> <td>✔</td> <td>string</td> <td>Capture file name</td> </tr>
|
||||
<tr><td>data_link_type</td> <td>✔</td> <td>string</td> <td>PCAP data link type</td> </tr>
|
||||
</table>
|
||||
|
@ -0,0 +1,22 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/stop_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/stop_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a packet capture on a Dynamips VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter to stop a packet capture
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter (always 0)
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Capture stopped
|
||||
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/reload
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/reload
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reload a Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/resume
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/resume
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Resume a suspended Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/start
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/start
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/stop
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/dynamips/vms/{vm_id}/suspend
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/dynamips/vms/**{vm_id}**/suspend
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Suspend a Dynamips VM instance
|
||||
|
||||
Parameters
|
@ -1,13 +0,0 @@
|
||||
curl -i -X DELETE 'http://localhost:8000/projects/{project_id}'
|
||||
|
||||
DELETE /projects/{project_id} 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: /v1/projects/{project_id}
|
||||
|
@ -1,13 +0,0 @@
|
||||
curl -i -X DELETE 'http://localhost:8000/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio'
|
||||
|
||||
DELETE /projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/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: /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
|
@ -1,13 +0,0 @@
|
||||
curl -i -X DELETE 'http://localhost:8000/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio'
|
||||
|
||||
DELETE /projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/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: /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
|
@ -1,60 +0,0 @@
|
||||
curl -i -X GET 'http://localhost:8000/interfaces'
|
||||
|
||||
GET /interfaces HTTP/1.1
|
||||
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 652
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/interfaces
|
||||
|
||||
[
|
||||
{
|
||||
"id": "lo0",
|
||||
"name": "lo0"
|
||||
},
|
||||
{
|
||||
"id": "gif0",
|
||||
"name": "gif0"
|
||||
},
|
||||
{
|
||||
"id": "stf0",
|
||||
"name": "stf0"
|
||||
},
|
||||
{
|
||||
"id": "en0",
|
||||
"name": "en0"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
@ -1,20 +0,0 @@
|
||||
curl -i -X GET 'http://localhost:8000/projects/{project_id}'
|
||||
|
||||
GET /projects/{project_id} HTTP/1.1
|
||||
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 277
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}
|
||||
|
||||
{
|
||||
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpd4_jlup7",
|
||||
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpd4_jlup7/00010203-0405-0607-0809-0a0b0c0d0e0f",
|
||||
"project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f",
|
||||
"temporary": false
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
curl -i -X GET 'http://localhost:8000/projects/{project_id}/iou/vms/{vm_id}'
|
||||
|
||||
GET /projects/{project_id}/iou/vms/{vm_id} HTTP/1.1
|
||||
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 381
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}
|
||||
|
||||
{
|
||||
"console": 2000,
|
||||
"ethernet_adapters": 2,
|
||||
"l1_keepalives": false,
|
||||
"name": "PC TEST 1",
|
||||
"nvram": 128,
|
||||
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_iou_get0/iou.bin",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"ram": 256,
|
||||
"serial_adapters": 2,
|
||||
"vm_id": "8d4ce7ee-9c5e-4ac0-9106-f8cf28a12b5d"
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
curl -i -X GET 'http://localhost:8000/projects/{project_id}/virtualbox/vms/{vm_id}'
|
||||
|
||||
GET /projects/{project_id}/virtualbox/vms/{vm_id} HTTP/1.1
|
||||
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 347
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms/{vm_id}
|
||||
|
||||
{
|
||||
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
|
||||
"adapters": 0,
|
||||
"console": 2001,
|
||||
"enable_remote_console": false,
|
||||
"headless": false,
|
||||
"name": "VMTEST",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"use_any_adapter": false,
|
||||
"vm_id": "591dcdfc-f25f-4a87-bd06-6091551c6f8e",
|
||||
"vmname": "VMTEST"
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
curl -i -X GET 'http://localhost:8000/projects/{project_id}/vpcs/vms/{vm_id}'
|
||||
|
||||
GET /projects/{project_id}/vpcs/vms/{vm_id} HTTP/1.1
|
||||
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 187
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/vpcs/vms/{vm_id}
|
||||
|
||||
{
|
||||
"console": 2009,
|
||||
"name": "PC TEST 1",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"startup_script": null,
|
||||
"vm_id": "37726103-1521-42c3-8925-fd4fabea9caf"
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
curl -i -X GET 'http://localhost:8000/version'
|
||||
|
||||
GET /version HTTP/1.1
|
||||
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 29
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/version
|
||||
|
||||
{
|
||||
"version": "1.3.dev1"
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
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: /v1/ports/udp
|
||||
|
||||
{
|
||||
"udp_port": 10000
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/close' -d '{}'
|
||||
|
||||
POST /projects/{project_id}/close 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: /v1/projects/{project_id}/close
|
||||
|
@ -1,13 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/commit' -d '{}'
|
||||
|
||||
POST /projects/{project_id}/commit 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: /v1/projects/{project_id}/commit
|
||||
|
@ -1,36 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/iou/vms' -d '{"ethernet_adapters": 0, "initial_config": "hostname test", "iourc_path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_iou_create_with_params0/iourc", "l1_keepalives": true, "name": "PC TEST 1", "nvram": 512, "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_iou_create_with_params0/iou.bin", "ram": 1024, "serial_adapters": 4}'
|
||||
|
||||
POST /projects/{project_id}/iou/vms HTTP/1.1
|
||||
{
|
||||
"ethernet_adapters": 0,
|
||||
"initial_config": "hostname test",
|
||||
"iourc_path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_iou_create_with_params0/iourc",
|
||||
"l1_keepalives": true,
|
||||
"name": "PC TEST 1",
|
||||
"nvram": 512,
|
||||
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_iou_create_with_params0/iou.bin",
|
||||
"ram": 1024,
|
||||
"serial_adapters": 4
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 396
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/iou/vms
|
||||
|
||||
{
|
||||
"console": 2000,
|
||||
"ethernet_adapters": 0,
|
||||
"l1_keepalives": true,
|
||||
"name": "PC TEST 1",
|
||||
"nvram": 512,
|
||||
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_iou_create_with_params0/iou.bin",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"ram": 1024,
|
||||
"serial_adapters": 4,
|
||||
"vm_id": "f1bafbbe-96ba-4088-83e2-391cf9477e89"
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio' -d '{"ethernet_device": "eth0", "type": "nio_generic_ethernet"}'
|
||||
|
||||
POST /projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio HTTP/1.1
|
||||
{
|
||||
"ethernet_device": "eth0",
|
||||
"type": "nio_generic_ethernet"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 69
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
|
||||
{
|
||||
"ethernet_device": "eth0",
|
||||
"type": "nio_generic_ethernet"
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/virtualbox/vms' -d '{"linked_clone": false, "name": "VM1", "vmname": "VM1"}'
|
||||
|
||||
POST /projects/{project_id}/virtualbox/vms HTTP/1.1
|
||||
{
|
||||
"linked_clone": false,
|
||||
"name": "VM1",
|
||||
"vmname": "VM1"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 341
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/virtualbox/vms
|
||||
|
||||
{
|
||||
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
|
||||
"adapters": 0,
|
||||
"console": 2000,
|
||||
"enable_remote_console": false,
|
||||
"headless": false,
|
||||
"name": "VM1",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"use_any_adapter": false,
|
||||
"vm_id": "be653307-d7d6-4884-932f-0d87c7e2c06b",
|
||||
"vmname": "VM1"
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/vpcs/vms' -d '{"name": "PC TEST 1"}'
|
||||
|
||||
POST /projects/{project_id}/vpcs/vms HTTP/1.1
|
||||
{
|
||||
"name": "PC TEST 1"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 201
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 187
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}/vpcs/vms
|
||||
|
||||
{
|
||||
"console": 2009,
|
||||
"name": "PC TEST 1",
|
||||
"project_id": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
|
||||
"startup_script": null,
|
||||
"vm_id": "154fff9a-bd47-4740-8a00-847ec30dd6e0"
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio' -d '{"lport": 4242, "rhost": "127.0.0.1", "rport": 4343, "type": "nio_udp"}'
|
||||
|
||||
POST /projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/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: /v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
|
||||
{
|
||||
"lport": 4242,
|
||||
"rhost": "127.0.0.1",
|
||||
"rport": 4343,
|
||||
"type": "nio_udp"
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
curl -i -X POST 'http://localhost:8000/version' -d '{"version": "1.3.dev1"}'
|
||||
|
||||
POST /version HTTP/1.1
|
||||
{
|
||||
"version": "1.3.dev1"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 200
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 29
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/version
|
||||
|
||||
{
|
||||
"version": "1.3.dev1"
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
curl -i -X PUT 'http://localhost:8000/projects/{project_id}' -d '{"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_update_path_project_non_l0"}'
|
||||
|
||||
PUT /projects/{project_id} HTTP/1.1
|
||||
{
|
||||
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-2628/test_update_path_project_non_l0"
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 403
|
||||
CONNECTION: keep-alive
|
||||
CONTENT-LENGTH: 100
|
||||
CONTENT-TYPE: application/json
|
||||
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||
SERVER: Python/3.4 GNS3/1.3.dev1
|
||||
X-ROUTE: /v1/projects/{project_id}
|
||||
|
||||
{
|
||||
"message": "You are not allowed to modify the project directory location",
|
||||
"status": 403
|
||||
}
|
8
docs/api/iou.rst
Normal file
8
docs/api/iou.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Iou
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
iou/*
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/iou/vms
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new IOU instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/projects/**{project_id}**/iou/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get a IOU instance
|
||||
|
||||
Parameters
|
||||
@ -38,7 +38,7 @@ Output
|
||||
|
||||
|
||||
PUT /v1/projects/**{project_id}**/iou/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a IOU instance
|
||||
|
||||
Parameters
|
||||
@ -91,7 +91,7 @@ Output
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/iou/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a IOU instance
|
||||
|
||||
Parameters
|
@ -1,18 +1,18 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Add a NIO to a IOU instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Network adapter where the nio is located
|
||||
- **vm_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
- **port_number**: Port where the nio should be added
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
@ -22,15 +22,15 @@ Response status codes
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Remove a NIO from a IOU instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Network adapter where the nio is located
|
||||
- **vm_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
- **port_number**: Port from where the nio should be removed
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
@ -0,0 +1,32 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/start_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/start_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a packet capture on a IOU VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter to start a packet capture
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Capture started
|
||||
- **400**: Invalid request
|
||||
- **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_file_name</td> <td>✔</td> <td>string</td> <td>Capture file name</td> </tr>
|
||||
<tr><td>data_link_type</td> <td>✔</td> <td>string</td> <td>PCAP data link type</td> </tr>
|
||||
</table>
|
||||
|
@ -0,0 +1,22 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/stop_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/stop_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a packet capture on a IOU VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter to stop a packet capture
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter (always 0)
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Capture stopped
|
||||
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}/reload
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/reload
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reload a IOU instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}/start
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/start
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a IOU instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/iou/vms/{vm_id}/stop
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/iou/vms/**{vm_id}**/stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a IOU instance
|
||||
|
||||
Parameters
|
8
docs/api/network.rst
Normal file
8
docs/api/network.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Network
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
network/*
|
@ -1,10 +1,10 @@
|
||||
/v1/interfaces
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/interfaces
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
List all the network interfaces available on the server
|
||||
|
||||
Response status codes
|
@ -1,10 +1,10 @@
|
||||
/v1/ports/udp
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/ports/udp
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Allocate an UDP port on the server
|
||||
|
||||
Response status codes
|
8
docs/api/project.rst
Normal file
8
docs/api/project.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Project
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
project/*
|
@ -1,10 +1,10 @@
|
||||
/v1/projects
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new project on the server
|
||||
|
||||
Response status codes
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/projects/**{project_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get project information
|
||||
|
||||
Parameters
|
||||
@ -30,7 +30,7 @@ Output
|
||||
|
||||
|
||||
PUT /v1/projects/**{project_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a project
|
||||
|
||||
Parameters
|
||||
@ -67,7 +67,7 @@ Output
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a project from disk
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/close
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/close
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Close a project
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/commit
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/commit
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Write changes on disk
|
||||
|
||||
Parameters
|
8
docs/api/version.rst
Normal file
8
docs/api/version.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Version
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
version/*
|
@ -1,10 +1,10 @@
|
||||
/v1/version
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/version
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Retrieve the server version number
|
||||
|
||||
Response status codes
|
||||
@ -22,7 +22,7 @@ Output
|
||||
|
||||
|
||||
POST /v1/version
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Check if version is the same as the server
|
||||
|
||||
Response status codes
|
8
docs/api/virtualbox.rst
Normal file
8
docs/api/virtualbox.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Virtualbox
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
virtualbox/*
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
@ -38,7 +38,7 @@ Output
|
||||
|
||||
|
||||
PUT /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
@ -89,7 +89,7 @@ Output
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -0,0 +1,40 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Add a NIO to a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter where the nio should be added
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter (always 0)
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: NIO created
|
||||
- **404**: Instance doesn't exist
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Remove a NIO from a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter from where the nio should be removed
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter (always)
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: NIO deleted
|
||||
|
@ -0,0 +1,31 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/start_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/start_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a packet capture on a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter to start a packet capture
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter (always 0)
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Capture started
|
||||
- **400**: Invalid request
|
||||
- **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_file_name</td> <td>✔</td> <td>string</td> <td>Capture file name</td> </tr>
|
||||
</table>
|
||||
|
@ -0,0 +1,22 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/stop_capture
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/stop_capture
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a packet capture on a VirtualBox VM instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Adapter to stop a packet capture
|
||||
- **vm_id**: UUID for the instance
|
||||
- **port_number**: Port on the adapter (always 0)
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Capture stopped
|
||||
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/reload
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/reload
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reload a VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/resume
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/resume
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Resume a suspended VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/start
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/start
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/stop
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/virtualbox/vms/{vm_id}/suspend
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/virtualbox/vms/**{vm_id}**/suspend
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Suspend a VirtualBox VM instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/virtualbox/vms
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/virtualbox/vms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get all VirtualBox VMs available
|
||||
|
||||
Response status codes
|
8
docs/api/vpcs.rst
Normal file
8
docs/api/vpcs.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Vpcs
|
||||
---------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
vpcs/*
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/vpcs/vms
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/vpcs/vms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new VPCS instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/vpcs/vms/{vm_id}
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get a VPCS instance
|
||||
|
||||
Parameters
|
||||
@ -33,7 +33,7 @@ Output
|
||||
|
||||
|
||||
PUT /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a VPCS instance
|
||||
|
||||
Parameters
|
||||
@ -74,7 +74,7 @@ Output
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a VPCS instance
|
||||
|
||||
Parameters
|
@ -1,18 +1,18 @@
|
||||
/v1/projects/{project_id}/vpcs/vms/{vm_id}/adapters/{adapter_number:\d+}/ports/{port_number:\d+}/nio
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Add a NIO to a VPCS instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Network adapter where the nio is located
|
||||
- **vm_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
- **port_number**: Port where the nio should be added
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
@ -22,15 +22,15 @@ Response status codes
|
||||
|
||||
|
||||
DELETE /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Remove a NIO from a VPCS instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **adapter_number**: Network adapter where the nio is located
|
||||
- **vm_id**: UUID for the instance
|
||||
- **project_id**: UUID for the project
|
||||
- **port_number**: Port from where the nio should be removed
|
||||
- **project_id**: UUID for the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/vpcs/vms/{vm_id}/reload
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**/reload
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reload a VPCS instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/vpcs/vms/{vm_id}/start
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**/start
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start a VPCS instance
|
||||
|
||||
Parameters
|
@ -1,10 +1,10 @@
|
||||
/v1/projects/{project_id}/vpcs/vms/{vm_id}/stop
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v1/projects/**{project_id}**/vpcs/vms/**{vm_id}**/stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Stop a VPCS instance
|
||||
|
||||
Parameters
|
@ -17,6 +17,7 @@
|
||||
|
||||
import re
|
||||
import os.path
|
||||
import os
|
||||
|
||||
from gns3server.handlers import *
|
||||
from gns3server.web.route import Route
|
||||
@ -30,40 +31,55 @@ class Documentation(object):
|
||||
self._documentation = route.get_documentation()
|
||||
|
||||
def write(self):
|
||||
for path in sorted(self._documentation):
|
||||
filename = self._file_path(path)
|
||||
handler_doc = self._documentation[path]
|
||||
with open("docs/api/{}.rst".format(filename), 'w+') as f:
|
||||
f.write('{}\n-----------------------------------------------------------------------------------------------------------------\n\n'.format(path))
|
||||
f.write('.. contents::\n')
|
||||
for method in handler_doc["methods"]:
|
||||
f.write('\n{} {}\n'.format(method["method"], path.replace("{", '**{').replace("}", "}**")))
|
||||
f.write('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
|
||||
f.write('{}\n\n'.format(method["description"]))
|
||||
for handler_name in sorted(self._documentation):
|
||||
|
||||
if len(method["parameters"]) > 0:
|
||||
f.write("Parameters\n**********\n")
|
||||
for parameter in method["parameters"]:
|
||||
desc = method["parameters"][parameter]
|
||||
f.write("- **{}**: {}\n".format(parameter, desc))
|
||||
self._create_handler_directory(handler_name)
|
||||
|
||||
for path in sorted(self._documentation[handler_name]):
|
||||
filename = self._file_path(path)
|
||||
handler_doc = self._documentation[handler_name][path]
|
||||
with open("docs/api/{}/{}.rst".format(handler_name, filename), 'w+') as f:
|
||||
f.write('{}\n----------------------------------------------------------------------------------------------------------------------\n\n'.format(path))
|
||||
f.write('.. contents::\n')
|
||||
for method in handler_doc["methods"]:
|
||||
f.write('\n{} {}\n'.format(method["method"], path.replace("{", '**{').replace("}", "}**")))
|
||||
f.write('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
|
||||
f.write('{}\n\n'.format(method["description"]))
|
||||
|
||||
if len(method["parameters"]) > 0:
|
||||
f.write("Parameters\n**********\n")
|
||||
for parameter in method["parameters"]:
|
||||
desc = method["parameters"][parameter]
|
||||
f.write("- **{}**: {}\n".format(parameter, desc))
|
||||
f.write("\n")
|
||||
|
||||
f.write("Response status codes\n**********************\n")
|
||||
for code in method["status_codes"]:
|
||||
desc = method["status_codes"][code]
|
||||
f.write("- **{}**: {}\n".format(code, desc))
|
||||
f.write("\n")
|
||||
|
||||
f.write("Response status codes\n**********************\n")
|
||||
for code in method["status_codes"]:
|
||||
desc = method["status_codes"][code]
|
||||
f.write("- **{}**: {}\n".format(code, desc))
|
||||
f.write("\n")
|
||||
if "properties" in method["input_schema"]:
|
||||
f.write("Input\n*******\n")
|
||||
self._write_definitions(f, method["input_schema"])
|
||||
self._write_json_schema(f, method["input_schema"])
|
||||
|
||||
if "properties" in method["input_schema"]:
|
||||
f.write("Input\n*******\n")
|
||||
self._write_definitions(f, method["input_schema"])
|
||||
self._write_json_schema(f, method["input_schema"])
|
||||
if "properties" in method["output_schema"]:
|
||||
f.write("Output\n*******\n")
|
||||
self._write_json_schema(f, method["output_schema"])
|
||||
|
||||
if "properties" in method["output_schema"]:
|
||||
f.write("Output\n*******\n")
|
||||
self._write_json_schema(f, method["output_schema"])
|
||||
self._include_query_example(f, method, path)
|
||||
|
||||
self._include_query_example(f, method, path)
|
||||
def _create_handler_directory(self, handler_name):
|
||||
"""Create a directory for the handler and add an index inside"""
|
||||
|
||||
directory = "docs/api/{}".format(handler_name)
|
||||
os.makedirs(directory, exist_ok=True)
|
||||
|
||||
with open("docs/api/{}.rst".format(handler_name), "w+") as f:
|
||||
f.write(handler_name.replace("_", " ", ).capitalize())
|
||||
f.write("\n---------------------\n\n")
|
||||
f.write(".. toctree::\n :glob:\n :maxdepth: 2\n\n {}/*\n".format(handler_name))
|
||||
|
||||
def _include_query_example(self, f, method, path):
|
||||
"""If a sample session is available we include it in documentation"""
|
||||
@ -81,7 +97,7 @@ class Documentation(object):
|
||||
f.write("Types\n+++++++++\n")
|
||||
for definition in sorted(schema['definitions']):
|
||||
desc = schema['definitions'][definition].get("description")
|
||||
f.write("{}\n^^^^^^^^^^^^^^^^\n{}\n\n".format(definition, desc))
|
||||
f.write("{}\n^^^^^^^^^^^^^^^^^^^^^^\n{}\n\n".format(definition, desc))
|
||||
self._write_json_schema(f, schema['definitions'][definition])
|
||||
f.write("Body\n+++++++++\n")
|
||||
|
||||
|
@ -83,18 +83,21 @@ class Route(object):
|
||||
input_schema = kw.get("input", {})
|
||||
api_version = kw.get("version", 1)
|
||||
cls._path = "/v{version}{path}".format(path=path, version=api_version)
|
||||
cls._documentation.setdefault(cls._path, {"methods": []})
|
||||
|
||||
def register(func):
|
||||
route = cls._path
|
||||
|
||||
cls._documentation[route]["methods"].append({
|
||||
handler = func.__module__.replace("_handler", "").replace("gns3server.handlers.", "")
|
||||
cls._documentation.setdefault(handler, {})
|
||||
cls._documentation[handler].setdefault(route, {"methods": []})
|
||||
|
||||
cls._documentation[handler][route]["methods"].append({
|
||||
"method": method,
|
||||
"status_codes": kw.get("status_codes", {200: "OK"}),
|
||||
"parameters": kw.get("parameters", {}),
|
||||
"output_schema": output_schema,
|
||||
"input_schema": input_schema,
|
||||
"description": kw.get("description", "")
|
||||
"description": kw.get("description", ""),
|
||||
})
|
||||
func = asyncio.coroutine(func)
|
||||
|
||||
|
@ -28,7 +28,7 @@ export PYTEST_BUILD_DOCUMENTATION=1
|
||||
rm -Rf docs/api/
|
||||
mkdir -p docs/api/examples
|
||||
|
||||
py.test -v
|
||||
#py.test -v
|
||||
python3 gns3server/web/documentation.py
|
||||
cd docs
|
||||
make html
|
||||
|
@ -260,21 +260,21 @@ def test_enable_l1_keepalives(loop, vm):
|
||||
assert command == ["test"]
|
||||
|
||||
|
||||
def test_start_capture(vm, tmpdir, manager, free_console_port):
|
||||
def test_start_capture(vm, tmpdir, manager, free_console_port, loop):
|
||||
|
||||
output_file = str(tmpdir / "test.pcap")
|
||||
nio = manager.create_nio(vm.iouyap_path, {"type": "nio_udp", "lport": free_console_port, "rport": free_console_port, "rhost": "192.168.1.2"})
|
||||
vm.adapter_add_nio_binding(0, 0, nio)
|
||||
vm.start_capture(0, 0, output_file)
|
||||
loop.run_until_complete(asyncio.async(vm.start_capture(0, 0, output_file)))
|
||||
assert vm._adapters[0].get_nio(0).capturing
|
||||
|
||||
|
||||
def test_stop_capture(vm, tmpdir, manager, free_console_port):
|
||||
def test_stop_capture(vm, tmpdir, manager, free_console_port, loop):
|
||||
|
||||
output_file = str(tmpdir / "test.pcap")
|
||||
nio = manager.create_nio(vm.iouyap_path, {"type": "nio_udp", "lport": free_console_port, "rport": free_console_port, "rhost": "192.168.1.2"})
|
||||
vm.adapter_add_nio_binding(0, 0, nio)
|
||||
vm.start_capture(0, 0, output_file)
|
||||
loop.run_until_complete(vm.start_capture(0, 0, output_file))
|
||||
assert vm._adapters[0].get_nio(0).capturing
|
||||
vm.stop_capture(0, 0)
|
||||
loop.run_until_complete(asyncio.async(vm.stop_capture(0, 0)))
|
||||
assert vm._adapters[0].get_nio(0).capturing == False
|
||||
|
Loading…
Reference in New Issue
Block a user