listNodegroups method

Future<ListNodegroupsResponse> listNodegroups({
  1. required String clusterName,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the Amazon EKS managed node groups associated with the specified cluster in your AWS account in the specified Region. Self-managed node groups are not listed.

May throw InvalidParameterException. May throw ClientException. May throw ServerException. May throw ServiceUnavailableException. May throw ResourceNotFoundException.

Parameter clusterName : The name of the Amazon EKS cluster that you would like to list node groups in.

Parameter maxResults : The maximum number of node group results returned by ListNodegroups in paginated output. When you use this parameter, ListNodegroups returns only maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListNodegroups request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListNodegroups returns up to 100 results and a nextToken value if applicable.

Parameter nextToken : The nextToken value returned from a previous paginated ListNodegroups request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

Implementation

Future<ListNodegroupsResponse> listNodegroups({
  required String clusterName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(clusterName, 'clusterName');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/clusters/${Uri.encodeComponent(clusterName)}/node-groups',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListNodegroupsResponse.fromJson(response);
}