Skip to content

get_async_invoke

get_async_invoke(
    invocation_arn: InvocationArn,
    *,
    config_overrides: Optional[BedrockRuntimeClientConfig] = None,
) -> GetAsyncInvokeResponse

Retrieve information about an asynchronous invocation.

Parameters:

Raises:

Source code in docs_src/capo_bedrock_runtime/_services/bedrock_runtime.py
def get_async_invoke(
    self,
    invocation_arn: "capo_bedrock_runtime.types.invocation_arn.InvocationArn",
    *,
    config_overrides: Optional[BedrockRuntimeClientConfig] = None,
) -> "capo_bedrock_runtime.types.get_async_invoke_response.GetAsyncInvokeResponse":
    """<p>Retrieve information about an asynchronous invocation.</p>

    Args:
        invocation_arn: <p>The invocation's ARN.</p>

    Raises:
        capo_bedrock_runtime.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
        capo_bedrock_runtime.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
        capo_bedrock_runtime.errors.throttling_exception.ThrottlingException: <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
        capo_bedrock_runtime.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
        capo_bedrock_runtime.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock_runtime.types.get_async_invoke_request.GetAsyncInvokeRequest]",
    ) -> OperationResponse[
        "capo_bedrock_runtime.types.get_async_invoke_response.GetAsyncInvokeResponse"
    ]:
        import capo_bedrock_runtime._operations.amazon_bedrock_frontend_service.get_async_invoke

        output, http_response = (
            capo_bedrock_runtime._operations.amazon_bedrock_frontend_service.get_async_invoke.get_async_invoke(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_bedrock_runtime.types.get_async_invoke_response.GetAsyncInvokeResponse",
    ) -> dict[str, Any]:
        import capo_bedrock_runtime.types.get_async_invoke_response

        return (
            capo_bedrock_runtime.types.get_async_invoke_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetAsyncInvoke", redact_output=_redact_output),
    )
    input_: capo_bedrock_runtime.types.get_async_invoke_request.GetAsyncInvokeRequest = {
        "invocation_arn": invocation_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output