Wrapper bundle
The Wrapper bundle contains several useful wrappers.
Please refer to Wrappers for details on how wrappers work within Cloudomation.
Download
Download the bundle here (right click and select "Save link as...").
Please refer to Importing records for documenation on how to import a bundle to your Cloudomation workspace.
Included example wrappers
Retry
The retry wrapper can be used for executions which sometimes fail due to external factors. When used without additional configuration it will start the child execution up to three times with a 10 second delay in between tries.
Parameters
Parameter | Description | Default value |
---|---|---|
max_tries | The number of times to try starting the child before failing. | 3 |
delay_sec | The number of seconds to wait in between retries. | 10 |
timeout_sec | Fail, if the child did not succeed within the timeout. Set to 0 to disable. | 0 |
archive_retries | Archive failed retries. | True |
Notify
The notify wrapper observes a child execution and generates notifications on end.
Parameters
Parameter | Description | Default value |
---|---|---|
notify_on_success | If a notification should be generated when the child ends with ENDED_SUCCESS . | False |
notify_on_error | If a notification should be generated when the child ends with ENDED_ERROR or ENDED_CANCELLED . | True |
to | A list of Cloudomation user names who will receive notifications. | None |
subject | The subject line of the email. | {child_name} {child_status} |
body | The email body. | <p>Execution <a href="{self_url}/execution/{child_id}">{child_name}</a> ended with status <strong>{child_status}</strong></p><pre>{child_message}</pre> |
The following substitutions are performed on the subject
and body
parameters
Placeholder | Description |
---|---|
{child_name} | The name of the child execution. |
{child_id} | The ID of the child execution. |
{child_status} | The end status of the child execution. |
{child_message} | The end message of the child execution. |
{self_url} | The URL to the workspace where the execution was running. |
Timeout
The timeout wrapper starts a child execution and waits for it to end within a timeout. If the timeout is exceeded, the child execution and all descendants are cancelled.
Parameters
Parameter | Description | Default value |
---|---|---|
seconds | The number of seconds before a timeout occurs. | 60 |
Interactive
The interactive wrapper observes a child execution and, in case of an error, allows an operator to decide if to retry, ignore the error or fail.
Parameters
Parameter | Description | Default value |
---|---|---|
interactive_limit_minutes | After how many minutes of inactivity a Cloudomation user is considered "away". | 30 |
archive_retries | Archive failed retries. | True |
Check
The check wrapper can be used to verify if a child execution succeeded by analyzing the output_value of the child execution.
Parameters
Parameter | Description | Default value |
---|---|---|
checker_flow | The name of a flow which performs the validation of the child's output_value. | None |
checker_script | A flow script which performs the validation of the child's output_value. | None |
checker | An alias for checker_script . | None |
inputs | Additional inputs passed to the checker flow or script. | None |
Mock
The mock wrapper can be used to return an output_value without running the child.
Parameters
Parameter | Description | Default value |
---|---|---|
mode | One of ENDED_SUCCESS , ENDED_ERROR , LAST , STATIC , or FIXED . | ENDED_SUCCESS |
ignore_in_productive_mode | When set and run in productive mode, the child will not be mocked but started normally. | True |
output_value | The output_value to return. Required for mode STATIC . | None |
execution_id | The ID of the execution of which the output_value to return. Required for mode FIXED . | None |
Modes
ENDED_SUCCESS
Looks for the last successful execution of the child and returns its output_value.
ENDED_ERROR
Looks for the last failed execution of the child and returns its output_value.
LAST
Looks for the last execution of the child and returns its output_value.
STATIC
Returns the output_value which is configured in the output_value parameter of the wrapper.
FIXED
Returns the output_value of the execution which is specified using the execution_id parameter of the wrapper.
Cache
The cache wrapper caches the output_value of a child execution for a defined time. Multiple calls to the same child execution within the timeframe will return the same output_value without actually calling the external system.
Parameters
Parameter | Description | Default value |
---|---|---|
max_age_minutes | How many minutes a previously fetched output_value remains valid before re-fetching it. | 60 |
Validate
The validate wrapper can be used to validate the input_value or output_value of the child against a json schema or to create/extend a json schema based on the input_value or output_value.
Parameters
Parameter | Description | Default value |
---|---|---|
schema_name | The name of the json schema that should be used for the wrapper. | None |
mode | One of complain , learn . | complain |
point_of_validation | One of input , output . Controls whether the input_value or output_value of the child is used by the wrapper. | input |
Modes
complain
Validates the input_value or output_value of the child against a json schema and raises a SchemaValidationError
on failed validation.
learn
Creates a json schema from the input_value or output_value of the child. If flow_api.schema.Schema(<schema_name>)
exists it gets updated so that it accommodates its old schema and the newly learned schema. Otherwise flow_api.schema.Schema(<schema_name>)
is created with the newly learned schema.
Rollback
The rollback wrapper can be used to execute a rollback flow if the original flow fails. In this case the wrapper passes the id
, status
and message
of the original flow to the rollback flow. Finally, the wrapper raises the DependencyFailedError
of the original flow.
Parameters
Parameter | Description | Default value |
---|---|---|
rollback_flow_name | The name of the flow that should be executed in case of a DependencyFailedError . | None |