ServerMania logo

Add My Template Group

To add a template group, use the following request:

POST /settings/image_template_groups.xml
POST /settings/image_template_groups.json

XML Request Example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password -d '<image_template_group><user_id>2</user_id><label>zaza</label><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>wqqsasawqw</kms_server_label></image_template_group>' --urlhttp://test/settings/image_template_groups.xml

JSON Request Example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password -d '{"image_template_group":{"user_id":"2", "label":"zaza", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --urlhttp://test/settings/image_template_groups.json

Where:

label * – the name of the template group
mak – MAK windows licensing type
own – user’s own license for Windows licensing
kms – KMS Windows licensing type
kms_server_label – name of the KMS licensing server; required parameter if the KMS licensing type was selected
kms_host - KMS server hostname; required parameter if the KMS licensing type was selected
kms_port – KMS server port; required parameter if the KMS licensing type was selected
user_id * – user, to whom this group belongs

Returns 201 HTTP response on success

XML Output Example

<image_template_group>
  <created_at type="datetime">2012-07-13T03:55:21-10:00</created_at>
  <depth type="integer">0</depth>
  <id type="integer">106</id>
  <kms type="boolean">true</kms>
  <kms_host>ededde.fe</kms_host>
  <kms_port>5453</kms_port>
  <kms_server_label>wqqsasawqw</kms_server_label>
  <label>zaza</label>
  <lft type="integer">85</lft>
  <mak type="boolean">true</mak>
  <own type="boolean">false</own>
  <parent_id nil="true"></parent_id>
  <rgt type="integer">86</rgt>
  <updated_at type="datetime">2012-07-13T03:55:21-10:00</updated_at>
  <system_group type="boolean">false</system_group>
  <hypervisor_group_id nil="true"/>
  <user_id type="integer">2508</user_id>
  <children type="array"/>
  <relations type="array"/>
</image_template_group>