Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.
This operation can be used to cancel both interactive queries and individual scheduled query executions. When used with scheduled queries, StopQuery cancels only the specific execution identified by the query ID, not the scheduled query configuration itself.
Parameters:
-
query_id
(QueryId)
–
The ID number of the query to stop. To find this ID number, use DescribeQueries.
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
| async def stop_query(
self,
query_id: "capo_cloudwatch_logs.types.query_id.QueryId",
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.stop_query_response.StopQueryResponse":
"""<p>Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.</p> <p>This operation can be used to cancel both interactive queries and individual scheduled query executions. When used with scheduled queries, <code>StopQuery</code> cancels only the specific execution identified by the query ID, not the scheduled query configuration itself.</p>
Args:
query_id: <p>The ID number of the query to stop. To find this ID number, use <code>DescribeQueries</code>.</p>
Raises:
capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch_logs.types.stop_query_request.StopQueryRequest]",
) -> AsyncOperationResponse[
"capo_cloudwatch_logs.types.stop_query_response.StopQueryResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.stop_query
(
output,
http_response,
) = await capo_cloudwatch_logs._operations.logs_20140328.stop_query.async_stop_query(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopQuery")
)
input_: capo_cloudwatch_logs.types.stop_query_request.StopQueryRequest = {
"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
|