Skip to content

delete_scheduled_query

delete_scheduled_query(
    identifier: ScheduledQueryIdentifier,
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
) -> DeleteScheduledQueryResponse

Deletes a scheduled query and stops all future executions. This operation also removes any configured actions and associated resources.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
def delete_scheduled_query(
    self,
    identifier: "capo_cloudwatch_logs.types.scheduled_query_identifier.ScheduledQueryIdentifier",
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.delete_scheduled_query_response.DeleteScheduledQueryResponse":
    """<p>Deletes a scheduled query and stops all future executions. This operation also removes any configured actions and associated resources.</p>

    Args:
        identifier: <p>The ARN or name of the scheduled query to delete.</p>

    Raises:
        capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_cloudwatch_logs.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_cloudwatch_logs.errors.validation_exception.ValidationException: <p>One of the parameters for the request is not valid.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_logs.types.delete_scheduled_query_request.DeleteScheduledQueryRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_logs.types.delete_scheduled_query_response.DeleteScheduledQueryResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.delete_scheduled_query

        output, http_response = (
            capo_cloudwatch_logs._operations.logs_20140328.delete_scheduled_query.delete_scheduled_query(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteScheduledQuery")
    )
    input_: capo_cloudwatch_logs.types.delete_scheduled_query_request.DeleteScheduledQueryRequest = {
        "identifier": identifier
    }

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