Skip to content

get_environment async

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

Returns a description of the specified environment.

Parameters:

  • environment_id (EnvironmentId) –

    A unique ID for the environment.

Raises:

  • ResourceNotFoundException –

    A service resource associated with the request could not be found. The resource might not be specified correctly, or it may have a state of DELETED.

  • ValidationException –

    The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.

  • UnknownServiceError –

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

Source code in docs_src/capo_evs/_services/async_evs.py
async def get_environment(
    self,
    environment_id: "capo_evs.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[AsyncevsClientConfig] = None,
) -> "capo_evs.types.get_environment_response.GetEnvironmentResponse":
    """<p>Returns a description of the specified environment.</p>

    Args:
        environment_id: <p>A unique ID for the environment.</p>

    Raises:
        capo_evs.errors.resource_not_found_exception.ResourceNotFoundException: <p>A service resource associated with the request could not be found. The resource might not be specified correctly, or it may have a <code>state</code> of <code>DELETED</code>.</p>
        capo_evs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.</p>
        capo_evs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_evs.types.get_environment_request.GetEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_evs.types.get_environment_response.GetEnvironmentResponse"
    ]:
        import capo_evs._operations.amazon_elastic_v_mware_service.get_environment

        (
            output,
            http_response,
        ) = await capo_evs._operations.amazon_elastic_v_mware_service.get_environment.async_get_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_evs.types.get_environment_response.GetEnvironmentResponse",
    ) -> dict[str, Any]:
        import capo_evs.types.get_environment_response

        return capo_evs.types.get_environment_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetEnvironment", redact_output=_redact_output),
    )
    input_: capo_evs.types.get_environment_request.GetEnvironmentRequest = {
        "environment_id": environment_id
    }

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