Page tree
Skip to end of metadata
Go to start of metadata

API Essentials

API Key Generation

Autoscaling

Backups

Credit

DNS

Firewall Rules

Flex Cloud VM Control

Getting Started with Superb Flex Cloud

IP Addresses

Logs

Network Interfaces

Recipes

SSH Keys

Templates

Test Route

Troubleshooting API Issues

Viewing Activity Logs

Virtual Server Operating Systems

Virtual Servers

VS Disks

/recipes/:recipe_id/recipe_steps 

Adds a step (script) to specified recipe

Sections:

Request Parameters

script - recipe step code

result_source - step result source:

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

    To use exit code in the VBS or PowerShell scripts, you have to specify it directly in the script. For example:

    VBS
    Script:
    WScript.Echo "test"
    WScript.Quit 95

    PowerShell
    Script:
    get-date -displayhint date
    exit 227

  • std_out - standard output
  • std_err - standard error
  • std_out_and_std_err - standard output and standard error

pass_anything_else -  set true, if you have specified the recipe fail value, otherwise set false

pass_values - step pass value

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.

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.

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

fail_values - step fail value

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.

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.

You can only specify behavior for one scenario: for example, if the fail_anything_else = falsepass_anything_else must be set to true.

Response Parameters

201 status is returned on success


JSON Request example

curl -i -X POST -u user:userpass <api_url>/recipes/:recipe_id/recipe_steps.json -d '{"recipe_step":{"script":"uptime >/tmp/uptime.log", "result_source":"exit_code","pass_anything_else":"0","pass_values":"0","on_success":"proceed","success_goto_step":"","fail_anything_else":"1","fail_values":"","on_failure":"proceed",
"failure_goto_step":""}}' -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example

 curl -i -X POST -u user:userpass <api_url>/recipes/:recipe_id/recipe_steps.xml -d '<recipe_step><script>uptime&gt;/tmp/uptime.log</script><result_source>exit_code</result_source><pass_anything_else>0</pass_anything_else><pass_values>0</pass_values><on_success>proceed</on_success><success_goto_step></success_goto_step><fail_anything_else>1</fail_anything_else><fail_values></fail_values><on_failure>proceed</on_failure><failure_goto_step></failure_goto_step></recipe_step>' -H 'Accept: application/xml' -H 'Content-type: application/xml'
  • No labels