ServerMania logo

Get Template Details

To get the details of a particular template, use the following request:

GET /templates/:template_id.xml
GET /templates/:template_id.json

XML Request Example

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

JSON Request Example

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

XML Output Example

<image_template>
<allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
<allowed_hot_migrate type="boolean">false</allowed_hot_migrate>
<allowed_swap type="boolean">true</allowed_swap>
<backup_server_id nil="true"/>
<baremetal_server type="boolean">true</baremetal_server>
<cdn type="boolean">false</cdn>
<checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum>
<created_at type="datetime">2012-04-03T14:30:59+00:00</created_at>
<disk_target_device>---xen: xvda kvm: hd</disk_target_device>
<ext4 type="boolean">false</ext4>
<file_name>centos-6.2-x64-1.0.tar.gz</file_name>
<id type="integer">1</id>
<initial_password>Password1</initial_password>
<initial_username>root</initial_username>
<label>CentOS 6.2 x64</label>
<manager_id>centos5.11x64</manager_id>
<min_disk_size type="integer">5</min_disk_size>
<min_memory_size type="integer">128</min_memory_size>
<operating_system>linux</operating_system>
<operating_system_arch>x64</operating_system_arch>
<operating_system_distro>rhel</operating_system_distro>
<operating_system_edition nil="true"/>
<operating_system_tail nil="true"/>
<parent_template_id nil="true"/>
<remote_id nil="true"/>
<resize_without_reboot_policy></resize_without_reboot_policy>
<smart_server type="boolean">true</smart_server>
<state>inactive</state>
<template_size type="integer">271308</template_size>
<updated_at nil="true"/>
<user_id nil="true"/>
<version>1.0</version>
<virtualization type="array">
<virtualization>xen</virtualization>
<virtualization>kvm</virtualization>
</virtualization>
</image_template> 

Where:

allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise false

allowed_hot_migrate – true if hot migration is allowed, otherwise false

allowed_swap – true if swap is allowed, otherwise false

backup_server_id – the ID of the backup server where the template is stored

baremetal_server - true if the baremetal server can be built from this template

cdn – true if this template can be used for building edge servers. Otherwise false.

checksum – file checksum

created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

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

ext4 - true if ext4 file system is supported

file_name – the name of the template file

id – ID of template

initial_password - the password set for the VS built on this template

initial_username - the username set for the VS built on this template

label – the template title

manager_id - ID of the template on the template server

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

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

operating_system – operating system name

operating_system_arch – architecture of the operating system

operating_system_distro – operating system distribution

operating_system_edition – edition of the OS

operating_system_tail – tail of the OS

parent_template_id – true if this is a system template

remote_id - ID of the template, if it came from the market

resize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy>
	<xen>
		<centos5 type="integer">14</centos5>
		<centos6 type="integer">14</centos6>
	</xen>
	<kvm>
		<centos5 type="integer">12</centos5>
		<centos6 type="integer">0</centos6>
	</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where:

  • 1st bit defines the ability to increase cpu
  • 2nd bit defines the ability to decrease cpu
  • 3rd bit defines the ability to increase RAM
  • 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size-  the size of the template

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

user_id - the ID of a user who owns this template

version – version of the file

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