ServerMania logo

Get Recipe Details

To view recipe details, use the following request:

GET /recipes/:recipe_id.xml
GET /recipes/:recipe_id.json

XML Request Example

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

JSON Request Example

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

XML Output Example

<recipe>
 <compatible_with>unix</compatible_with>
 <created_at type="datetime">2012-10-22T12:46:49+00:00</created_at>
 <description>Create initial folder structure</description>
 <id type="integer">1</id>
 <label>Create folders</label>
 <script_type>vbs</script_type>
 <updated_at type="datetime">2012-10-22T12:46:49+00:00</updated_at>
 <user_id type="integer">2</user_id>
 <recipe_steps type="array">
  <recipe_step>
   <created_at type="datetime">2012-10-22T12:46:49+00:00</created_at>
   <fail_anything_else type="boolean">true</fail_anything_else>
   <fail_values/>
   <failure_goto_step type="integer">2</failure_goto_step>
   <id type="integer">1</id>
   <number type="integer">1</number>
   <on_failure>goto_step</on_failure>
   <on_success>proceed</on_success>
   <pass_anything_else type="boolean">false</pass_anything_else>
   <pass_values type="boolean">true</pass_values>
   <recipe_id type="integer">1</recipe_id>
   <result_source>exit_code</result_source>
   <script>mkdir /tmp</script>
   <success_goto_step nil="true"/>
   <updated_at type="datetime">2012-10-22T12:46:49+00:00</updated_at>
  </step>
 </steps>
</recipe>

Where:

compatible_with - recipe compatibility: windows or unix

created_at — the date when the recipe was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

description - recipe description

id - recipe ID

label - recipe label

script_type - script type for Windows-compatible recipes:

  • bat 
  • vbs 
  • powershell (PowerShell v1.0)

updated_at — the date when the recipe was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

use_on_hv_zones - true, if the recipe can be used on compute zones, otherwise false

use_on_vms - true, if the recipe can be used on virtual servers, otherwise false

user_id — the ID of a recipe owner

recipe_steps - an array of recipe steps with the following details:

  • created_at — the date when the step was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

  • updated_at — the date when the step was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

  • fail_anything_else - set true, if you have specified the recipe pass value, otherwise set false

    You can only specify behavior for one scenario: for example, if the fail_anything_else = false, pass_anything_else must be set to true.
  • fail_values - recipe fail value

  • failure_goto_step - if the on_failure parameter = goto_step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

  • id - step ID

  • number - step number

  • on_failure - step behavior in case of failure:

    • proceed - proceed to the next step.
    • fail - terminate the recipe and mark it as failed.
    • stop - terminate the recipe and mark it as successful.
    • go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

  • on_success - step behavior in case of success:

    • proceed - proceed to the next step.
    • fail - terminate the recipe and mark it as failed.
    • stop - terminate the recipe and mark it as successful.
    • go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

  • pass_anything_ else -  set true, if you have specified the recipe fail value, otherwise set false

  • pass_values - recipe pass value

  • recipe_id - ID of a recipe the step belongs to

  • result_source - step result source:

    • exit_code - an exit status, e.g. 0 will be returned on success

    • std_out - standard output
    • std_err - standard error
    • std_out_and_std_err - standard output and standard error
  • success_goto_step - if the on_success parameter = goto_step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.


Page History

v6.1

  • added the script parameter