Get List of vCenter Templates

To get a list of vCenter templates in your cloud, use the following request:

1
2
GET /vcenter/templates.xml
GET /vcenter/templates.json

XML Request example

1
curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/vcenter/templates.xml

JSON Request Example

1
curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password --url http://onapp.test/vcenter/templates.json

XML Output Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<vcenter_image_templates type="array">
	<vcenter_image_template>
		<id type="integer">538</id>
		<label>win2016</label>
		<created_at type="dateTime">2019-10-18T12:39:27+03:00</created_at>
		<updated_at type="dateTime">2019-10-18T12:39:27+03:00</updated_at>
		<version>1.0</version>
		<file_name>win2016</file_name>
		<operating_system>windows</operating_system>
		<operating_system_distro>2016</operating_system_distro>
		<allowed_swap type="boolean">true</allowed_swap>
		<state>pending</state>
		<checksum nil="true"/>
		<allow_resize_without_reboot nil="true"/>
		<min_disk_size type="integer">1</min_disk_size>
		<user_id nil="true"/>
		<template_size type="integer">0</template_size>
		<allowed_hot_migrate type="boolean">false</allowed_hot_migrate>
		<operating_system_arch nil="true"/>
		<operating_system_edition nil="true"/>
		<operating_system_tail nil="true"/>
		<parent_template_id nil="true"/>
		<virtualization type="array"/>
			<virtualization>vcenter</virtualization>
		</virtualization>
		<min_memory_size type="integer">8192</min_memory_size>
		<disk_target_device nil="true"/>
		<cdn type="boolean">false</cdn>
		<backup_server_id nil="true"/>
		<ext4 type="boolean">false</ext4>
		<smart_server type="boolean">false</smart_server>
		<baremetal_server type="boolean">false</baremetal_server>
		<initial_password nil="true"/>
		<initial_username nil="true"/>
		<remote_id nil="true"/>
		<manager_id nil="true"/>
		<resize_without_reboot_policy nil="true"/>
		<application_server type="boolean">false</application_server>
		<draas type="boolean">false</draas>
		<properties>
			<nics type="integer">1</nics>
		</properties>
		<locked type="boolean">false</locked>
		<openstack_id nil="true"/>
		<datacenter_id type="integer">489</datacenter_id>
		<identifier>vm-2374</identifier>
		<type>VCenter::ImageTemplate</type>
	</vcenter_image_template>
</vcenter_image_templates>

Where:

id - the ID of the vCenter template

label - the label of the vCenter template

created_at - the date when the VS was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

updated_at - the date when the VS was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

version - version of the template file

file_name - the name of the template file

operating_system - the operating system’s name

operating_system_distro - the operating system’s distribution

allowed_swap - true if swap is allowed; otherwise, false

state - state of the template (active, inactive, pending)

checksum - file checksum

allow_resize_without_reboot - true if resize without reboot is allowed; otherwise, false

min_disk_size - minimum disk size required to build a VS on this template (GB)

user_id - the ID of a template’s user in OnApp

template_size - the size of the template

allowed_hot_migrate - true if hot migration for the VS is allowed; otherwise, false

operating_system_arch - architecture of the operating system

operating_system_edition - edition of the OS

operating_system_tail - tail of the OS

parent_template_id - the ID of the target template group

virtualization - type of virtualization (xen, kvm, or kvm_virtio) which is compatible with this template

min_memory_size - minimum memory size required to build a VS on this template (MB)

disk_target_device - the prefix indicating the method of translating the disk to a VS by compute resource

cdn - true if this template can be used for building edge servers; otherwise, false

backup_server_id - the ID of the backup server

ext4 - true if ext4 file system is supported; otherwise, false

smart_server - true if a smart server can be built from this template; otherwise, false

baremetal_server - true if a baremetal server can be built from this template; otherwise, false

initial_password - the initial password for the template on the vCenter side

initial_username - the initial username for the template on the vCenter side

remote_id - ID of the template on the vCenter side

manager_id - ID of the template on the template server

resize_without_reboot_policy - the hot resize possibility for a particular template considering its OS version and virtualization type

application_server - true if an application server can be built from this template; otherwise, false

draas - true if DRaaS is allowed; otherwise, false

properties - the attributes of template

nics - the array of parameters associated with the NICs

locked - true if the template is locked; otherwise, false