Skip to content

get_environment async

get_environment(
    name: EnvironmentName, *, config_overrides: Optional[AsyncMWAAClientConfig] = None
) -> GetEnvironmentOutput

Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.

Parameters:

  • name (EnvironmentName) –

    The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.

Raises:

Source code in docs_src/capo_mwaa/_services/async_mwaa.py
async def get_environment(
    self,
    name: "capo_mwaa.types.environment_name.EnvironmentName",
    *,
    config_overrides: Optional[AsyncMWAAClientConfig] = None,
) -> "capo_mwaa.types.get_environment_output.GetEnvironmentOutput":
    """<p>Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.</p>

    Args:
        name: <p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>

    Raises:
        capo_mwaa.errors.internal_server_exception.InternalServerException: <p>InternalServerException: An internal error has occurred.</p>
        capo_mwaa.errors.resource_not_found_exception.ResourceNotFoundException: <p>ResourceNotFoundException: The resource is not available.</p>
        capo_mwaa.errors.validation_exception.ValidationException: <p>ValidationException: The provided input is not valid.</p>
        capo_mwaa.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mwaa.types.get_environment_input.GetEnvironmentInput]",
    ) -> AsyncOperationResponse[
        "capo_mwaa.types.get_environment_output.GetEnvironmentOutput"
    ]:
        import capo_mwaa._operations.amazon_mwaa.get_environment

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

    def _redact_output(
        output: "capo_mwaa.types.get_environment_output.GetEnvironmentOutput",
    ) -> dict[str, Any]:
        import capo_mwaa.types.get_environment_output

        return capo_mwaa.types.get_environment_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetEnvironment", redact_output=_redact_output),
    )
    input_: capo_mwaa.types.get_environment_input.GetEnvironmentInput = {
        "name": name
    }

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