Skip to content

list_subscribers

list_subscribers(
    *,
    config_overrides: Optional[EventBridgeV2ClientConfig] = None,
    event_bus_arn: Optional[EventBusArn] = None,
    name_prefix: Optional[SubscriberName] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListSubscribersResponse

Lists subscribers as summaries. By default the list spans the subscribers the caller account owns across all buses; set EventBusArn to scope it to one bus. Use DescribeSubscriber to retrieve full configuration.

Parameters:

  • event_bus_arn (Optional[EventBusArn], default: None ) –

    The Amazon Resource Name (ARN) that uniquely identifies an event bus.

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

    Name of a subscriber. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'.

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

    Opaque pagination token returned by a List operation. Pass it back in the next request to retrieve the next page of results.

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

    Maximum number of results to return in one page of a List operation.

Raises:

  • AccessDeniedException –

    The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.

  • InternalException –

    The request failed because of an internal service error. Retry the request.

  • InvalidInputException –

    A request parameter is missing or not valid.

  • ThrottlingException –

    The request was throttled because it exceeds a request rate limit. Retry the request with backoff.

  • ResourceNotFoundException –

    The resource does not exist.

  • UnknownServiceError –

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

Source code in docs_src/capo_eventbridgev2/_services/event_bridge_v2.py
def list_subscribers(
    self,
    *,
    config_overrides: Optional[EventBridgeV2ClientConfig] = None,
    event_bus_arn: Optional[
        "capo_eventbridgev2.types.event_bus_arn.EventBusArn"
    ] = None,
    name_prefix: Optional[
        "capo_eventbridgev2.types.subscriber_name.SubscriberName"
    ] = None,
    next_token: Optional["capo_eventbridgev2.types.next_token.NextToken"] = None,
    max_results: Optional["capo_eventbridgev2.types.max_results.MaxResults"] = None,
) -> "capo_eventbridgev2.types.list_subscribers_response.ListSubscribersResponse":
    """<p>Lists subscribers as summaries. By default the list spans the subscribers the caller account owns across all buses; set EventBusArn to scope it to one bus. Use DescribeSubscriber to retrieve full configuration.</p>

    Args:
        event_bus_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies an event bus.</p>
        name_prefix: <p>Name of a subscriber. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'.</p>
        next_token: <p>Opaque pagination token returned by a List operation. Pass it back in the next request to retrieve the next page of results.</p>
        max_results: <p>Maximum number of results to return in one page of a List operation.</p>

    Raises:
        capo_eventbridgev2.errors.access_denied_exception.AccessDeniedException: <p>The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.</p>
        capo_eventbridgev2.errors.internal_exception.InternalException: <p>The request failed because of an internal service error. Retry the request.</p>
        capo_eventbridgev2.errors.invalid_input_exception.InvalidInputException: <p>A request parameter is missing or not valid.</p>
        capo_eventbridgev2.errors.throttling_exception.ThrottlingException: <p>The request was throttled because it exceeds a request rate limit. Retry the request with backoff.</p>
        capo_eventbridgev2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist.</p>
        capo_eventbridgev2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_eventbridgev2.types.list_subscribers_request.ListSubscribersRequest]",
    ) -> OperationResponse[
        "capo_eventbridgev2.types.list_subscribers_response.ListSubscribersResponse"
    ]:
        import capo_eventbridgev2._operations.aws_events_v2.list_subscribers

        output, http_response = (
            capo_eventbridgev2._operations.aws_events_v2.list_subscribers.list_subscribers(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSubscribers")
    )
    input_: capo_eventbridgev2.types.list_subscribers_request.ListSubscribersRequest = {}
    if event_bus_arn is not None:
        input_["event_bus_arn"] = event_bus_arn
    if name_prefix is not None:
        input_["name_prefix"] = name_prefix
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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