ServerMania logo

Get List of Templates Attached to Group

To get the list of templates attached to a template group, use the following request:

GET http://test/settings/image_template_groups/:id/relation_group_templates.xml
GET http://test/settings/image_template_groups/:id/relation_group_templates.json

XML Request Example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://test/settings/image_template_groups/98/relation_group_templates.xml

JSON Request Example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://test/settings/image_template_groups/98/relation_group_templates.json

XML Output Example

<relation_group_templates type="array">
  <relation_group_template>
    <created_at type="datetime">2012-07-13T03:27:32-10:00</created_at>
    <id type="integer">98</id>
    <image_template_group_id type="integer">105</image_template_group_id>
    <price type="decimal">60.0</price>
    <template_id type="integer">26</template_id>
    <updated_at type="datetime">2012-07-13T03:48:15-10:00</updated_at>
    <image_template>
      <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
      <allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
      <allowed_swap type="boolean">true</allowed_swap>
      <backup_server_id nil="true"></backup_server_id>
      <cdn type="boolean">false</cdn>
      <checksum>0330b86693ac90ddac6001dfa61d6ba0</checksum>
      <created_at type="datetime">2012-06-06T22:17:49-10:00</created_at>
      <disk_target_device>---
xen: xvda
kvm: hd
</disk_target_device>
      <ext4 type="boolean">true</ext4>
      <file_name>archlinux-2011.08-x64-1.0-xen.kvm.kvm_virtio.tar.gz</file_name>
      <id type="integer">26</id>
      <label>Arch Linux 2011.08 x64</label>
      <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>archlinux</operating_system_distro>
      <operating_system_edition nil="true"></operating_system_edition>
      <operating_system_tail nil="true"></operating_system_tail>
      <parent_template_id nil="true"></parent_template_id>
      <state>active</state>
      <template_size type="integer">306940</template_size>
      <updated_at nil="true"></updated_at>
      <user_id nil="true"></user_id>
      <version>1.0</version>
      <virtualization>xen,kvm,kvm_virtio</virtualization>
    </image_template>
  </relation_group_template>
</relation_group_templates>


Where:

created_at – the date when the template was created

id – the ID of this relation

image_template_group_id– the ID of template group to which this template is attached

price – the price for the template attached to this template group

template_id – the ID of a template attached to this template group

updated_at – the date when the template group was updated

allow_resize_without_reboot — true if resize without reboot is possible; otherwise false

image_template - an array of image template with the following parameters:

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

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

allowed_swap - true, if the swap is allowed, otherwise false

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

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

checksum – file checksum

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

file_name – the name of the template file

id - the template ID

label - template label

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

operating_system – operating system name

operating_system_distro – operating system distribution

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 – true if this is a system template

state – state of the template (active, inactive)

template size - the size of the template

updated_at – the date when the template was updated

user_id - the ID of a user who owns this template

version – version of the file

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