Skip to content

describe_locations

describe_locations(
    *, config_overrides: Optional[DirectConnectClientConfig] = None
) -> Locations

Lists the Direct Connect locations in the current Amazon Web Services Region. These are the locations that can be selected when calling CreateConnection or CreateInterconnect.

Raises:

Source code in docs_src/capo_direct_connect/_services/direct_connect.py
def describe_locations(
    self, *, config_overrides: Optional[DirectConnectClientConfig] = None
) -> "capo_direct_connect.types.locations.Locations":
    """<p>Lists the Direct Connect locations in the current Amazon Web Services Region. These are the locations that can be selected when calling <a>CreateConnection</a> or <a>CreateInterconnect</a>.</p>

    Raises:
        capo_direct_connect.errors.direct_connect_client_exception.DirectConnectClientException: <p>One or more parameters are not valid.</p>
        capo_direct_connect.errors.direct_connect_server_exception.DirectConnectServerException: <p>A server-side error occurred.</p>
        capo_direct_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[None]",
    ) -> OperationResponse["capo_direct_connect.types.locations.Locations"]:
        import capo_direct_connect._operations.overture_service.describe_locations

        output, http_response = (
            capo_direct_connect._operations.overture_service.describe_locations.describe_locations(
                req.options
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeLocations")
    )

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