Retrieves the current execution state required for the replay process during durable function execution. This API is used by the Lambda durable functions SDK to get state information needed for replay. You typically don't need to call this API directly as the SDK handles state management automatically.
The response contains operations ordered by start sequence number in ascending order. Completed operations with children don't include child operation details since they don't need to be replayed.
Parameters:
-
durable_execution_arn
(DurableExecutionArn)
–
The Amazon Resource Name (ARN) of the durable execution.
-
checkpoint_token
(CheckpointToken)
–
A checkpoint token that identifies the current state of the execution. This token is provided by the Lambda runtime and ensures that state retrieval is consistent with the current execution context.
-
marker
(Optional[String], default:
None
)
–
If NextMarker was returned from a previous request, use this value to retrieve the next page of operations. Each pagination token expires after 24 hours.
-
max_items
(Optional[ItemCount], default:
None
)
–
The maximum number of operations to return per call. You can use Marker to retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.
Raises:
-
InvalidParameterValueException
–
One of the parameters in the request is not valid.
-
KMSAccessDeniedException
–
Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.
-
KMSDisabledException
–
Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.
-
KMSInvalidStateException
–
Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.
-
KMSNotFoundException
–
Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.
-
ServiceException
–
The Lambda service encountered an internal error.
-
TooManyRequestsException
–
The request throughput limit was exceeded. For more information, see Lambda quotas.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_lambda/_services/async__lambda.py
| async def get_durable_execution_state(
self,
durable_execution_arn: "capo_lambda.types.durable_execution_arn.DurableExecutionArn",
checkpoint_token: "capo_lambda.types.checkpoint_token.CheckpointToken",
*,
config_overrides: Optional[AsyncLambdaClientConfig] = None,
marker: Optional["capo_lambda.types.string.String"] = None,
max_items: Optional["capo_lambda.types.item_count.ItemCount"] = None,
) -> "capo_lambda.types.get_durable_execution_state_response.GetDurableExecutionStateResponse":
"""<p>Retrieves the current execution state required for the replay process during <a href="https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html">durable function</a> execution. This API is used by the Lambda durable functions SDK to get state information needed for replay. You typically don't need to call this API directly as the SDK handles state management automatically.</p> <p>The response contains operations ordered by start sequence number in ascending order. Completed operations with children don't include child operation details since they don't need to be replayed.</p>
Args:
durable_execution_arn: <p>The Amazon Resource Name (ARN) of the durable execution.</p>
checkpoint_token: <p>A checkpoint token that identifies the current state of the execution. This token is provided by the Lambda runtime and ensures that state retrieval is consistent with the current execution context.</p>
marker: <p>If <code>NextMarker</code> was returned from a previous request, use this value to retrieve the next page of operations. Each pagination token expires after 24 hours.</p>
max_items: <p>The maximum number of operations to return per call. You can use <code>Marker</code> to retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.</p>
Raises:
capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
capo_lambda.errors.kms_access_denied_exception.KMSAccessDeniedException: <p>Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.</p>
capo_lambda.errors.kms_disabled_exception.KMSDisabledException: <p>Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.</p>
capo_lambda.errors.kms_invalid_state_exception.KMSInvalidStateException: <p>Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.</p>
capo_lambda.errors.kms_not_found_exception.KMSNotFoundException: <p>Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.</p>
capo_lambda.errors.service_exception.ServiceException: <p>The Lambda service encountered an internal error.</p>
capo_lambda.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
capo_lambda.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_lambda.types.get_durable_execution_state_request.GetDurableExecutionStateRequest]",
) -> AsyncOperationResponse[
"capo_lambda.types.get_durable_execution_state_response.GetDurableExecutionStateResponse"
]:
import capo_lambda._operations.aws_gir_api_service.get_durable_execution_state
(
output,
http_response,
) = await capo_lambda._operations.aws_gir_api_service.get_durable_execution_state.async_get_durable_execution_state(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_lambda.types.get_durable_execution_state_response.GetDurableExecutionStateResponse",
) -> dict[str, Any]:
import capo_lambda.types.get_durable_execution_state_response
return (
capo_lambda.types.get_durable_execution_state_response.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetDurableExecutionState", redact_output=_redact_output),
)
input_: capo_lambda.types.get_durable_execution_state_request.GetDurableExecutionStateRequest = {
"durable_execution_arn": durable_execution_arn,
"checkpoint_token": checkpoint_token,
}
if marker is not None:
input_["marker"] = marker
if max_items is not None:
input_["max_items"] = max_items
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|