Get List of User Templates

To get a list of user templates, use the following request:

1
2
GET /templates/user.xml
GET /templates/user.json
Contrary to the System templates, the Custom templates parent_template_id parameter indicates the ID of a system template, which has been converted into a custom one.

XML Request Example

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

JSON Request Example

1
curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/user.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
<image_templates type="array">
  <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>xen,kvm</virtualization>
  </image_template>
  <image_template>...</image_template>
</image_templates>

Where:

  • allowed_resize_without_reboottrue if resize without reboot is allowed; otherwise, false.

  • allowed_hot_migratetrue if hot migration is allowed; otherwise, false.

  • allowed_swaptrue if swap is allowed; otherwise, false.

  • backup_server_id — the ID of the backup server where the template is stored.

  • baremetal_servertrue if the baremetal server can be built from this template.

  • cdntrue 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.

  • ext4true 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 — the ID of a system template, which has been converted into a custom one.

  • 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:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    <resize_without_reboot_policy>
      <xen>
    entos5 type="integer">14</centos5>
    entos6 type="integer">14</centos6>
    xen>
    vm>
    entos5 type="integer">12</centos5>
    entos6 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_servertrue 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.