Decorators¶
- cloudify.decorators.operation(func=None, resumable=False, **kwargs)[source]¶
This decorator is not required for operations to work.
Use this for readability, and to add additional markers for the function (eg. is it resumable).
- cloudify.decorators.workflow(func=None, system_wide=False, resumable=False, **kwargs)[source]¶
This decorator should only be used to decorate system wide workflows. It is not required for regular workflows.
- cloudify.decorators.serial_operation(threshold=0, workflows=None, states=None, **op_kwargs)[source]¶
- Control order of multiple node instances of a single node template.
Normally, multiple node instance operations will be executed in parallel. However, some cases, like clusters require that cluster members are installed serially.
- Parameters:
threshold – Switch back to parallel execution after n node instances. Integer. 0: Never use parallel. Always straight serial. 1: After 1 node is installed, return to Parallel. Default. n + 1: After n node instances.
workflows – List of workflows to apply serialization to. The default is [‘install’]. This means we scale will execute in parallel.
states – List of states that the preceding node instance may be in before executing the current node instance. The default is [‘started’]. We will only continue to next instance after the preceding instance is in “started” state.
- Raises:
CloudifySerializationRetry.
- Returns:
decorator wrapper