mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
API V2
This commit is contained in:
200 files changed
+867
-625
No files matched your search
@@ -0,0 +1,60 @@
|
||||
/v2/hypervisor/projects
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/hypervisor/projects
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
List projects opened on the server
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Project list
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_get_projects.txt
|
||||
|
||||
|
||||
POST /v2/hypervisor/projects
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new project on the server
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **201**: Project created
|
||||
- **409**: Project already created
|
||||
|
||||
Input
|
||||
*******
|
||||
.. 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', '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> </td> <td>['string', 'null']</td> <td>Project UUID</td> </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>✔</td> <td>string</td> <td>Base directory where the project should be created on remote server</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</td> <td>Directory of the project on the server</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>temporary</td> <td>✔</td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_post_projects.txt
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/v2/hypervisor/projects/{project_id}
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/hypervisor/projects/**{project_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get project information
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Success
|
||||
- **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>location</td> <td>✔</td> <td>string</td> <td>Base directory where the project should be created on remote server</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</td> <td>Directory of the project on the server</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>temporary</td> <td>✔</td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_get_projectsprojectid.txt
|
||||
|
||||
|
||||
PUT /v2/hypervisor/projects/**{project_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Update a project
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: The project has been updated
|
||||
- **403**: You are not allowed to modify this property
|
||||
- **404**: The project doesn't exist
|
||||
|
||||
Input
|
||||
*******
|
||||
.. 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', 'null']</td> <td>Project name</td> </tr>
|
||||
<tr><td>path</td> <td> </td> <td>['string', 'null']</td> <td>Path of the project on the server (work only with --local)</td> </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>✔</td> <td>string</td> <td>Base directory where the project should be created on remote server</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</td> <td>Directory of the project on the server</td> </tr>
|
||||
<tr><td>project_id</td> <td>✔</td> <td>string</td> <td>Project UUID</td> </tr>
|
||||
<tr><td>temporary</td> <td>✔</td> <td>boolean</td> <td>If project is a temporary project</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_put_projectsprojectid.txt
|
||||
|
||||
|
||||
DELETE /v2/hypervisor/projects/**{project_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a project from disk
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **404**: The project doesn't exist
|
||||
- **204**: Changes have been written on disk
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_delete_projectsprojectid.txt
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/v2/hypervisor/projects/{project_id}/close
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v2/hypervisor/projects/**{project_id}**/close
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Close a project
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **404**: The project doesn't exist
|
||||
- **204**: The project has been closed
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_post_projectsprojectidclose.txt
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/v2/hypervisor/projects/{project_id}/commit
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v2/hypervisor/projects/**{project_id}**/commit
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Write changes on disk
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **404**: The project doesn't exist
|
||||
- **204**: Changes have been written on disk
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_post_projectsprojectidcommit.txt
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/v2/hypervisor/projects/{project_id}/files
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/hypervisor/projects/**{project_id}**/files
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
List files of a project
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Return list of files
|
||||
- **404**: The project doesn't exist
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/hypervisor_get_projectsprojectidfiles.txt
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/v2/hypervisor/projects/{project_id}/files/{path:.+}
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/hypervisor/projects/**{project_id}**/files/**{path:.+}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Get a file of a project
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Return the file
|
||||
- **403**: Permission denied
|
||||
- **404**: The file doesn't exist
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/v2/hypervisor/projects/{project_id}/notifications
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/hypervisor/projects/**{project_id}**/notifications
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Receive notifications about the projects
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: The UUID of the project
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: End of stream
|
||||
- **404**: The project doesn't exist
|
||||
|
||||
Reference in new issue
Block a user