/v1/projects/{project_id}

GET /v1/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

Name Mandatory Type Description
location ✔ string Base directory where the project should be created on remote server
path string Directory of the project on the server
project_id ✔ string Project UUID
temporary ✔ boolean If project is a temporary project

Sample session

curl -i -X GET 'http://localhost:8000/projects/00010203-0405-0607-0809-0a0b0c0d0e02'

GET /projects/00010203-0405-0607-0809-0a0b0c0d0e02 HTTP/1.1



HTTP/1.1 200
CONNECTION: keep-alive
CONTENT-LENGTH: 277
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /v1/projects/{project_id}

{
    "location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpju7ztx9a",
    "path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmpju7ztx9a/00010203-0405-0607-0809-0a0b0c0d0e02",
    "project_id": "00010203-0405-0607-0809-0a0b0c0d0e02",
    "temporary": false
}

PUT /v1/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

Name Mandatory Type Description
path ['string', 'null'] Path of the project on the server (work only with --local)
temporary boolean If project is a temporary project

Output

Name Mandatory Type Description
location ✔ string Base directory where the project should be created on remote server
path string Directory of the project on the server
project_id ✔ string Project UUID
temporary ✔ boolean If project is a temporary project

Sample session

curl -i -X PUT 'http://localhost:8000/projects/ef58b29e-59df-42c0-9492-5a766a13cb62' -d '{"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3783/test_update_path_project_non_l0"}'

PUT /projects/ef58b29e-59df-42c0-9492-5a766a13cb62 HTTP/1.1
{
    "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-3783/test_update_path_project_non_l0"
}


HTTP/1.1 403
CONNECTION: keep-alive
CONTENT-LENGTH: 100
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /v1/projects/{project_id}

{
    "message": "You are not allowed to modify the project directory location",
    "status": 403
}

DELETE /v1/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

curl -i -X DELETE 'http://localhost:8000/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80'

DELETE /projects/a1e920ca-338a-4e9f-b363-aa607b09dd80 HTTP/1.1



HTTP/1.1 204
CONNECTION: keep-alive
CONTENT-LENGTH: 0
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.dev1
X-ROUTE: /v1/projects/{project_id}