ServerMania logo

Add Child Group

To add a child group to a template group, use the following request:

POST http://test/settings/image_template_groups.xml
POST http://test/settings/image_template_groups.json

XML Request Example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<image_template_group><label>zaza</label><parent_id>100</parent_id><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>enother</kms_server_label></image_template_group>' --url http://test/settings/image_template_groups.xml

JSON Request Example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"image_template_group":{"label":"zaza_ch1", "parent_id":"100", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --url http://test/settings/image_template_groups.json

XML Response Example

HTTP/1.1 201 Created

Date: Fri, 13 Jul 2012 13:19:41 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9
X-UA-Compatible: IE=Edge,chrome=1
ETag: "6bb2b9cec5a8bd44242ebd0217ac8da5"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: eb23f46901cecec2a898a6e50454196d
X-Runtime: 0.142129
X-Rack-Cache: invalidate, pass
Set-Cookie: _session_id=b5979762702346b086aa13538e60c2e4; path=/; HttpOnly
Location: http://83.170.110.181/settings/image_template_groups/104
Status: 201
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml; charset=utf-8

XML Output Example

<image_template_group>
  <created_at type="datetime">2012-07-13T03:19:41-10:00</created_at>
  <depth type="integer">1</depth>
  <id type="integer">104</id>
  <kms type="boolean">true</kms>
  <kms_host>ededde.fe</kms_host>
  <kms_port>5453</kms_port>
  <kms_server_label>enother</kms_server_label>
  <label>zaza</label>
  <lft type="integer">80</lft>
  <mak type="boolean">true</mak>
  <own type="boolean">false</own>
  <parent_id type="integer">100</parent_id>
  <rgt type="integer">81</rgt>
  <updated_at type="datetime">2012-07-13T03:19:41-10:00</updated_at>
</image_template_group>


Where:

image_template_group - the image template array with the following parameters:

label – the group name

created_at – the date when the  group was created

id - template group id

kms_host – KMS server host name

kms_port – KMS server port

kms_server_label – KMS server name

mak - MAK windows licensing type

own - user's own license

parent_id - id of the target template group

depth - the depth of a given node (distance from this group to the root)

lft - left nested set identifier

rgt - right nested set identifier

updated_at – the date when the template group was updated

To edit or delete a child group, use the same requests as for template groups.