Provides information about a state machine execution, such as the state machine associated with the execution, the execution input and output, and relevant execution metadata. If you've redriven an execution, you can use this API action to return information about the redrives of that execution. In addition, you can use this API action to return the Map Run Amazon Resource Name (ARN) if the execution was dispatched by a Map Run.
If you specify a version or alias ARN when you call the StartExecution API action, DescribeExecution returns that ARN.
This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.
Executions of an EXPRESS state machine aren't supported by DescribeExecution unless a Map Run dispatched them.
Parameters:
-
execution_arn
(Arn)
–
The Amazon Resource Name (ARN) of the execution to describe.
-
included_data
(Optional[IncludedData], default:
None
)
–
If your state machine definition is encrypted with a KMS key, callers must have kms:Decrypt permission to decrypt the definition. Alternatively, you can call DescribeStateMachine API with includedData = METADATA_ONLY to get a successful response without the encrypted definition.
Raises:
Source code in docs_src/capo_sfn/_services/sfn.py
| def describe_execution(
self,
execution_arn: "capo_sfn.types.arn.Arn",
*,
config_overrides: Optional[SFNClientConfig] = None,
included_data: Optional["capo_sfn.types.included_data.IncludedData"] = None,
) -> "capo_sfn.types.describe_execution_output.DescribeExecutionOutput":
"""<p>Provides information about a state machine execution, such as the state machine associated with the execution, the execution input and output, and relevant execution metadata. If you've <a href="https://docs.aws.amazon.com/step-functions/latest/dg/redrive-executions.html">redriven</a> an execution, you can use this API action to return information about the redrives of that execution. In addition, you can use this API action to return the Map Run Amazon Resource Name (ARN) if the execution was dispatched by a Map Run.</p> <p>If you specify a version or alias ARN when you call the <a>StartExecution</a> API action, <code>DescribeExecution</code> returns that ARN.</p> <note> <p>This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.</p> </note> <p>Executions of an <code>EXPRESS</code> state machine aren't supported by <code>DescribeExecution</code> unless a Map Run dispatched them.</p>
Args:
execution_arn: <p>The Amazon Resource Name (ARN) of the execution to describe.</p>
included_data: <p>If your state machine definition is encrypted with a KMS key, callers must have <code>kms:Decrypt</code> permission to decrypt the definition. Alternatively, you can call DescribeStateMachine API with <code>includedData = METADATA_ONLY</code> to get a successful response without the encrypted definition.</p>
Raises:
capo_sfn.errors.execution_does_not_exist.ExecutionDoesNotExist: <p>The specified execution does not exist.</p>
capo_sfn.errors.invalid_arn.InvalidArn: <p>The provided Amazon Resource Name (ARN) is not valid.</p>
capo_sfn.errors.kms_access_denied_exception.KmsAccessDeniedException: <p>Either your KMS key policy or API caller does not have the required permissions.</p>
capo_sfn.errors.kms_invalid_state_exception.KmsInvalidStateException: <p>The KMS key is not in valid state, for example: Disabled or Deleted.</p>
capo_sfn.errors.kms_throttling_exception.KmsThrottlingException: <p>Received when KMS returns <code>ThrottlingException</code> for a KMS call that Step Functions makes on behalf of the caller.</p>
capo_sfn.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sfn.types.describe_execution_input.DescribeExecutionInput]",
) -> OperationResponse[
"capo_sfn.types.describe_execution_output.DescribeExecutionOutput"
]:
import capo_sfn._operations.aws_step_functions.describe_execution
output, http_response = (
capo_sfn._operations.aws_step_functions.describe_execution.describe_execution(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_sfn.types.describe_execution_output.DescribeExecutionOutput",
) -> dict[str, Any]:
import capo_sfn.types.describe_execution_output
return capo_sfn.types.describe_execution_output.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("DescribeExecution", redact_output=_redact_output),
)
input_: capo_sfn.types.describe_execution_input.DescribeExecutionInput = {
"execution_arn": execution_arn
}
if included_data is not None:
input_["included_data"] = included_data
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|