Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
alltrue
styleh3
pageSuperb Cloud API

GET /recipes

Get list of recipes

Sections:

Table of Contents
maxLevel4
minLevel2
includeResponse.*|JSON.*|XML.*|Explanation.*

Response Parameters

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 hypervisor 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

    Note

    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_failurparameter = go to 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 = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.


JSON Request example

Code Block
languagebash
themeRDark
 GET /recipes.json

JSON Response

Code Block
 [
    {
        "recipe": {
            "compatible_with": "unix",
            "created_at": "2015-08-29T00:34:33+00:00",
            "description": "Does Stuff",
            "id": 8,
            "label": "Test Recipe",
            "script_type": "bat",
            "updated_at": "2015-08-29T00:34:33+00:00",
            "user_id": 337,
            "recipe_steps": [
                {
                    "recipe_step": {
                        "created_at": "2015-08-29T00:36:30+00:00",
                        "fail_anything_else": true,
                        "fail_values": "",
                        "failure_goto_step": null,
                        "id": 2,
                        "number": 1,
                        "on_failure": "proceed",
                        "on_success": "proceed",
                        "pass_anything_else": false,
                        "pass_values": "Success",
                        "recipe_id": 8,
                        "result_source": "exit_code",
                        "script": "#!/bin/bash\r\n# My first script\r\necho \"Hello World!\"\r\n",
                        "success_goto_step": null,
                        "updated_at": "2015-08-29T00:36:30+00:00"
                    }
                },
                {
                    "recipe_step": {
                        "created_at": "2015-08-29T00:50:59+00:00",
                        "fail_anything_else": false,
                        "fail_values": "This Failed",
                        "failure_goto_step": null,
                        "id": 3,
                        "number": 2,
                        "on_failure": "fail",
                        "on_success": "proceed",
                        "pass_anything_else": true,
                        "pass_values": "",
                        "recipe_id": 8,
                        "result_source": "exit_code",
                        "script": "#!/bin/bash\r\n# My first script\r\n\r\necho \"Goodbye World!\"",
                        "success_goto_step": null,
                        "updated_at": "2015-08-29T00:51:10+00:00"
                    }
                }
            ]
        }
    }
]

XML Request example

Code Block
languagebash
themeRDark
 GET /recipes.xml

XML Response example

Code Block
languagexml
 <?xml version="1.0" encoding="UTF-8"?>
<recipes>
 <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>
   </recipe_step>
  </recipe_steps>
 </recipe>
</recipes>