api.template.base
¶
/template¶
-
api.template.base.views.
template_list
(*args, **kwargs)¶ List (
GET
) all server templates.-
GET
/template
¶ DC-bound?: Permissions: Asynchronous?: Parameters: - data.full (boolean) – Return list of objects with all server template details (default: false)
- data.extended (boolean) – Return list of objects with extended server template details (default: false)
- data.order_by (string) – Available fields for sorting:
name
,created
(default:name
)
Status Codes: - 200 OK – SUCCESS
- 403 Forbidden – Forbidden
-
/template/(name)¶
-
api.template.base.views.
template_manage
(*args, **kwargs)¶ Show (
GET
), create (POST
) update (PUT
) or delete (DELETE
) a server template.Note
Server templates are only loosely validated during creation and updating. Whether a server template will be correctly applied to a virtual server depends on various circumstances during server definition and deployment (e.g. availability of compute nodes, storages, networks, server images, users and other resources in a virtual datacenter).
-
GET
/template/
(name)¶ DC-bound?: Permissions: - TemplateAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server template name
- data.extended (boolean) – Display extended server template details (default: false)
Status Codes: - 200 OK – SUCCESS
- 403 Forbidden – Forbidden
- 404 Not Found – Template not found
- TemplateAdmin -
-
POST
/template/
(name)¶ DC-bound?: Permissions: - TemplateAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server template name
- data.alias (string) – Short server template name (default:
name
) - data.access (integer) – Access type (1 - Public, 3 - Private, 4 - Deleted) (default: 3)
- data.owner (string) – User that owns the server template (default: logged in user)
- data.desc (string) – Template image description
- data.ostype (integer) – Operating system type (null - all OS types, 1 - Linux VM, 2 - SunOS VM, 3 - BSD VM, 4 - Windows VM, 5 - SunOS Zone, 6 - Linux Zone) (default: null)
- data.dc_bound (boolean) – Whether the server template is bound to a datacenter (requires SuperAdmin permission) (default: true)
- data.dc (string) – Name of the datacenter the server template will be attached to (required if DC-bound)
- data.vm_define (object) –
Server definition object
(default: {}) - data.vm_define_disk (array) – List of
server disk definition objects
(default: []) - data.vm_define_nic (array) – List of
server NIC definition objects
(default: []) - data.vm_define_snapshot (array) – List of
server snapshot definition objects
(default: []) - data.vm_define_backup (array) – List of
server backup definition objects
(default: [])
Status Codes: - 201 Created – SUCCESS
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – Datacenter not found
- 406 Not Acceptable – Template already exists
- TemplateAdmin -
-
PUT
/template/
(name)¶ DC-bound?: Permissions: - TemplateAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server template name
- data.alias (string) – Short server template name
- data.access (integer) – Access type (1 - Public, 3 - Private, 4 - Deleted)
- data.owner (string) – User that owns the server template
- data.desc (string) – Template image description
- data.ostype (integer) – Operating system type (null - all OS types, 1 - Linux VM, 2 - SunOS VM, 3 - BSD VM, 4 - Windows VM, 5 - SunOS Zone, 6 - Linux Zone)
- data.dc_bound (boolean) – Whether the server template is bound to a datacenter (requires SuperAdmin permission)
- data.vm_define (object) –
Server definition object
- data.vm_define_disk (array) – List of
server disk definition objects
- data.vm_define_nic (array) – List of
server NIC definition objects
- data.vm_define_snapshot (array) – List of
server snapshot definition objects
- data.vm_define_backup (array) – List of
server backup definition objects
Status Codes: - 200 OK – SUCCESS
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – Template not found
- TemplateAdmin -
-
DELETE
/template/
(name)¶ Note
A server template cannot be deleted when it is used by even one virtual server. In order to disable further use of such a server template, the template can be marked as deleted by
changing its access property to deleted (4)
.DC-bound?: Permissions: - TemplateAdmin -
dc_bound=true
- SuperAdmin -
dc_bound=false
Asynchronous?: Parameters: - name (string) – required - Server template name
Status Codes: - 200 OK – SUCCESS
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – Template not found
- 428 – Template is used by some VMs
- TemplateAdmin -
es create /template/linux-small1 -ostype 1 -vm_define 'json::{"vcpus": 1, "ram":512}' -vm_define_disk 'json::[{"size": "10240"}]' -vm_define_snapshot 'json::[{"name": "hourly", "disk_id": 1, "retention": 48, "desc": "Automatic hourly snapshot of 1st disk"}]'
{ "url": "https://my.erigones.com/api/template/linux-small1/", "status": 201, "method": "POST", "text": { "status": "SUCCESS", "result": { "vm_define_snapshot": [ { "desc": "Automatic hourly snapshot of 1st disk", "name": "hourly", "disk_id": 1, "retention": 48 } ], "name": "linux-small1", "created": "2016-11-11T15:15:16.079537Z", "vm_define_backup": [], "access": 3, "alias": "linux-small1", "dc_bound": false, "vm_define_disk": [ { "size": "10240" } ], "vm_define_disk": [], "ostype": 1, "owner": "admin", "vm_define_nic": [], "vm_define": { "vcpus": 1, "ram": 512 }, "desc": "" }, "task_id": "1d1u23-6f75849b-f4a3-4c29-8fd9" } }
-