Skip to content

list_environments async

list_environments(
    *,
    config_overrides: Optional[AsyncMWAAClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListEnvironmentsOutput

Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments.

Parameters:

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

    Retrieves the next page of the results.

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

    The maximum number of results to retrieve per page. For example, 5 environments per page.

Raises:

Source code in docs_src/capo_mwaa/_services/async_mwaa.py
async def list_environments(
    self,
    *,
    config_overrides: Optional[AsyncMWAAClientConfig] = None,
    next_token: Optional["capo_mwaa.types.next_token.NextToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_mwaa.types.list_environments_output.ListEnvironmentsOutput":
    """<p>Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments.</p>

    Args:
        next_token: <p>Retrieves the next page of the results.</p>
        max_results: <p>The maximum number of results to retrieve per page. For example, <code>5</code> environments per page.</p>

    Raises:
        capo_mwaa.errors.internal_server_exception.InternalServerException: <p>InternalServerException: An internal error has occurred.</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.list_environments_input.ListEnvironmentsInput]",
    ) -> AsyncOperationResponse[
        "capo_mwaa.types.list_environments_output.ListEnvironmentsOutput"
    ]:
        import capo_mwaa._operations.amazon_mwaa.list_environments

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEnvironments")
    )
    input_: capo_mwaa.types.list_environments_input.ListEnvironmentsInput = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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