GET /virtual_machines/:virtual_machine_id/recipe_joins

Gets all recipes assigned to specified VS

Sections:

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

    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

 curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}}' -u user:userpass <api_url>/virtual_machines/:virtual_machine_id/recipe_joins.json

JSON Response

 {
    "vm_provisioning": [
        {
            "recipe": {
                "recipe_joins": {
                    "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"
                            }
                        }
                    ]
                }
            },
            "join": {
                "recipe_joins": {
                    "created_at": "2015-08-31T18:32:02+00:00",
                    "event_type": "vm_provisioning",
                    "id": 1,
                    "recipe_id": 8,
                    "target_join_id": 511,
                    "target_join_type": "VirtualMachine",
                    "updated_at": "2015-08-31T18:32:02+00:00"
                }
            }
        }
    ]
}

XML Request example

 curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type></recipe_join>' -u user:userpass <api_url>/virtual_machines/:virtual_machine_id/recipe_joins.xml