Executions API¶
-
class
cloudify_rest_client.executions.
Execution
(execution)[source]¶ Bases:
dict
Cloudify workflow execution.
-
id
¶ Returns: The execution’s id.
-
deployment_id
¶ Returns: The deployment’s id this execution is related to.
-
status
¶ Returns: The execution’s status.
-
error
¶ Returns: The execution error in a case of failure, otherwise None.
-
workflow_id
¶ Returns: The id of the workflow this execution represents.
-
parameters
¶ Returns: The execution’s parameters
-
is_system_workflow
¶ Returns: True if the workflow executed is a system workflow, otherwise False
-
created_at
¶ Returns: The execution creation time.
-
created_by
¶ Returns: The name of the execution creator.
-
-
class
cloudify_rest_client.executions.
ExecutionsClient
(api)[source]¶ Bases:
object
-
list
(deployment_id=None, include_system_workflows=False, _include=None, sort=None, is_descending=False, **kwargs)[source]¶ Returns a list of executions.
Parameters: - deployment_id – Optional deployment id to get executions for.
- include_system_workflows – Include executions of system workflows
- _include – List of fields to include in response.
- sort – Key for sorting the list.
- is_descending – True for descending order, False for ascending.
- kwargs – Optional filter fields. For a list of available fields see the REST service’s models.Execution.fields
Returns: Executions list.
-
get
(execution_id, _include=None)[source]¶ Get execution by its id.
Parameters: - execution_id – Id of the execution to get.
- _include – List of fields to include in response.
Returns: Execution.
-
update
(execution_id, status, error=None)[source]¶ Update execution with the provided status and optional error.
Parameters: - execution_id – Id of the execution to update.
- status – Updated execution status.
- error – Updated execution error (optional).
Returns: Updated execution.
-
start
(deployment_id, workflow_id, parameters=None, allow_custom_parameters=False, force=False)[source]¶ Starts a deployment’s workflow execution whose id is provided.
Parameters: - deployment_id – The deployment’s id to execute a workflow for.
- workflow_id – The workflow to be executed id.
- parameters – Parameters for the workflow execution.
- allow_custom_parameters – Determines whether to allow parameters which weren’t defined in the workflow parameters schema in the blueprint.
- force – Determines whether to force the execution of the workflow in a case where there’s an already running execution for this deployment.
Raises: IllegalExecutionParametersError
Returns: The created execution.
-