Skip to content

list_scheduled_queries async

list_scheduled_queries(
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    max_results: Optional[ListScheduledQueriesMaxResults] = None,
    next_token: Optional[NextToken] = None,
    state: Optional[ScheduledQueryState] = None,
    schedule_type: Optional[ScheduleType] = None,
) -> ListScheduledQueriesResponse

Lists all scheduled queries in your account and region. You can filter results by state to show only enabled or disabled queries.

Parameters:

  • max_results (Optional[ListScheduledQueriesMaxResults], default: None ) –

    The maximum number of scheduled queries to return. Valid range is 1 to 1000.

  • state (Optional[ScheduledQueryState], default: None ) –

    Filter scheduled queries by state. Valid values are ENABLED and DISABLED. If not specified, all scheduled queries are returned.

  • schedule_type (Optional[ScheduleType], default: None ) –

    Filter scheduled queries by schedule type. Valid values are CUSTOMER_MANAGED and AWS_MANAGED. If not specified, scheduled queries of all schedule types are returned.

Raises:

  • AccessDeniedException –

    You don't have sufficient permissions to perform this action.

  • InternalServerException –

    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.

  • ThrottlingException –

    The request was throttled because of quota limits.

  • ValidationException –

    One of the parameters for the request is not valid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def list_scheduled_queries(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    max_results: Optional[
        "capo_cloudwatch_logs.types.list_scheduled_queries_max_results.ListScheduledQueriesMaxResults"
    ] = None,
    next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
    state: Optional[
        "capo_cloudwatch_logs.types.scheduled_query_state.ScheduledQueryState"
    ] = None,
    schedule_type: Optional[
        "capo_cloudwatch_logs.types.schedule_type.ScheduleType"
    ] = None,
) -> "capo_cloudwatch_logs.types.list_scheduled_queries_response.ListScheduledQueriesResponse":
    """<p>Lists all scheduled queries in your account and region. You can filter results by state to show only enabled or disabled queries.</p>

    Args:
        max_results: <p>The maximum number of scheduled queries to return. Valid range is 1 to 1000.</p>
        state: <p>Filter scheduled queries by state. Valid values are <code>ENABLED</code> and <code>DISABLED</code>. If not specified, all scheduled queries are returned.</p>
        schedule_type: <p>Filter scheduled queries by schedule type. Valid values are <code>CUSTOMER_MANAGED</code> and <code>AWS_MANAGED</code>. If not specified, scheduled queries of all schedule types are returned.</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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.list_scheduled_queries_request.ListScheduledQueriesRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.list_scheduled_queries_response.ListScheduledQueriesResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.list_scheduled_queries

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.list_scheduled_queries.async_list_scheduled_queries(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListScheduledQueries")
    )
    input_: capo_cloudwatch_logs.types.list_scheduled_queries_request.ListScheduledQueriesRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if state is not None:
        input_["state"] = state
    if schedule_type is not None:
        input_["schedule_type"] = schedule_type

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