Skip to content

list_event_buses async

list_event_buses(
    *,
    config_overrides: Optional[AsyncEventBridgeV2ClientConfig] = None,
    name_prefix: Optional[EventBusName] = None,
    event_bus_account_id: Optional[AccountId] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListEventBusesResponse

Lists the event buses visible to the caller: buses the account owns and buses shared with it through AWS RAM. Shared entries carry identity fields only (Name, EventBusArn, EventBusAccountId); owned entries carry every summary field. Set EventBusAccountId to scope the list to one owner account.

Parameters:

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

    Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/<name>/<id>), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.

  • event_bus_account_id (Optional[AccountId], default: None ) –

    AWS Account Id.

  • 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.

  • UnknownServiceError –

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

Source code in docs_src/capo_eventbridgev2/_services/async_event_bridge_v2.py
async def list_event_buses(
    self,
    *,
    config_overrides: Optional[AsyncEventBridgeV2ClientConfig] = None,
    name_prefix: Optional[
        "capo_eventbridgev2.types.event_bus_name.EventBusName"
    ] = None,
    event_bus_account_id: Optional[
        "capo_eventbridgev2.types.account_id.AccountId"
    ] = 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_event_buses_response.ListEventBusesResponse":
    """<p>Lists the event buses visible to the caller: buses the account owns and buses shared with it through AWS RAM. Shared entries carry identity fields only (Name, EventBusArn, EventBusAccountId); owned entries carry every summary field. Set EventBusAccountId to scope the list to one owner account.</p>

    Args:
        name_prefix: <p>Name of an event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'. The grammar matches the name segment of EventBusArn (event-busv2/&lt;name&gt;/&lt;id&gt;), so every valid name can be represented in the bus's ARN. The same type is used everywhere a bus name appears.</p>
        event_bus_account_id: <p>AWS Account Id.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eventbridgev2.types.list_event_buses_request.ListEventBusesRequest]",
    ) -> AsyncOperationResponse[
        "capo_eventbridgev2.types.list_event_buses_response.ListEventBusesResponse"
    ]:
        import capo_eventbridgev2._operations.aws_events_v2.list_event_buses

        (
            output,
            http_response,
        ) = await capo_eventbridgev2._operations.aws_events_v2.list_event_buses.async_list_event_buses(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEventBuses")
    )
    input_: capo_eventbridgev2.types.list_event_buses_request.ListEventBusesRequest = {}
    if name_prefix is not None:
        input_["name_prefix"] = name_prefix
    if event_bus_account_id is not None:
        input_["event_bus_account_id"] = event_bus_account_id
    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