1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Build documentation

This commit is contained in:
Julien Duponchelle 2015-01-23 16:19:17 +01:00
parent 547adf0dc6
commit 977ff0fb57
15 changed files with 233 additions and 7 deletions

View File

@ -0,0 +1,13 @@
curl -i -X DELETE 'http://localhost:8000/project/{uuid}'
DELETE /project/{uuid} 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: /project/{uuid}

View File

@ -18,5 +18,5 @@ X-ROUTE: /vpcs/{uuid}
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80", "project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"script_file": null, "script_file": null,
"startup_script": null, "startup_script": null,
"uuid": "925c4d08-58a5-4078-9e77-a6875e0c28dc" "uuid": "fbbcc900-7fd1-4fcc-bc70-5f7eee8397b9"
} }

View File

@ -9,7 +9,7 @@ POST /project HTTP/1.1
HTTP/1.1 200 HTTP/1.1 200
CONNECTION: close CONNECTION: close
CONTENT-LENGTH: 78 CONTENT-LENGTH: 102
CONTENT-TYPE: application/json CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1 SERVER: Python/3.4 aiohttp/0.13.1
@ -17,5 +17,6 @@ X-ROUTE: /project
{ {
"location": "/tmp", "location": "/tmp",
"temporary": false,
"uuid": "00010203-0405-0607-0809-0a0b0c0d0e0f" "uuid": "00010203-0405-0607-0809-0a0b0c0d0e0f"
} }

View File

@ -0,0 +1,13 @@
curl -i -X POST 'http://localhost:8000/project/{uuid}/close' -d '{}'
POST /project/{uuid}/close 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: /project/{uuid}/close

View File

@ -0,0 +1,13 @@
curl -i -X POST 'http://localhost:8000/project/{uuid}/commit' -d '{}'
POST /project/{uuid}/commit 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: /project/{uuid}/commit

View File

@ -11,14 +11,21 @@ POST /virtualbox HTTP/1.1
HTTP/1.1 201 HTTP/1.1 201
CONNECTION: close CONNECTION: close
CONTENT-LENGTH: 133 CONTENT-LENGTH: 348
CONTENT-TYPE: application/json CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 aiohttp/0.13.1 SERVER: Python/3.4 aiohttp/0.13.1
X-ROUTE: /virtualbox X-ROUTE: /virtualbox
{ {
"adapter_start_index": 0,
"adapter_type": "Intel PRO/1000 MT Desktop (82540EM)",
"adapters": 0,
"enable_remote_console": false,
"headless": false,
"linked_clone": false,
"name": "VM1", "name": "VM1",
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80", "project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"uuid": "c220788f-ee1e-491c-b318-6542d2f130bf" "uuid": "2908d568-4a42-49e1-9628-d914f2fd545d",
"vmname": "VM1"
} }

View File

@ -21,5 +21,5 @@ X-ROUTE: /vpcs
"project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80", "project_uuid": "a1e920ca-338a-4e9f-b363-aa607b09dd80",
"script_file": null, "script_file": null,
"startup_script": null, "startup_script": null,
"uuid": "4d670947-44a8-4156-8626-adce3faa5ae6" "uuid": "5a2735f9-c38a-459c-8b7d-70ec56b62a7f"
} }

View File

@ -18,6 +18,7 @@ Input
<table> <table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr> <tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>location</td> <td> </td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr> <tr><td>location</td> <td> </td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr>
<tr><td>temporary</td> <td> </td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
<tr><td>uuid</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr> <tr><td>uuid</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr>
</table> </table>
@ -27,8 +28,9 @@ Output
<table> <table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr> <tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>location</td> <td> </td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr> <tr><td>location</td> <td>&#10004;</td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr>
<tr><td>uuid</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr> <tr><td>temporary</td> <td>&#10004;</td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
</table> </table>
Sample session Sample session

83
docs/api/projectuuid.rst Normal file
View File

@ -0,0 +1,83 @@
/project/{uuid}
---------------------------------------------
.. contents::
GET /project/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get project informations
Parameters
**********
- **uuid**: Project instance UUID
Response status codes
**********************
- **200**: OK
- **404**: Project instance doesn't exist
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>location</td> <td>&#10004;</td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr>
<tr><td>temporary</td> <td>&#10004;</td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
</table>
PUT /project/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update a project
Parameters
**********
- **uuid**: Project instance UUID
Response status codes
**********************
- **200**: Project updated
- **404**: Project instance doesn't exist
Input
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>temporary</td> <td> </td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
</table>
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>location</td> <td>&#10004;</td> <td>string</td> <td>Base directory where the project should be created on remote server</td> </tr>
<tr><td>temporary</td> <td>&#10004;</td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
</table>
DELETE /project/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Delete a project from disk
Parameters
**********
- **uuid**: Project instance UUID
Response status codes
**********************
- **404**: Project instance doesn't exist
- **204**: Changes write on disk
Sample session
***************
.. literalinclude:: examples/delete_projectuuid.txt

View File

@ -0,0 +1,24 @@
/project/{uuid}/close
---------------------------------------------
.. contents::
POST /project/**{uuid}**/close
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Close project
Parameters
**********
- **uuid**: Project instance UUID
Response status codes
**********************
- **404**: Project instance doesn't exist
- **204**: Project closed
Sample session
***************
.. literalinclude:: examples/post_projectuuidclose.txt

View File

@ -0,0 +1,24 @@
/project/{uuid}/commit
---------------------------------------------
.. contents::
POST /project/**{uuid}**/commit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Write changes on disk
Parameters
**********
- **uuid**: Project instance UUID
Response status codes
**********************
- **404**: Project instance doesn't exist
- **204**: Changes write on disk
Sample session
***************
.. literalinclude:: examples/post_projectuuidcommit.txt

View File

@ -33,10 +33,17 @@ Output
<table> <table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr> <tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>adapter_start_index</td> <td> </td> <td>integer</td> <td>adapter index from which to start using adapters</td> </tr>
<tr><td>adapter_type</td> <td> </td> <td>string</td> <td>VirtualBox adapter type</td> </tr>
<tr><td>adapters</td> <td> </td> <td>integer</td> <td>number of adapters</td> </tr>
<tr><td>console</td> <td> </td> <td>integer</td> <td>console TCP port</td> </tr> <tr><td>console</td> <td> </td> <td>integer</td> <td>console TCP port</td> </tr>
<tr><td>enable_remote_console</td> <td> </td> <td>boolean</td> <td>enable the remote console</td> </tr>
<tr><td>headless</td> <td> </td> <td>boolean</td> <td>headless mode</td> </tr>
<tr><td>linked_clone</td> <td> </td> <td>boolean</td> <td>either the VM is a linked clone or not</td> </tr>
<tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr> <tr><td>name</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance name</td> </tr>
<tr><td>project_uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr> <tr><td>project_uuid</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr> <tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>VirtualBox VM instance UUID</td> </tr>
<tr><td>vmname</td> <td> </td> <td>string</td> <td>VirtualBox VM name (in VirtualBox itself)</td> </tr>
</table> </table>
Sample session Sample session

View File

@ -0,0 +1,19 @@
/virtualbox/{uuid}/reload
---------------------------------------------
.. contents::
POST /virtualbox/**{uuid}**/reload
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reload a VirtualBox VM instance
Parameters
**********
- **uuid**: VirtualBox VM instance UUID
Response status codes
**********************
- **400**: Invalid VirtualBox VM instance UUID
- **404**: VirtualBox VM instance doesn't exist
- **204**: VirtualBox VM instance reloaded

View File

@ -27,10 +27,15 @@ PUT /vpcs/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update a VPCS instance Update a VPCS instance
Parameters
**********
- **uuid**: VPCS instance UUID
Response status codes Response status codes
********************** **********************
- **200**: VPCS instance updated - **200**: VPCS instance updated
- **409**: Conflict - **409**: Conflict
- **404**: VPCS instance doesn't exist
Input Input
******* *******
@ -58,3 +63,17 @@ Output
<tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>VPCS device UUID</td> </tr> <tr><td>uuid</td> <td>&#10004;</td> <td>string</td> <td>VPCS device UUID</td> </tr>
</table> </table>
DELETE /vpcs/**{uuid}**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Delete a VPCS instance
Parameters
**********
- **uuid**: VPCS instance UUID
Response status codes
**********************
- **404**: VPCS instance doesn't exist
- **204**: VPCS instance deleted

View File

@ -13,6 +13,7 @@ Parameters
Response status codes Response status codes
********************** **********************
- **400**: Invalid VPCS instance UUID
- **404**: VPCS instance doesn't exist - **404**: VPCS instance doesn't exist
- **204**: VPCS reloaded - **204**: VPCS reloaded