mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-22 16:59:02 +00:00
Update API documentation. Fixes #1253.
This commit is contained in:
@ -13,8 +13,8 @@ Parameters
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **201**: Instance created
|
||||
- **400**: Invalid request
|
||||
- **201**: Instance created
|
||||
- **409**: Conflict
|
||||
|
||||
Input
|
||||
@ -36,6 +36,7 @@ Input
|
||||
<tr><td>name</td> <td>✔</td> <td>string</td> <td>Docker container name</td> </tr>
|
||||
<tr><td>node_id</td> <td> </td> <td>string</td> <td>Node UUID</td> </tr>
|
||||
<tr><td>start_command</td> <td> </td> <td>['string', 'null']</td> <td>Docker CMD entry</td> </tr>
|
||||
<tr><td>usage</td> <td> </td> <td>string</td> <td>How to use the qemu VM</td> </tr>
|
||||
</table>
|
||||
|
||||
Output
|
||||
@ -60,5 +61,6 @@ Output
|
||||
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID Read only</td> </tr>
|
||||
<tr><td>start_command</td> <td> </td> <td>['string', 'null']</td> <td>Docker CMD entry</td> </tr>
|
||||
<tr><td>status</td> <td> </td> <td>enum</td> <td>Possible values: started, stopped, suspended</td> </tr>
|
||||
<tr><td>usage</td> <td> </td> <td>string</td> <td>How to use the qemu VM</td> </tr>
|
||||
</table>
|
||||
|
||||
|
@ -9,14 +9,14 @@ Delete a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Instance deleted
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance deleted
|
||||
|
||||
|
||||
PUT /v2/compute/projects/**{project_id}**/docker/nodes/**{node_id}**
|
||||
@ -25,8 +25,8 @@ Update a Docker instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
@ -57,6 +57,7 @@ Input
|
||||
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID Read only</td> </tr>
|
||||
<tr><td>start_command</td> <td> </td> <td>['string', 'null']</td> <td>Docker CMD entry</td> </tr>
|
||||
<tr><td>status</td> <td> </td> <td>enum</td> <td>Possible values: started, stopped, suspended</td> </tr>
|
||||
<tr><td>usage</td> <td> </td> <td>string</td> <td>How to use the qemu VM</td> </tr>
|
||||
</table>
|
||||
|
||||
Output
|
||||
@ -81,11 +82,6 @@ Output
|
||||
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID Read only</td> </tr>
|
||||
<tr><td>start_command</td> <td> </td> <td>['string', 'null']</td> <td>Docker CMD entry</td> </tr>
|
||||
<tr><td>status</td> <td> </td> <td>enum</td> <td>Possible values: started, stopped, suspended</td> </tr>
|
||||
<tr><td>usage</td> <td> </td> <td>string</td> <td>How to use the qemu VM</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/compute_put_projectsprojectiddockernodesnodeid.txt
|
||||
|
||||
|
@ -9,22 +9,34 @@ Add a NIO to a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **adapter_number**: Adapter where the nio should be added
|
||||
- **project_id**: Project UUID
|
||||
- **port_number**: Port on the adapter
|
||||
- **adapter_number**: Adapter where the nio should be added
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **201**: NIO created
|
||||
- **400**: Invalid request
|
||||
- **201**: NIO created
|
||||
- **404**: Instance doesn't exist
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
PUT /v2/compute/projects/**{project_id}**/docker/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a NIO from a Docker instance
|
||||
|
||||
.. literalinclude:: ../../../examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt
|
||||
Parameters
|
||||
**********
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
- **port_number**: Port from where the nio should be updated
|
||||
- **adapter_number**: Network adapter where the nio is located
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: NIO updated
|
||||
- **404**: Instance doesn't exist
|
||||
|
||||
|
||||
DELETE /v2/compute/projects/**{project_id}**/docker/nodes/**{node_id}**/adapters/**{adapter_number:\d+}**/ports/**{port_number:\d+}**/nio
|
||||
@ -33,20 +45,14 @@ Remove a NIO from a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **adapter_number**: Adapter where the nio should be added
|
||||
- **project_id**: Project UUID
|
||||
- **port_number**: Port on the adapter
|
||||
- **adapter_number**: Adapter where the nio should be added
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: NIO deleted
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/compute_delete_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdnio.txt
|
||||
- **204**: NIO deleted
|
||||
|
||||
|
@ -9,10 +9,10 @@ Start a packet capture on a Docker container instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **adapter_number**: Adapter to start a packet capture
|
||||
- **project_id**: Project UUID
|
||||
- **port_number**: Port on the adapter
|
||||
- **adapter_number**: Adapter to start a packet capture
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
@ -31,9 +31,3 @@ Input
|
||||
<tr><td>data_link_type</td> <td> </td> <td>enum</td> <td>Possible values: DLT_ATM_RFC1483, DLT_EN10MB, DLT_FRELAY, DLT_C_HDLC, DLT_PPP_SERIAL</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstartcapture.txt
|
||||
|
||||
|
@ -9,21 +9,15 @@ Stop a packet capture on a Docker container instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **adapter_number**: Adapter to stop a packet capture
|
||||
- **project_id**: Project UUID
|
||||
- **port_number**: Port on the adapter (always 0)
|
||||
- **adapter_number**: Adapter to stop a packet capture
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Capture stopped
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Capture stopped
|
||||
- **409**: Container not started
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/compute_post_projectsprojectiddockernodesnodeidadaptersadapternumberdportsportnumberdstopcapture.txt
|
||||
|
||||
|
@ -9,12 +9,12 @@ Pause a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Instance paused
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance paused
|
||||
|
||||
|
@ -9,12 +9,12 @@ Restart a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Instance restarted
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance restarted
|
||||
|
||||
|
@ -9,12 +9,12 @@ Start a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Instance started
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance started
|
||||
|
||||
|
@ -9,12 +9,12 @@ Stop a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Instance stopped
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance stopped
|
||||
|
||||
|
@ -9,12 +9,12 @@ Unpause a Docker container
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **node_id**: Node UUID
|
||||
- **project_id**: Project UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **204**: Instance unpaused
|
||||
- **400**: Invalid request
|
||||
- **404**: Instance doesn't exist
|
||||
- **204**: Instance unpaused
|
||||
|
||||
|
Reference in New Issue
Block a user