Skip to content

list_connections

list_connections(
    *,
    config_overrides: Optional[InterconnectClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    state: Optional[ConnectionState] = None,
    environment_id: Optional[EnvironmentId] = None,
    provider: Optional[Provider] = None,
    attach_point: Optional[AttachPoint] = None,
) -> ListConnectionsResponse

Lists all connection objects to which the caller has access.

Allows for optional filtering by the following properties:

  • state

  • environmentId

  • provider

  • attach point

Only Connection objects matching all filters will be returned.

Parameters:

Raises:

Examples:

List All Connections

>>> client.list_connections()
List Connections in available state
>>> client.list_connections(state='available')
List Connections on specific Environment
>>> client.list_connections(environment_id='mce-aws-acme-1')
Source code in docs_src/capo_interconnect/_services/interconnect.py
def list_connections(
    self,
    *,
    config_overrides: Optional[InterconnectClientConfig] = None,
    max_results: Optional["capo_interconnect.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_interconnect.types.next_token.NextToken"] = None,
    state: Optional[
        "capo_interconnect.types.connection_state.ConnectionState"
    ] = None,
    environment_id: Optional[
        "capo_interconnect.types.environment_id.EnvironmentId"
    ] = None,
    provider: Optional["capo_interconnect.types.provider.Provider"] = None,
    attach_point: Optional[
        "capo_interconnect.types.attach_point.AttachPoint"
    ] = None,
) -> "capo_interconnect.types.list_connections_response.ListConnectionsResponse":
    """<p>Lists all connection objects to which the caller has access.</p> <p>Allows for optional filtering by the following properties:</p> <ul> <li> <p> <code>state</code> </p> </li> <li> <p> <code>environmentId</code> </p> </li> <li> <p> <code>provider</code> </p> </li> <li> <p> <code>attach point</code> </p> </li> </ul> <p>Only <a>Connection</a> objects matching all filters will be returned.</p>

    Args:
        max_results: <p>The max number of list results in a single paginated response.</p>
        next_token: <p>A pagination token from a previous paginated response indicating you wish to get the next page of results.</p>
        state: <p>Filter the results to only include <a>Connection</a> objects in the given <a>Connection$state</a>.</p>
        environment_id: <p>Filter the results to only include <a>Connection</a> objects on the given <a>Environment</a>.</p>
        provider: <p>Filter the results to only include <a>Connection</a> objects to the given <a>Provider</a>.</p>
        attach_point: <p>Filter results to only include <a>Connection</a> objects attached to the given <a>AttachPoint</a>.</p>

    Raises:
        capo_interconnect.errors.access_denied_exception.AccessDeniedException: <p>The calling principal is not allowed to access the specified resource, or the resource does not exist.</p>
        capo_interconnect.errors.interconnect_client_exception.InterconnectClientException: <p>The request was denied due to incorrect client supplied parameters.</p>
        capo_interconnect.errors.interconnect_server_exception.InterconnectServerException: <p>The request resulted in an exception internal to the service.</p>
        capo_interconnect.errors.interconnect_validation_exception.InterconnectValidationException: <p>The input fails to satisfy the constraints specified.</p>
        capo_interconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request specifies a resource that does not exist on the server.</p>
        capo_interconnect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The requested operation would result in the calling principal exceeding their allotted quota.</p>
        capo_interconnect.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_interconnect.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List All Connections

        >>> client.list_connections()
        List Connections in available state

        >>> client.list_connections(state='available')
        List Connections on specific Environment

        >>> client.list_connections(environment_id='mce-aws-acme-1')
    """

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

        output, http_response = (
            capo_interconnect._operations.interconnect.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_interconnect.types.list_connections_request.ListConnectionsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if state is not None:
        input_["state"] = state
    if environment_id is not None:
        input_["environment_id"] = environment_id
    if provider is not None:
        input_["provider"] = provider
    if attach_point is not None:
        input_["attach_point"] = attach_point

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