Skip to content

list_environments

list_environments(
    *,
    config_overrides: Optional[m2ClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    names: Optional[EntityNameList] = None,
    engine_type: Optional[EngineType] = None,
) -> ListEnvironmentsResponse

Lists the runtime environments.

Parameters:

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

    A pagination token to control the number of runtime environments displayed in the list.

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

    The maximum number of runtime environments to return.

  • names (Optional[EntityNameList], default: None ) –

    The names of the runtime environments. Must be unique within the account.

  • engine_type (Optional[EngineType], default: None ) –

    The engine type for the runtime environment.

Raises:

Source code in docs_src/capo_m2/_services/m2.py
def list_environments(
    self,
    *,
    config_overrides: Optional[m2ClientConfig] = None,
    next_token: Optional["capo_m2.types.next_token.NextToken"] = None,
    max_results: Optional["capo_m2.types.max_results.MaxResults"] = None,
    names: Optional["capo_m2.types.entity_name_list.EntityNameList"] = None,
    engine_type: Optional["capo_m2.types.engine_type.EngineType"] = None,
) -> "capo_m2.types.list_environments_response.ListEnvironmentsResponse":
    """<p>Lists the runtime environments.</p>

    Args:
        next_token: <p>A pagination token to control the number of runtime environments displayed in the list.</p>
        max_results: <p>The maximum number of runtime environments to return.</p>
        names: <p>The names of the runtime environments. Must be unique within the account.</p>
        engine_type: <p>The engine type for the runtime environment.</p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_m2.types.list_environments_request.ListEnvironmentsRequest]",
    ) -> OperationResponse[
        "capo_m2.types.list_environments_response.ListEnvironmentsResponse"
    ]:
        import capo_m2._operations.aws_supernova_control_plane_service.list_environments

        output, http_response = (
            capo_m2._operations.aws_supernova_control_plane_service.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_m2.types.list_environments_request.ListEnvironmentsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if names is not None:
        input_["names"] = names
    if engine_type is not None:
        input_["engine_type"] = engine_type

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