Skip to content

get_environment

get_environment(
    id: EnvironmentId, *, config_overrides: Optional[InterconnectClientConfig] = None
) -> GetEnvironmentResponse

Describes a specific Environment

Parameters:

Raises:

Examples:

Get a specific environment

>>> client.get_environment(id='mce-aws-acme-1')
Source code in docs_src/capo_interconnect/_services/interconnect.py
def get_environment(
    self,
    id: "capo_interconnect.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[InterconnectClientConfig] = None,
) -> "capo_interconnect.types.get_environment_response.GetEnvironmentResponse":
    """<p>Describes a specific <a>Environment</a> </p>

    Args:
        id: <p>The identifier of the specific <a>Environment</a> to describe.</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:
        Get a specific environment

        >>> client.get_environment(id='mce-aws-acme-1')
    """

    def _handler(
        req: "OperationRequest[capo_interconnect.types.get_environment_request.GetEnvironmentRequest]",
    ) -> OperationResponse[
        "capo_interconnect.types.get_environment_response.GetEnvironmentResponse"
    ]:
        import capo_interconnect._operations.interconnect.get_environment

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetEnvironment")
    )
    input_: capo_interconnect.types.get_environment_request.GetEnvironmentRequest = {
        "id": id
    }

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