/v2/projects/{project_id}/drawings/{drawing_id}

GET /v2/projects/{project_id}/drawings/{drawing_id}

Get a drawing instance

Parameters

  • project_id: Project UUID
  • drawing_id: Drawing UUID

Response status codes

  • 200: Drawing found
  • 400: Invalid request
  • 404: Drawing doesn’t exist

Output

Name Mandatory Type Description
drawing_id string Drawing UUID
project_id string Project UUID
rotation integer Rotation of the element
svg string SVG content of the drawing
x integer X property
y integer Y property
z integer Z property

Sample session

curl -i -X GET 'http://localhost:3080/v2/projects/b1310dc0-c0f9-43ca-b1b6-dca48187ca20/drawings/571eda2c-6b71-4d1f-bff7-92a1c63c6622'

GET /v2/projects/b1310dc0-c0f9-43ca-b1b6-dca48187ca20/drawings/571eda2c-6b71-4d1f-bff7-92a1c63c6622 HTTP/1.1



HTTP/1.1 200
Connection: close
Content-Length: 323
Content-Type: application/json
Date: Mon, 08 Jan 2018 08:16:35 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/drawings/{drawing_id}

{
    "drawing_id": "571eda2c-6b71-4d1f-bff7-92a1c63c6622",
    "project_id": "b1310dc0-c0f9-43ca-b1b6-dca48187ca20",
    "rotation": 0,
    "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
}

PUT /v2/projects/{project_id}/drawings/{drawing_id}

Update a drawing instance

Parameters

  • project_id: Project UUID
  • drawing_id: Drawing UUID

Response status codes

  • 201: Drawing updated
  • 400: Invalid request

Input

Name Mandatory Type Description
drawing_id string Drawing UUID
project_id string Project UUID
rotation integer Rotation of the element
svg string SVG content of the drawing
x integer X property
y integer Y property
z integer Z property

Output

Name Mandatory Type Description
drawing_id string Drawing UUID
project_id string Project UUID
rotation integer Rotation of the element
svg string SVG content of the drawing
x integer X property
y integer Y property
z integer Z property

Sample session

curl -i -X PUT 'http://localhost:3080/v2/projects/730a3525-db50-4a6a-ac7b-c724c3eed9e8/drawings/eb4a10ff-3cd1-47dd-b95b-1792d2b08f5c' -d '{"x": 42}'

PUT /v2/projects/730a3525-db50-4a6a-ac7b-c724c3eed9e8/drawings/eb4a10ff-3cd1-47dd-b95b-1792d2b08f5c HTTP/1.1
{
    "x": 42
}


HTTP/1.1 201
Connection: close
Content-Length: 323
Content-Type: application/json
Date: Mon, 08 Jan 2018 08:16:35 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/drawings/{drawing_id}

{
    "drawing_id": "eb4a10ff-3cd1-47dd-b95b-1792d2b08f5c",
    "project_id": "730a3525-db50-4a6a-ac7b-c724c3eed9e8",
    "rotation": 0,
    "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,
    "z": 0
}

DELETE /v2/projects/{project_id}/drawings/{drawing_id}

Delete a drawing instance

Parameters

  • project_id: Project UUID
  • drawing_id: Drawing UUID

Response status codes

  • 204: Drawing deleted
  • 400: Invalid request

Sample session

curl -i -X DELETE 'http://localhost:3080/v2/projects/3cf20b3c-0602-49a6-b593-d49b6a1a5238/drawings/df4f6a0a-429a-40c9-ae38-dbb4733d0750'

DELETE /v2/projects/3cf20b3c-0602-49a6-b593-d49b6a1a5238/drawings/df4f6a0a-429a-40c9-ae38-dbb4733d0750 HTTP/1.1



HTTP/1.1 204
Connection: close
Content-Length: 0
Content-Type: application/octet-stream
Date: Mon, 08 Jan 2018 08:16:35 GMT
Server: Python/3.6 GNS3/2.1.2dev1
X-Route: /v2/projects/{project_id}/drawings/{drawing_id}