Deletes a saved CloudWatch Logs Insights query definition. A query definition contains details about a saved CloudWatch Logs Insights query.
Each DeleteQueryDefinition operation can delete one query definition.
You must have the logs:DeleteQueryDefinition permission to be able to perform this operation.
Parameters:
-
query_definition_id
(QueryId)
–
The ID of the query definition that you want to delete. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
| async def delete_query_definition(
self,
query_definition_id: "capo_cloudwatch_logs.types.query_id.QueryId",
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.delete_query_definition_response.DeleteQueryDefinitionResponse":
"""<p>Deletes a saved CloudWatch Logs Insights query definition. A query definition contains details about a saved CloudWatch Logs Insights query.</p> <p>Each <code>DeleteQueryDefinition</code> operation can delete one query definition.</p> <p>You must have the <code>logs:DeleteQueryDefinition</code> permission to be able to perform this operation.</p>
Args:
query_definition_id: <p>The ID of the query definition that you want to delete. You can use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueryDefinitions.html">DescribeQueryDefinitions</a> to retrieve the IDs of your saved query definitions.</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.delete_query_definition_request.DeleteQueryDefinitionRequest]",
) -> AsyncOperationResponse[
"capo_cloudwatch_logs.types.delete_query_definition_response.DeleteQueryDefinitionResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.delete_query_definition
(
output,
http_response,
) = await capo_cloudwatch_logs._operations.logs_20140328.delete_query_definition.async_delete_query_definition(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteQueryDefinition")
)
input_: capo_cloudwatch_logs.types.delete_query_definition_request.DeleteQueryDefinitionRequest = {
"query_definition_id": query_definition_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|