Skip to content

list_connections

list_connections(
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = 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 to retrieve the next set of results.

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

    The maximum number of connections to return.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/cloud_watch_events.py
def list_connections(
    self,
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    name_prefix: Optional[
        "capo_cloudwatch_events.types.connection_name.ConnectionName"
    ] = None,
    connection_state: Optional[
        "capo_cloudwatch_events.types.connection_state.ConnectionState"
    ] = None,
    next_token: Optional[
        "capo_cloudwatch_events.types.next_token.NextToken"
    ] = None,
    limit: Optional["capo_cloudwatch_events.types.limit_max100.LimitMax100"] = None,
) -> (
    "capo_cloudwatch_events.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 to retrieve the next set of results.</p>
        limit: <p>The maximum number of connections to return.</p>

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

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

        output, http_response = (
            capo_cloudwatch_events._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_cloudwatch_events.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