/v2/templates/{template_id}¶
Contents
GET /v2/templates/{template_id}¶
Get an template
Response status codes¶
- 200: Template found
- 400: Invalid request
- 404: Template doesn’t exist
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
builtin | ✔ | boolean | Template is builtin |
category | ✔ | Template category | |
compute_id | ✔ | ['null', 'string'] | Compute identifier |
default_name_format | ✔ | string | Default name format |
name | ✔ | string | Template name |
symbol | ✔ | string | Symbol of the template |
template_id | ✔ | string | Template UUID |
template_type | ✔ | enum | Possible values: cloud, ethernet_hub, ethernet_switch, docker, dynamips, vpcs, traceng, virtualbox, vmware, iou, qemu |
Sample session¶
curl -i -X GET 'http://localhost:3080/v2/templates/a1b6bb7d-f49a-4b68-8899-9a91c7abcc75'
GET /v2/templates/a1b6bb7d-f49a-4b68-8899-9a91c7abcc75 HTTP/1.1
HTTP/1.1 200
Connection: close
Content-Length: 378
Content-Type: application/json
Date: Wed, 08 Jan 2020 02:29:20 GMT
Etag: "1d2e3b0f3945c728e2673eb94587c85d"
Server: Python/3.6 GNS3/2.2.4dev1
X-Route: /v2/templates/{template_id}
{
"base_script_file": "vpcs_base_config.txt",
"builtin": false,
"category": "guest",
"compute_id": "local",
"console_auto_start": false,
"console_type": "telnet",
"default_name_format": "PC{0}",
"name": "VPCS_TEST",
"symbol": ":/symbols/vpcs_guest.svg",
"template_id": "a1b6bb7d-f49a-4b68-8899-9a91c7abcc75",
"template_type": "vpcs"
}
PUT /v2/templates/{template_id}¶
Update an template
Response status codes¶
- 200: Template updated
- 400: Invalid request
- 404: Template doesn’t exist
Input¶
Name | Mandatory | Type | Description |
---|---|---|---|
builtin | boolean | Template is builtin | |
category | Template category | ||
compute_id | ['null', 'string'] | Compute identifier | |
default_name_format | string | Default name format | |
name | string | Template name | |
symbol | string | Symbol of the template | |
template_id | string | Template UUID | |
template_type | enum | Possible values: cloud, ethernet_hub, ethernet_switch, docker, dynamips, vpcs, traceng, virtualbox, vmware, iou, qemu |
Output¶
Name | Mandatory | Type | Description |
---|---|---|---|
builtin | ✔ | boolean | Template is builtin |
category | ✔ | Template category | |
compute_id | ✔ | ['null', 'string'] | Compute identifier |
default_name_format | ✔ | string | Default name format |
name | ✔ | string | Template name |
symbol | ✔ | string | Symbol of the template |
template_id | ✔ | string | Template UUID |
template_type | ✔ | enum | Possible values: cloud, ethernet_hub, ethernet_switch, docker, dynamips, vpcs, traceng, virtualbox, vmware, iou, qemu |
Sample session¶
curl -i -X PUT 'http://localhost:3080/v2/templates/7b448d0f-a756-421d-9c97-8a339e5ec6c2' -d '{"base_script_file": "vpcs_base_config.txt", "category": "guest", "compute_id": "local", "console_auto_start": false, "console_type": "telnet", "default_name_format": "PC{0}", "name": "VPCS_TEST_RENAMED", "symbol": ":/symbols/vpcs_guest.svg", "template_id": "7b448d0f-a756-421d-9c97-8a339e5ec6c2", "template_type": "vpcs"}'
PUT /v2/templates/7b448d0f-a756-421d-9c97-8a339e5ec6c2 HTTP/1.1
{
"base_script_file": "vpcs_base_config.txt",
"category": "guest",
"compute_id": "local",
"console_auto_start": false,
"console_type": "telnet",
"default_name_format": "PC{0}",
"name": "VPCS_TEST_RENAMED",
"symbol": ":/symbols/vpcs_guest.svg",
"template_id": "7b448d0f-a756-421d-9c97-8a339e5ec6c2",
"template_type": "vpcs"
}
HTTP/1.1 200
Connection: close
Content-Length: 386
Content-Type: application/json
Date: Wed, 08 Jan 2020 02:29:20 GMT
Server: Python/3.6 GNS3/2.2.4dev1
X-Route: /v2/templates/{template_id}
{
"base_script_file": "vpcs_base_config.txt",
"builtin": false,
"category": "guest",
"compute_id": "local",
"console_auto_start": false,
"console_type": "telnet",
"default_name_format": "PC{0}",
"name": "VPCS_TEST_RENAMED",
"symbol": ":/symbols/vpcs_guest.svg",
"template_id": "7b448d0f-a756-421d-9c97-8a339e5ec6c2",
"template_type": "vpcs"
}
DELETE /v2/templates/{template_id}¶
Delete an template
Parameters¶
- template_id: template UUID
Response status codes¶
- 204: Template deleted
- 400: Invalid request
- 404: Template doesn’t exist
Sample session¶
curl -i -X DELETE 'http://localhost:3080/v2/templates/a12e443e-7e32-432b-a256-0a4587e24bec'
DELETE /v2/templates/a12e443e-7e32-432b-a256-0a4587e24bec HTTP/1.1
HTTP/1.1 204
Connection: close
Content-Length: 0
Content-Type: application/octet-stream
Date: Wed, 08 Jan 2020 02:29:20 GMT
Server: Python/3.6 GNS3/2.2.4dev1
X-Route: /v2/templates/{template_id}