Skip to content

list_connections async

list_connections(
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListConnectionsResponse

Lists the connections in your account, most recently updated first.

Parameters:

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

    Maximum number of results per page (upper bound, not a target). Defaults to 50 when absent. The service might return fewer items.

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

    Opaque pagination cursor from a prior response. Omit for the first page.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

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

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • UnknownServiceError –

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

Examples:

List connections The following example lists the connections in the account, most recently updated first.

>>> await client.list_connections(max_results=10)
Source code in docs_src/capo_context/_services/async_context.py
async def list_connections(
    self,
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    max_results: Optional["capo_context.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_context.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_context.types.list_connections_response.ListConnectionsResponse":
    """<p>Lists the connections in your account, most recently updated first.</p>

    Args:
        max_results: <p>Maximum number of results per page (upper bound, not a target). Defaults to 50 when absent. The service might return fewer items.</p>
        next_token: <p>Opaque pagination cursor from a prior response. Omit for the first page.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List connections
        The following example lists the connections in the account, most recently updated first.

        >>> await client.list_connections(max_results=10)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_context.types.list_connections_request.ListConnectionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_context.types.list_connections_response.ListConnectionsResponse"
    ]:
        import capo_context._operations.context.list_connections

        (
            output,
            http_response,
        ) = await capo_context._operations.context.list_connections.async_list_connections(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListConnections")
    )
    input_: capo_context.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

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output