Skip to content

list_schedules async

list_schedules(
    *,
    config_overrides: Optional[AsyncSchedulerClientConfig] = None,
    group_name: Optional[ScheduleGroupName] = None,
    name_prefix: Optional[NamePrefix] = None,
    state: Optional[ScheduleState] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListSchedulesOutput

Returns a paginated list of your EventBridge Scheduler schedules.

Parameters:

  • group_name (Optional[ScheduleGroupName], default: None ) –

    If specified, only lists the schedules whose associated schedule group matches the given filter.

  • name_prefix (Optional[NamePrefix], default: None ) –

    Schedule name prefix to return the filtered list of resources.

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

    If specified, only lists the schedules whose current state matches the given filter.

  • next_token (Optional[NextToken], default: None ) –

    The token returned by a previous call to retrieve the next set of results.

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

    If specified, limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.

Raises:

Source code in docs_src/capo_scheduler/_services/async_scheduler.py
async def list_schedules(
    self,
    *,
    config_overrides: Optional[AsyncSchedulerClientConfig] = None,
    group_name: Optional[
        "capo_scheduler.types.schedule_group_name.ScheduleGroupName"
    ] = None,
    name_prefix: Optional["capo_scheduler.types.name_prefix.NamePrefix"] = None,
    state: Optional["capo_scheduler.types.schedule_state.ScheduleState"] = None,
    next_token: Optional["capo_scheduler.types.next_token.NextToken"] = None,
    max_results: Optional["capo_scheduler.types.max_results.MaxResults"] = None,
) -> "capo_scheduler.types.list_schedules_output.ListSchedulesOutput":
    """<p>Returns a paginated list of your EventBridge Scheduler schedules.</p>

    Args:
        group_name: <p>If specified, only lists the schedules whose associated schedule group matches the given filter.</p>
        name_prefix: <p>Schedule name prefix to return the filtered list of resources.</p>
        state: <p>If specified, only lists the schedules whose current state matches the given filter.</p>
        next_token: <p>The token returned by a previous call to retrieve the next set of results.</p>
        max_results: <p>If specified, limits the number of results returned by this operation. The operation also returns a <code>NextToken</code> which you can use in a subsequent operation to retrieve the next set of results.</p>

    Raises:
        capo_scheduler.errors.internal_server_exception.InternalServerException: <p>Unexpected error encountered while processing the request.</p>
        capo_scheduler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource which does not exist.</p>
        capo_scheduler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_scheduler.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_scheduler.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_scheduler.types.list_schedules_input.ListSchedulesInput]",
    ) -> AsyncOperationResponse[
        "capo_scheduler.types.list_schedules_output.ListSchedulesOutput"
    ]:
        import capo_scheduler._operations.aws_chronos_service.list_schedules

        (
            output,
            http_response,
        ) = await capo_scheduler._operations.aws_chronos_service.list_schedules.async_list_schedules(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSchedules")
    )
    input_: capo_scheduler.types.list_schedules_input.ListSchedulesInput = {}
    if group_name is not None:
        input_["group_name"] = group_name
    if name_prefix is not None:
        input_["name_prefix"] = name_prefix
    if state is not None:
        input_["state"] = state
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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