diff --git a/docs/api/examples/controller_post_projectsload.txt b/docs/api/examples/controller_post_projectsload.txt new file mode 100644 index 00000000..d2deecc5 --- /dev/null +++ b/docs/api/examples/controller_post_projectsload.txt @@ -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" +} diff --git a/docs/api/examples/controller_post_projectsprojectidopen.txt b/docs/api/examples/controller_post_projectsprojectidopen.txt new file mode 100644 index 00000000..ad2fbd98 --- /dev/null +++ b/docs/api/examples/controller_post_projectsprojectidopen.txt @@ -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" +} diff --git a/docs/api/v2/controller/project/projectsload.rst b/docs/api/v2/controller/project/projectsload.rst new file mode 100644 index 00000000..3bdba361 --- /dev/null +++ b/docs/api/v2/controller/project/projectsload.rst @@ -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 + + + + +
Name Mandatory Type Description
path string .gns3 path
+ +Output +******* +.. raw:: html + + + + + + + + +
Name Mandatory Type Description
filename ['string', 'null'] Project filename
name ['string', 'null'] Project name
path ['string', 'null'] Project directory
project_id string Project UUID
status enum Possible values: opened, closed
+ +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsload.txt + diff --git a/docs/api/v2/controller/project/projectsprojectidopen.rst b/docs/api/v2/controller/project/projectsprojectidopen.rst new file mode 100644 index 00000000..17704157 --- /dev/null +++ b/docs/api/v2/controller/project/projectsprojectidopen.rst @@ -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 + + + + + + + + +
Name Mandatory Type Description
filename ['string', 'null'] Project filename
name ['string', 'null'] Project name
path ['string', 'null'] Project directory
project_id string Project UUID
status enum Possible values: opened, closed
+ +Sample session +*************** + + +.. literalinclude:: ../../../examples/controller_post_projectsprojectidopen.txt +