Cancels a query that has been issued. Cancellation is provided only if the query has not completed running before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a CancellationMessage, indicating that the query has already been canceled. See code sample for details.
Parameters:
-
query_id
(QueryId)
–
The ID of the query that needs to be cancelled. QueryID is returned as part of the query result.
Raises:
Source code in docs_src/capo_timestream_query/_services/async_timestream_query.py
| async def cancel_query(
self,
query_id: "capo_timestream_query.types.query_id.QueryId",
*,
config_overrides: Optional[AsyncTimestreamQueryClientConfig] = None,
) -> "capo_timestream_query.types.cancel_query_response.CancelQueryResponse":
"""<p> Cancels a query that has been issued. Cancellation is provided only if the query has not completed running before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a <code>CancellationMessage</code>, indicating that the query has already been canceled. See <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.cancel-query.html">code sample</a> for details. </p>
Args:
query_id: <p> The ID of the query that needs to be cancelled. <code>QueryID</code> is returned as part of the query result. </p>
Raises:
capo_timestream_query.errors.access_denied_exception.AccessDeniedException: <p>You do not have the necessary permissions to access the account settings.</p>
capo_timestream_query.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred while processing the request.</p>
capo_timestream_query.errors.invalid_endpoint_exception.InvalidEndpointException: <p>The requested endpoint is invalid.</p>
capo_timestream_query.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to excessive requests.</p>
capo_timestream_query.errors.validation_exception.ValidationException: <p> Invalid or malformed request. </p>
capo_timestream_query.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_timestream_query.types.cancel_query_request.CancelQueryRequest]",
) -> AsyncOperationResponse[
"capo_timestream_query.types.cancel_query_response.CancelQueryResponse"
]:
import capo_timestream_query._operations.timestream_20181101.cancel_query
(
output,
http_response,
) = await capo_timestream_query._operations.timestream_20181101.cancel_query.async_cancel_query(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelQuery")
)
input_: capo_timestream_query.types.cancel_query_request.CancelQueryRequest = {
"query_id": query_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|