mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-30 21:03:49 +02:00
Add shape documentation
This commit is contained in:
parent
679774430a
commit
f55398fe99
@ -0,0 +1,12 @@
|
|||||||
|
curl -i -X DELETE 'http://localhost:3080/v2/projects/a1d87587-dbed-4ba0-91e7-d8a46e511115/shapes/5f3a80ed-f145-41d3-b4b3-c086990ae9e0'
|
||||||
|
|
||||||
|
DELETE /v2/projects/a1d87587-dbed-4ba0-91e7-d8a46e511115/shapes/5f3a80ed-f145-41d3-b4b3-c086990ae9e0 HTTP/1.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HTTP/1.1 204
|
||||||
|
CONTENT-LENGTH: 0
|
||||||
|
DATE: Thu, 08 Jan 2015 16:09:15 GMT
|
||||||
|
SERVER: Python/3.5 GNS3/2.0.0dev1
|
||||||
|
X-ROUTE: /v2/projects/{project_id}/shapes/{shape_id}
|
||||||
|
|
22
docs/api/examples/controller_get_projectsprojectidshapes.txt
Normal file
22
docs/api/examples/controller_get_projectsprojectidshapes.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
curl -i -X GET 'http://localhost:3080/v2/projects/50626c07-f12d-4dbf-9e51-1da3854e620a/shapes'
|
||||||
|
|
||||||
|
GET /v2/projects/50626c07-f12d-4dbf-9e51-1da3854e620a/shapes HTTP/1.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HTTP/1.1 200
|
||||||
|
CONTENT-LENGTH: 186
|
||||||
|
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}/shapes
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"project_id": "50626c07-f12d-4dbf-9e51-1da3854e620a",
|
||||||
|
"shape_id": "82374821-e50d-4b2f-adcf-ab77216b5014",
|
||||||
|
"x": 10,
|
||||||
|
"y": 20,
|
||||||
|
"z": 0
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,25 @@
|
|||||||
|
curl -i -X POST 'http://localhost:3080/v2/projects/5490bb47-660d-4952-9b55-bedba5a3a7b8/shapes' -d '{"svg": "<svg height=\"210\" width=\"500\"><line x1=\"0\" y1=\"0\" x2=\"200\" y2=\"200\" style=\"stroke:rgb(255,0,0);stroke-width:2\" /></svg>", "x": 10, "y": 20, "z": 0}'
|
||||||
|
|
||||||
|
POST /v2/projects/5490bb47-660d-4952-9b55-bedba5a3a7b8/shapes HTTP/1.1
|
||||||
|
{
|
||||||
|
"svg": "<svg height=\"210\" width=\"500\"><line x1=\"0\" y1=\"0\" x2=\"200\" y2=\"200\" style=\"stroke:rgb(255,0,0);stroke-width:2\" /></svg>",
|
||||||
|
"x": 10,
|
||||||
|
"y": 20,
|
||||||
|
"z": 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTP/1.1 201
|
||||||
|
CONTENT-LENGTH: 154
|
||||||
|
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}/shapes
|
||||||
|
|
||||||
|
{
|
||||||
|
"project_id": "5490bb47-660d-4952-9b55-bedba5a3a7b8",
|
||||||
|
"shape_id": "61dafcde-a1af-4147-9ef3-82ccbe0f4870",
|
||||||
|
"x": 10,
|
||||||
|
"y": 20,
|
||||||
|
"z": 0
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
curl -i -X PUT 'http://localhost:3080/v2/projects/eac9bc49-0ec5-4839-831e-0b8a896e29c3/shapes/10b825e2-feb2-46ac-80b2-5c82007e0949' -d '{"x": 42}'
|
||||||
|
|
||||||
|
PUT /v2/projects/eac9bc49-0ec5-4839-831e-0b8a896e29c3/shapes/10b825e2-feb2-46ac-80b2-5c82007e0949 HTTP/1.1
|
||||||
|
{
|
||||||
|
"x": 42
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTP/1.1 201
|
||||||
|
CONTENT-LENGTH: 154
|
||||||
|
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}/shapes/{shape_id}
|
||||||
|
|
||||||
|
{
|
||||||
|
"project_id": "eac9bc49-0ec5-4839-831e-0b8a896e29c3",
|
||||||
|
"shape_id": "10b825e2-feb2-46ac-80b2-5c82007e0949",
|
||||||
|
"x": 42,
|
||||||
|
"y": 20,
|
||||||
|
"z": 0
|
||||||
|
}
|
8
docs/api/v2/controller/shape.rst
Normal file
8
docs/api/v2/controller/shape.rst
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Shape
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:glob:
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
shape/*
|
71
docs/api/v2/controller/shape/projectsprojectidshapes.rst
Normal file
71
docs/api/v2/controller/shape/projectsprojectidshapes.rst
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/v2/projects/{project_id}/shapes
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
|
||||||
|
GET /v2/projects/**{project_id}**/shapes
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
List shapes of a project
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
**********
|
||||||
|
- **project_id**: Project UUID
|
||||||
|
|
||||||
|
Response status codes
|
||||||
|
**********************
|
||||||
|
- **200**: List of shapes returned
|
||||||
|
|
||||||
|
Sample session
|
||||||
|
***************
|
||||||
|
|
||||||
|
|
||||||
|
.. literalinclude:: ../../../examples/controller_get_projectsprojectidshapes.txt
|
||||||
|
|
||||||
|
|
||||||
|
POST /v2/projects/**{project_id}**/shapes
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Create a new shape instance
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
**********
|
||||||
|
- **project_id**: Project UUID
|
||||||
|
|
||||||
|
Response status codes
|
||||||
|
**********************
|
||||||
|
- **400**: Invalid request
|
||||||
|
- **201**: Shape created
|
||||||
|
|
||||||
|
Input
|
||||||
|
*******
|
||||||
|
.. raw:: html
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||||
|
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr>
|
||||||
|
<tr><td>shape_id</td> <td> </td> <td>string</td> <td>Shape UUID</td> </tr>
|
||||||
|
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the shape</td> </tr>
|
||||||
|
<tr><td>x</td> <td> </td> <td>integer</td> <td>X property</td> </tr>
|
||||||
|
<tr><td>y</td> <td> </td> <td>integer</td> <td>Y property</td> </tr>
|
||||||
|
<tr><td>z</td> <td> </td> <td>integer</td> <td>Z property</td> </tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Output
|
||||||
|
*******
|
||||||
|
.. raw:: html
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||||
|
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr>
|
||||||
|
<tr><td>shape_id</td> <td> </td> <td>string</td> <td>Shape UUID</td> </tr>
|
||||||
|
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the shape</td> </tr>
|
||||||
|
<tr><td>x</td> <td> </td> <td>integer</td> <td>X property</td> </tr>
|
||||||
|
<tr><td>y</td> <td> </td> <td>integer</td> <td>Y property</td> </tr>
|
||||||
|
<tr><td>z</td> <td> </td> <td>integer</td> <td>Z property</td> </tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Sample session
|
||||||
|
***************
|
||||||
|
|
||||||
|
|
||||||
|
.. literalinclude:: ../../../examples/controller_post_projectsprojectidshapes.txt
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
/v2/projects/{project_id}/shapes/{shape_id}
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
|
||||||
|
PUT /v2/projects/**{project_id}**/shapes/**{shape_id}**
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Create a new shape instance
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
**********
|
||||||
|
- **project_id**: Project UUID
|
||||||
|
- **shape_id**: Shape UUID
|
||||||
|
|
||||||
|
Response status codes
|
||||||
|
**********************
|
||||||
|
- **400**: Invalid request
|
||||||
|
- **201**: Shape updated
|
||||||
|
|
||||||
|
Input
|
||||||
|
*******
|
||||||
|
.. raw:: html
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||||
|
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr>
|
||||||
|
<tr><td>shape_id</td> <td> </td> <td>string</td> <td>Shape UUID</td> </tr>
|
||||||
|
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the shape</td> </tr>
|
||||||
|
<tr><td>x</td> <td> </td> <td>integer</td> <td>X property</td> </tr>
|
||||||
|
<tr><td>y</td> <td> </td> <td>integer</td> <td>Y property</td> </tr>
|
||||||
|
<tr><td>z</td> <td> </td> <td>integer</td> <td>Z property</td> </tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Output
|
||||||
|
*******
|
||||||
|
.. raw:: html
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr> <th>Name</th> <th>Mandatory</th> <th>Type</th> <th>Description</th> </tr>
|
||||||
|
<tr><td>project_id</td> <td> </td> <td>string</td> <td>Project UUID</td> </tr>
|
||||||
|
<tr><td>shape_id</td> <td> </td> <td>string</td> <td>Shape UUID</td> </tr>
|
||||||
|
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the shape</td> </tr>
|
||||||
|
<tr><td>x</td> <td> </td> <td>integer</td> <td>X property</td> </tr>
|
||||||
|
<tr><td>y</td> <td> </td> <td>integer</td> <td>Y property</td> </tr>
|
||||||
|
<tr><td>z</td> <td> </td> <td>integer</td> <td>Z property</td> </tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
Sample session
|
||||||
|
***************
|
||||||
|
|
||||||
|
|
||||||
|
.. literalinclude:: ../../../examples/controller_put_projectsprojectidshapesshapeid.txt
|
||||||
|
|
||||||
|
|
||||||
|
DELETE /v2/projects/**{project_id}**/shapes/**{shape_id}**
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Delete a shape instance
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
**********
|
||||||
|
- **project_id**: Project UUID
|
||||||
|
- **shape_id**: Shape UUID
|
||||||
|
|
||||||
|
Response status codes
|
||||||
|
**********************
|
||||||
|
- **400**: Invalid request
|
||||||
|
- **204**: Shape deleted
|
||||||
|
|
||||||
|
Sample session
|
||||||
|
***************
|
||||||
|
|
||||||
|
|
||||||
|
.. literalinclude:: ../../../examples/controller_delete_projectsprojectidshapesshapeid.txt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user