/v1/projects/{project_id}¶
Contents
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 |
name | string | Project name | |
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/v1/projects/00010203-0405-0607-0809-0a0b0c0d0e02'
GET /v1/projects/00010203-0405-0607-0809-0a0b0c0d0e02 HTTP/1.1
HTTP/1.1 200
CONNECTION: keep-alive
CONTENT-LENGTH: 297
CONTENT-TYPE: application/json
DATE: Thu, 08 Jan 2015 16:09:15 GMT
SERVER: Python/3.4 GNS3/1.3.1.rc2
X-ROUTE: /v1/projects/{project_id}
{
"location": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmphbzo0jp9",
"name": "test",
"path": "/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/tmphbzo0jp9/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 |
---|---|---|---|
name | ['string', 'null'] | Project name | |
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 |
name | string | Project name | |
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/v1/projects/b32aab45-411c-4171-9f20-357eaa00d54c' -d '{"name": "second_name", "path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-4450/test_update_path_project_non_l0"}'
PUT /v1/projects/b32aab45-411c-4171-9f20-357eaa00d54c HTTP/1.1
{
"name": "second_name",
"path": "/private/var/folders/3s/r2wbv07n7wg4vrsn874lmxxh0000gn/T/pytest-4450/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.1.rc2
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/v1/projects/a1e920ca-338a-4e9f-b363-aa607b09dd80'
DELETE /v1/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.1.rc2
X-ROUTE: /v1/projects/{project_id}