Skip to content

list_environments

list_environments(
    *,
    config_overrides: Optional[InterconnectClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    provider: Optional[Provider] = None,
    location: Optional[Location] = None,
) -> ListEnvironmentsResponse

Lists all of the environments that can produce connections that will land in the called AWS region.

Parameters:

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

    The max number of list results in a single paginated response.

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

    A pagination token from a previous paginated response indicating you wish to get the next page of results.

  • provider (Optional[Provider], default: None ) –

    Filter results to only include Environment objects that connect to the Provider.

  • location (Optional[Location], default: None ) –

    Filter results to only include Environment objects that connect to a given location distiguisher.

Raises:

Examples:

List All Environments

>>> client.list_environments()
Source code in docs_src/capo_interconnect/_services/interconnect.py
def list_environments(
    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,
    provider: Optional["capo_interconnect.types.provider.Provider"] = None,
    location: Optional["capo_interconnect.types.location.Location"] = None,
) -> "capo_interconnect.types.list_environments_response.ListEnvironmentsResponse":
    """<p>Lists all of the environments that can produce connections that will land in the called AWS region.</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>
        provider: <p>Filter results to only include <a>Environment</a> objects that connect to the <a>Provider</a>.</p>
        location: <p>Filter results to only include <a>Environment</a> objects that connect to a given location distiguisher.</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 Environments

        >>> client.list_environments()
    """

    def _handler(
        req: "OperationRequest[capo_interconnect.types.list_environments_request.ListEnvironmentsRequest]",
    ) -> OperationResponse[
        "capo_interconnect.types.list_environments_response.ListEnvironmentsResponse"
    ]:
        import capo_interconnect._operations.interconnect.list_environments

        output, http_response = (
            capo_interconnect._operations.interconnect.list_environments.list_environments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEnvironments")
    )
    input_: capo_interconnect.types.list_environments_request.ListEnvironmentsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if provider is not None:
        input_["provider"] = provider
    if location is not None:
        input_["location"] = location

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