ServerMania logo

Get List of Recipe Groups

To view the list of recipe groups, use the following request:

GET /recipe_groups.xml
GET /recipe_groups.json

XML Request Example

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

JSON Request Example

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

XML Output Example

<objects type="array">
 <object>
  <id type="integer">2</id>
  <label>qayd</label>
  <parent_id nil="true"/>
  <lft type="integer">11</lft>
  <rgt type="integer">12</rgt>
  <depth type="integer">0</depth>
  <created_at type="datetime">2013-05-24T11:50:19+03:00</created_at>
  <updated_at type="datetime">2013-05-24T11:50:19+03:00</updated_at>
  <children type="array"/>
  <relations type="array">
   <relation>
    <id type="integer">1</id>
    <recipe_id type="integer">1</recipe_id>
    <recipe_group_id type="integer">2</recipe_group_id>
    <created_at type="datetime">2013-05-24T11:50:27+03:00</created_at>
    <updated_at type="datetime">2013-05-24T11:50:27+03:00</updated_at>
    <recipe>
     <id type="integer">1</id>
     <user_id type="integer">6</user_id>
     <created_at type="datetime">2013-04-19T10:26:41+03:00</created_at>
     <updated_at type="datetime">2013-05-13T13:08:00+03:00</updated_at>
     <label>Apache example</label>
     <description>Apache example</description>
     <script_type>bat</script_type>
     <compatible_with>unix</compatible_with>
    </recipe>
   </relation>
  </relations>
 </object>
</objects>


Where:

objects - the array of recipe groups with the following parameters:

label – the group name

id - recipe group ID

label - template group name

parent_id - id of the target recipe group

lft - left nested set identifier

rgt - right nested set identifier

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

created_at – the date when the recipe group was created

updated_at – the date when the recipe group was updated

children - the array of child recipe groups

relations - the array of recipes assigned to the recipe groups with the following parameters:

  • id - relation ID
  • user_id - ID of a recipe owner
  • created_at – the date when the recipe group was created
  • updated_at – the date when the recipe group was updated
  • recipe - an array of recipe parameters:
    • id - recipe ID
    • user_id - ID - the ID of a recipe owner
    • created_at – the date when the recipe was created

    • updated_at – the date when the recipe was updated

    • label - recipe label 

    • script_type - script type for Windows-compatible recipes:

      • bat 
      • vbs 
      • powershell
    • compatible_with - recipe compatibility: windows or unix