mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Shape => Drawing
This commit is contained in:
21 files changed
+181
-181
No files matched your search
@@ -1,6 +1,6 @@
|
||||
curl -i -X DELETE 'http://localhost:3080/v2/projects/6b74fe6e-f65a-46a9-84a9-1db0cd42a9d2/shapes/6e313846-5d8f-4dcc-a231-e2dd9406bb71'
|
||||
curl -i -X DELETE 'http://localhost:3080/v2/projects/6b74fe6e-f65a-46a9-84a9-1db0cd42a9d2/drawings/6e313846-5d8f-4dcc-a231-e2dd9406bb71'
|
||||
|
||||
DELETE /v2/projects/6b74fe6e-f65a-46a9-84a9-1db0cd42a9d2/shapes/6e313846-5d8f-4dcc-a231-e2dd9406bb71 HTTP/1.1
|
||||
DELETE /v2/projects/6b74fe6e-f65a-46a9-84a9-1db0cd42a9d2/drawings/6e313846-5d8f-4dcc-a231-e2dd9406bb71 HTTP/1.1
|
||||
|
||||
|
||||
|
||||
@@ -8,5 +8,5 @@ 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}
|
||||
X-ROUTE: /v2/projects/{project_id}/drawings/{drawing_id}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
curl -i -X GET 'http://localhost:3080/v2/projects/0bb34c74-e696-46b5-9c94-d00e3f55da18/shapes'
|
||||
curl -i -X GET 'http://localhost:3080/v2/projects/0bb34c74-e696-46b5-9c94-d00e3f55da18/drawings'
|
||||
|
||||
GET /v2/projects/0bb34c74-e696-46b5-9c94-d00e3f55da18/shapes HTTP/1.1
|
||||
GET /v2/projects/0bb34c74-e696-46b5-9c94-d00e3f55da18/drawings HTTP/1.1
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ CONTENT-LENGTH: 361
|
||||
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
|
||||
X-ROUTE: /v2/projects/{project_id}/drawings
|
||||
|
||||
[
|
||||
{
|
||||
"project_id": "0bb34c74-e696-46b5-9c94-d00e3f55da18",
|
||||
"rotation": 0,
|
||||
"shape_id": "a0690cd5-6460-464e-b599-7980f5c08e67",
|
||||
"drawing_id": "a0690cd5-6460-464e-b599-7980f5c08e67",
|
||||
"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,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
curl -i -X POST 'http://localhost:3080/v2/projects/e82d1e06-4235-41dc-9a57-0cd0672692f0/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}'
|
||||
curl -i -X POST 'http://localhost:3080/v2/projects/e82d1e06-4235-41dc-9a57-0cd0672692f0/drawings' -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/e82d1e06-4235-41dc-9a57-0cd0672692f0/shapes HTTP/1.1
|
||||
POST /v2/projects/e82d1e06-4235-41dc-9a57-0cd0672692f0/drawings 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,
|
||||
@@ -14,12 +14,12 @@ CONTENT-LENGTH: 321
|
||||
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
|
||||
X-ROUTE: /v2/projects/{project_id}/drawings
|
||||
|
||||
{
|
||||
"project_id": "e82d1e06-4235-41dc-9a57-0cd0672692f0",
|
||||
"rotation": 0,
|
||||
"shape_id": "66594d41-524e-4dfd-a07b-3186ed392c86",
|
||||
"drawing_id": "66594d41-524e-4dfd-a07b-3186ed392c86",
|
||||
"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,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
curl -i -X PUT 'http://localhost:3080/v2/projects/2312697c-8e49-40e0-9d6d-5bd6dd0679ed/shapes/dbefe2d5-79d7-4f18-b898-cd073224563c' -d '{"x": 42}'
|
||||
curl -i -X PUT 'http://localhost:3080/v2/projects/2312697c-8e49-40e0-9d6d-5bd6dd0679ed/drawings/dbefe2d5-79d7-4f18-b898-cd073224563c' -d '{"x": 42}'
|
||||
|
||||
PUT /v2/projects/2312697c-8e49-40e0-9d6d-5bd6dd0679ed/shapes/dbefe2d5-79d7-4f18-b898-cd073224563c HTTP/1.1
|
||||
PUT /v2/projects/2312697c-8e49-40e0-9d6d-5bd6dd0679ed/drawings/dbefe2d5-79d7-4f18-b898-cd073224563c HTTP/1.1
|
||||
{
|
||||
"x": 42
|
||||
}
|
||||
@@ -11,12 +11,12 @@ CONTENT-LENGTH: 321
|
||||
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}
|
||||
X-ROUTE: /v2/projects/{project_id}/drawings/{drawing_id}
|
||||
|
||||
{
|
||||
"project_id": "2312697c-8e49-40e0-9d6d-5bd6dd0679ed",
|
||||
"rotation": 0,
|
||||
"shape_id": "dbefe2d5-79d7-4f18-b898-cd073224563c",
|
||||
"drawing_id": "dbefe2d5-79d7-4f18-b898-cd073224563c",
|
||||
"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": 42,
|
||||
"y": 20,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Shape
|
||||
Drawing
|
||||
-----------------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 2
|
||||
|
||||
shape/*
|
||||
drawing/*
|
||||
@@ -1,11 +1,11 @@
|
||||
/v2/projects/{project_id}/shapes
|
||||
/v2/projects/{project_id}/drawings
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/projects/**{project_id}**/shapes
|
||||
GET /v2/projects/**{project_id}**/drawings
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
List shapes of a project
|
||||
List drawings of a project
|
||||
|
||||
Parameters
|
||||
**********
|
||||
@@ -13,18 +13,18 @@ Parameters
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: List of shapes returned
|
||||
- **200**: List of drawings returned
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_get_projectsprojectidshapes.txt
|
||||
.. literalinclude:: ../../../examples/controller_get_projectsprojectiddrawings.txt
|
||||
|
||||
|
||||
POST /v2/projects/**{project_id}**/shapes
|
||||
POST /v2/projects/**{project_id}**/drawings
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new shape instance
|
||||
Create a new drawing instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
@@ -33,7 +33,7 @@ Parameters
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: Shape created
|
||||
- **201**: Drawing created
|
||||
|
||||
Input
|
||||
*******
|
||||
@@ -43,8 +43,8 @@ Input
|
||||
<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>rotation</td> <td> </td> <td>integer</td> <td>Rotation of the element</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>drawing_id</td> <td> </td> <td>string</td> <td>Drawing UUID</td> </tr>
|
||||
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the drawing</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>
|
||||
@@ -58,8 +58,8 @@ Output
|
||||
<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>rotation</td> <td> </td> <td>integer</td> <td>Rotation of the element</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>drawing_id</td> <td> </td> <td>string</td> <td>Drawing UUID</td> </tr>
|
||||
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the drawing</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>
|
||||
@@ -69,5 +69,5 @@ Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_post_projectsprojectidshapes.txt
|
||||
.. literalinclude:: ../../../examples/controller_post_projectsprojectiddrawings.txt
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/v2/projects/{project_id}/shapes/{shape_id}
|
||||
/v2/projects/{project_id}/drawings/{drawing_id}
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
PUT /v2/projects/**{project_id}**/shapes/**{shape_id}**
|
||||
PUT /v2/projects/**{project_id}**/drawings/**{drawing_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Create a new shape instance
|
||||
Create a new drawing instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **shape_id**: Shape UUID
|
||||
- **drawing_id**: Drawing UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **201**: Shape updated
|
||||
- **201**: Drawing updated
|
||||
|
||||
Input
|
||||
*******
|
||||
@@ -25,8 +25,8 @@ Input
|
||||
<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>rotation</td> <td> </td> <td>integer</td> <td>Rotation of the element</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>drawing_id</td> <td> </td> <td>string</td> <td>Drawing UUID</td> </tr>
|
||||
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the drawing</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>
|
||||
@@ -40,8 +40,8 @@ Output
|
||||
<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>rotation</td> <td> </td> <td>integer</td> <td>Rotation of the element</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>drawing_id</td> <td> </td> <td>string</td> <td>Drawing UUID</td> </tr>
|
||||
<tr><td>svg</td> <td> </td> <td>string</td> <td>SVG content of the drawing</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>
|
||||
@@ -51,26 +51,26 @@ Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_put_projectsprojectidshapesshapeid.txt
|
||||
.. literalinclude:: ../../../examples/controller_put_projectsprojectiddrawingsdrawingid.txt
|
||||
|
||||
|
||||
DELETE /v2/projects/**{project_id}**/shapes/**{shape_id}**
|
||||
DELETE /v2/projects/**{project_id}**/drawings/**{drawing_id}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Delete a shape instance
|
||||
Delete a drawing instance
|
||||
|
||||
Parameters
|
||||
**********
|
||||
- **project_id**: Project UUID
|
||||
- **shape_id**: Shape UUID
|
||||
- **drawing_id**: Drawing UUID
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **400**: Invalid request
|
||||
- **204**: Shape deleted
|
||||
- **204**: Drawing deleted
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_delete_projectsprojectidshapesshapeid.txt
|
||||
.. literalinclude:: ../../../examples/controller_delete_projectsprojectiddrawingsdrawingid.txt
|
||||
|
||||
Reference in new issue
Block a user