mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
API V2
This commit is contained in:
200 files changed
+867
-625
No files matched your search
@@ -0,0 +1,8 @@
|
||||
Server
|
||||
-----------------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
server/*
|
||||
@@ -0,0 +1,48 @@
|
||||
/v2/controller/servers
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v2/controller/servers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Register a server
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **201**: Server added
|
||||
|
||||
Input
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>host</td> <td>✔</td> <td>string</td> <td>Server host</td> </tr>
|
||||
<tr><td>password</td> <td> </td> <td>string</td> <td>Password for auth</td> </tr>
|
||||
<tr><td>port</td> <td>✔</td> <td>integer</td> <td>Server port</td> </tr>
|
||||
<tr><td>protocol</td> <td>✔</td> <td>enum</td> <td>Possible values: http, https</td> </tr>
|
||||
<tr><td>server_id</td> <td>✔</td> <td>string</td> <td>Server identifier</td> </tr>
|
||||
<tr><td>user</td> <td> </td> <td>string</td> <td>User for auth</td> </tr>
|
||||
</table>
|
||||
|
||||
Output
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>connected</td> <td> </td> <td>boolean</td> <td>True if controller is connected to the server</td> </tr>
|
||||
<tr><td>host</td> <td>✔</td> <td>string</td> <td>Server host</td> </tr>
|
||||
<tr><td>port</td> <td>✔</td> <td>integer</td> <td>Server port</td> </tr>
|
||||
<tr><td>protocol</td> <td>✔</td> <td>enum</td> <td>Possible values: http, https</td> </tr>
|
||||
<tr><td>server_id</td> <td>✔</td> <td>string</td> <td>Server identifier</td> </tr>
|
||||
<tr><td>user</td> <td> </td> <td>string</td> <td>User for auth</td> </tr>
|
||||
<tr><td>version</td> <td> </td> <td>['string', 'null']</td> <td>Version of the GNS3 remote server</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_post_servers.txt
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/v2/controller/servers/shutdown
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
POST /v2/controller/servers/shutdown
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Shutdown the local server
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **201**: Server is shutting down
|
||||
- **403**: Server shutdown refused
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Version
|
||||
-----------------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
version/*
|
||||
@@ -0,0 +1,65 @@
|
||||
/v2/controller/version
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/controller/version
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Retrieve the server version number
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: OK
|
||||
|
||||
Output
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>local</td> <td> </td> <td>boolean</td> <td>Either this is a local server</td> </tr>
|
||||
<tr><td>version</td> <td>✔</td> <td>string</td> <td>Version number human readable</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_get_version.txt
|
||||
|
||||
|
||||
POST /v2/controller/version
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Check if version is the same as the server
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: Same version
|
||||
- **409**: Invalid version
|
||||
|
||||
Input
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>local</td> <td> </td> <td>boolean</td> <td>Either this is a local server</td> </tr>
|
||||
<tr><td>version</td> <td>✔</td> <td>string</td> <td>Version number human readable</td> </tr>
|
||||
</table>
|
||||
|
||||
Output
|
||||
*******
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||
<tr><td>local</td> <td> </td> <td>boolean</td> <td>Either this is a local server</td> </tr>
|
||||
<tr><td>version</td> <td>✔</td> <td>string</td> <td>Version number human readable</td> </tr>
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_post_version.txt
|
||||
|
||||
Reference in new issue
Block a user