Skip to content

cancel_trace_retrieval async

cancel_trace_retrieval(
    retrieval_token: RetrievalToken,
    *,
    config_overrides: Optional[AsyncXRayClientConfig] = None,
) -> CancelTraceRetrievalResult

Cancels an ongoing trace retrieval job initiated by StartTraceRetrieval using the provided RetrievalToken. A successful cancellation will return an HTTP 200 response.

Parameters:

Raises:

Source code in docs_src/capo_xray/_services/async_x_ray.py
async def cancel_trace_retrieval(
    self,
    retrieval_token: "capo_xray.types.retrieval_token.RetrievalToken",
    *,
    config_overrides: Optional[AsyncXRayClientConfig] = None,
) -> "capo_xray.types.cancel_trace_retrieval_result.CancelTraceRetrievalResult":
    """<p> Cancels an ongoing trace retrieval job initiated by <code>StartTraceRetrieval</code> using the provided <code>RetrievalToken</code>. A successful cancellation will return an HTTP 200 response. </p>

    Args:
        retrieval_token: <p> Retrieval token. </p>

    Raises:
        capo_xray.errors.invalid_request_exception.InvalidRequestException: <p>The request is missing required parameters or has invalid parameters.</p>
        capo_xray.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found. Verify that the name or Amazon Resource Name (ARN) of the resource is correct.</p>
        capo_xray.errors.throttled_exception.ThrottledException: <p>The request exceeds the maximum number of requests per second.</p>
        capo_xray.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_xray.types.cancel_trace_retrieval_request.CancelTraceRetrievalRequest]",
    ) -> AsyncOperationResponse[
        "capo_xray.types.cancel_trace_retrieval_result.CancelTraceRetrievalResult"
    ]:
        import capo_xray._operations.awsx_ray.cancel_trace_retrieval

        (
            output,
            http_response,
        ) = await capo_xray._operations.awsx_ray.cancel_trace_retrieval.async_cancel_trace_retrieval(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelTraceRetrieval")
    )
    input_: capo_xray.types.cancel_trace_retrieval_request.CancelTraceRetrievalRequest = {
        "retrieval_token": retrieval_token
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output