Skip to content

list_connections

list_connections(
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
    name_prefix: Optional[ConnectionName] = None,
    connection_state: Optional[ConnectionState] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[LimitMax100] = None,
) -> ListConnectionsResponse

Retrieves a list of connections from the account.

Parameters:

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

    A name prefix to filter results returned. Only connections with a name that starts with the prefix are returned.

  • connection_state (Optional[ConnectionState], default: None ) –

    The state of the connection.

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

    The token returned by a previous call, which you can use to retrieve the next set of results.

    The value of nextToken is a unique pagination token for each page. To retrieve the next page of results, make the call again using the returned token. Keep all other arguments unchanged.

    Using an expired pagination token results in an HTTP 400 InvalidToken error.

  • limit (Optional[LimitMax100], default: None ) –

    The maximum number of connections to return.

Raises:

Source code in docs_src/capo_eventbridge/_services/event_bridge.py
def list_connections(
    self,
    *,
    config_overrides: Optional[EventBridgeClientConfig] = None,
    name_prefix: Optional[
        "capo_eventbridge.types.connection_name.ConnectionName"
    ] = None,
    connection_state: Optional[
        "capo_eventbridge.types.connection_state.ConnectionState"
    ] = None,
    next_token: Optional["capo_eventbridge.types.next_token.NextToken"] = None,
    limit: Optional["capo_eventbridge.types.limit_max100.LimitMax100"] = None,
) -> "capo_eventbridge.types.list_connections_response.ListConnectionsResponse":
    """<p>Retrieves a list of connections from the account.</p>

    Args:
        name_prefix: <p>A name prefix to filter results returned. Only connections with a name that starts with the prefix are returned.</p>
        connection_state: <p>The state of the connection.</p>
        next_token: <p>The token returned by a previous call, which you can use to retrieve the next set of results.</p> <p>The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page of results, make the call again using the returned token. Keep all other arguments unchanged.</p> <p> Using an expired pagination token results in an <code>HTTP 400 InvalidToken</code> error.</p>
        limit: <p>The maximum number of connections to return.</p>

    Raises:
        capo_eventbridge.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_eventbridge.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_eventbridge.types.list_connections_request.ListConnectionsRequest]",
    ) -> OperationResponse[
        "capo_eventbridge.types.list_connections_response.ListConnectionsResponse"
    ]:
        import capo_eventbridge._operations.aws_events.list_connections

        output, http_response = (
            capo_eventbridge._operations.aws_events.list_connections.list_connections(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListConnections")
    )
    input_: capo_eventbridge.types.list_connections_request.ListConnectionsRequest = {}
    if name_prefix is not None:
        input_["name_prefix"] = name_prefix
    if connection_state is not None:
        input_["connection_state"] = connection_state
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit

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