ListNodegroups
In this article:
ListNodegroups#
Description#
Returns the list of names of node groups associated with the specified Kubernetes cluster.
Request Syntax#
GET /clusters/name/node-groups?maxResults=maxResults&nextToken=nextToken HTTP/1.1
URI Request Parameters#
The request uses the following URI parameters.
maxResults — The maximum number of names of node groups whose descriptions are returned by ListNodegroups in paginated output.
Required: No
Type: Integer
Value range: Min —
1
. Max —100
.Default value:
100
name — The name of the cluster for which the list of names of node groups is wanted.
Type: String
Required: Yes
NextToken — NextToken returned by a previous call (see Response Elements).
Type: String
Required: No
Request Parameters#
Request body is absent.
Response Syntax#
HTTP/1.1 200
Content-type: application/json
{
"nextToken": "string",
"nodegroups": [ "string" ]
}
Response Elements#
If the request is executed successfully, API will return an HTTP response with 200 code. The response contains the following data in JSON format.
NextToken — The token is returned only when the response cannot hold all the node group names that meet the criteria. To receive further data, the returned value must be passed as the NextToken parameter in the same request.
Type: String
nodegroups— A list of all node group names associated with the specified cluster.
Type: List of strings
Examples#
To manage Kubernetes clusters in K2 Cloud via API, you should install the customized version of the boto3 library:
boto3 K2 Cloud boto3 Client
import boto3
session = boto3.Session(
aws_access_key_id="<AWS_ACCESS_KEY_ID>",
aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
region_name="",
)
eks_client = session.client(
'eks',
endpoint_url='https://eks.k2.cloud/',
)
eks_client.list_nodegroups(clusterName="production")
c2-eks K2 Cloud API Client
c2-eks ListNodegroups clusterName production
aws-cli
aws eks --endpoint https://eks.k2.cloud/ list-nodegroups --cluster-name production