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/mwaa.py
| def list_environments(
self,
*,
config_overrides: Optional[MWAAClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_mwaa.types.list_environments_input.ListEnvironmentsInput]",
) -> OperationResponse[
"capo_mwaa.types.list_environments_output.ListEnvironmentsOutput"
]:
import capo_mwaa._operations.amazon_mwaa.list_environments
output, http_response = (
capo_mwaa._operations.amazon_mwaa.list_environments.list_environments(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|