1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-15 12:59:06 +00:00

Update documentation

This commit is contained in:
Julien Duponchelle 2016-06-17 11:13:36 +02:00
parent 6dff8af235
commit 186adff2ef
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
4 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,22 @@
curl -i -X POST 'http://localhost:3080/v2/projects/load' -d '{"path": "/tmp/test.gns3"}'
POST /v2/projects/load HTTP/1.1
{
"path": "/tmp/test.gns3"
}
HTTP/1.1 201
CONTENT-LENGTH: 255
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/2.0.0dev1
X-ROUTE: /v2/projects/load
{
"filename": "test.gns3",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmp1ovguuft/projects/fb475947-7ee3-43f8-a504-b8ececa32673",
"project_id": "fb475947-7ee3-43f8-a504-b8ececa32673",
"status": "opened"
}

View File

@ -0,0 +1,20 @@
curl -i -X POST 'http://localhost:3080/v2/projects/f5eeaa21-de29-4dea-af1a-82abc9c28e1d/open' -d '{}'
POST /v2/projects/f5eeaa21-de29-4dea-af1a-82abc9c28e1d/open HTTP/1.1
{}
HTTP/1.1 201
CONTENT-LENGTH: 255
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.5 GNS3/2.0.0dev1
X-ROUTE: /v2/projects/{project_id}/open
{
"filename": "test.gns3",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmptwm45lzd/projects/f5eeaa21-de29-4dea-af1a-82abc9c28e1d",
"project_id": "f5eeaa21-de29-4dea-af1a-82abc9c28e1d",
"status": "opened"
}

View File

@ -0,0 +1,46 @@
/v2/projects/load
------------------------------------------------------------------------------------------------------------------------------------------
.. contents::
POST /v2/projects/load
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open a project (only local server)
Parameters
**********
- **path**: .gns3 path
Response status codes
**********************
- **201**: The project has been opened
- **403**: The server is not the local server
Input
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>path</td> <td>&#10004;</td> <td>string</td> <td>.gns3 path</td> </tr>
</table>
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>filename</td> <td> </td> <td>['string', 'null']</td> <td>Project filename</td> </tr>
<tr><td>name</td> <td> </td> <td>['string', 'null']</td> <td>Project name</td> </tr>
<tr><td>path</td> <td> </td> <td>['string', 'null']</td> <td>Project directory</td> </tr>
<tr><td>project_id</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>status</td> <td> </td> <td>enum</td> <td>Possible values: opened, closed</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../../examples/controller_post_projectsload.txt

View File

@ -0,0 +1,37 @@
/v2/projects/{project_id}/open
------------------------------------------------------------------------------------------------------------------------------------------
.. contents::
POST /v2/projects/**{project_id}**/open
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open a project
Parameters
**********
- **project_id**: Project UUID
Response status codes
**********************
- **201**: The project has been opened
- **404**: The project doesn't exist
Output
*******
.. raw:: html
<table>
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
<tr><td>filename</td> <td> </td> <td>['string', 'null']</td> <td>Project filename</td> </tr>
<tr><td>name</td> <td> </td> <td>['string', 'null']</td> <td>Project name</td> </tr>
<tr><td>path</td> <td> </td> <td>['string', 'null']</td> <td>Project directory</td> </tr>
<tr><td>project_id</td> <td>&#10004;</td> <td>string</td> <td>Project UUID</td> </tr>
<tr><td>status</td> <td> </td> <td>enum</td> <td>Possible values: opened, closed</td> </tr>
</table>
Sample session
***************
.. literalinclude:: ../../../examples/controller_post_projectsprojectidopen.txt