tencent cloud

文档反馈

DescribeNodePools

最后更新时间:2024-11-25 12:07:23

1. API Description

Domain name for API request: tke.intl.tencentcloudapi.com.

This API is used to query a TKE node pool list.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeNodePools.
Version Yes String Common Params. The value used for this API: 2022-05-01.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ClusterId Yes String Cluster ID
Filters.N No Array of Filter Query filter criteria:
· NodePoolsName
Filter by [Node Pool Name].
Type: String
Required: No



· NodePoolsId
Filter by [Node Pool id].
Type: String
Required: No



· tags
Filter by [Tag Key-value Pairs].
Type: String
Required: No



· tag:tag-key
Filter by [Tag Key-value Pairs].
Type: String
Required: No
Offset No Integer Offset. Default value: 0
Limit No Integer Maximum number of output entries. Default value: 20; maximum value: 100.

3. Output Parameters

Parameter Name Type Description
NodePools Array of NodePool Node pool list
Note: This field may return "null", indicating that no valid value can be obtained.
TotalCount Integer Total resources
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Querying a TKE Node Pool List

This example shows you how to query a TKE node pool list.

Input Example

POST / HTTP/1.1
Host: tke.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeNodePools
<Common request parameters>

{
    "ClusterId": "cls-h8atd7dj",
    "Filters": [
        {
            "Name": "NodePoolsName",
            "Values": [
                "cputest"
            ]
        }
    ],
    "Offset": 0,
    "Limit": 0
}

Output Example

{
    "Response": {
        "NodePools": [
            {
                "Annotations": [],
                "ClusterId": "cls-h8atd7dj",
                "CreatedAt": "2023-01-15 17:55:38 +0000 UTC",
                "DeletionProtection": false,
                "External": null,
                "Labels": [],
                "LifeState": "normal",
                "Name": "cputest",
                "Native": null,
                "NodePoolId": "np-rbl9quwv",
                "Regular": {
                    "AutoscalingGroupId": "asg-mv6aoc57",
                    "AutoscalingGroupStatus": "disabled",
                    "DesiredNodesNum": 0,
                    "InstanceAdvancedSettings": {
                        "DesiredPodNumber": 32,
                        "ExtraArgs": {
                            "Kubelet": null
                        },
                        "PreStartUserScript": "",
                        "RuntimeConfig": {
                            "RuntimeRootDir": "",
                            "RuntimeType": "docker",
                            "RuntimeVersion": "19.3"
                        },
                        "UserScript": ""
                    },
                    "LaunchConfigurationId": "asc-ay1hkbqh",
                    "MaxNodesNum": 1,
                    "MinNodesNum": 0,
                    "NodeCountSummary": {
                        "AutoscalingAdded": {
                            "Initializing": 0,
                            "Joining": 0,
                            "Normal": 0,
                            "Total": 0
                        },
                        "ManuallyAdded": {
                            "Initializing": 0,
                            "Joining": 0,
                            "Normal": 0,
                            "Total": 0
                        }
                    },
                    "NodePoolOs": "ubuntu20.04x86_64"
                },
                "Super": null,
                "Tags": [],
                "Taints": [],
                "Type": "Regular",
                "Unschedulable": false
            },
            {
                "Annotations": [],
                "ClusterId": "cls-h8att7dj",
                "CreatedAt": "2023-11-16 20:56:55 +0000 UTC",
                "DeletionProtection": true,
                "External": {
                    "NodesNum": 1,
                    "RuntimeConfig": {
                        "RuntimeRootDir": null,
                        "RuntimeType": "docker",
                        "RuntimeVersion": "docker-19.3"
                    }
                },
                "Labels": [
                    {
                        "Name": "node.kubernetes.io/instance-type",
                        "Value": "external"
                    },
                    {
                        "Name": "tke.cloud.tencent.com/cbs-mountable",
                        "Value": "false"
                    },
                    {
                        "Name": "externalnode.tke.cloud.tencent.com/version",
                        "Value": "v2"
                    }
                ],
                "LifeState": "Running",
                "Name": "cpu",
                "Native": null,
                "NodePoolId": "np-llfflb19",
                "Regular": null,
                "Super": null,
                "Tags": [],
                "Taints": [],
                "Type": "External",
                "Unschedulable": false
            },
            {
                "Annotations": [],
                "ClusterId": "cls-h8att7dj",
                "CreatedAt": "2023-11-16 20:56:54 +0000 UTC",
                "DeletionProtection": true,
                "External": {
                    "NodesNum": 4,
                    "RuntimeConfig": {
                        "RuntimeRootDir": null,
                        "RuntimeType": "docker",
                        "RuntimeVersion": "docker-19.3"
                    }
                },
                "Labels": [
                    {
                        "Name": "externalnode.tke.cloud.tencent.com/version",
                        "Value": "v2"
                    },
                    {
                        "Name": "node.kubernetes.io/instance-type",
                        "Value": "external"
                    },
                    {
                        "Name": "nvidia-device-enable",
                        "Value": "enable"
                    },
                    {
                        "Name": "tke.cloud.tencent.com/cbs-mountable",
                        "Value": "false"
                    }
                ],
                "LifeState": "Running",
                "Name": "gpu",
                "Native": null,
                "NodePoolId": "np-iw0qds8t",
                "Regular": null,
                "Super": null,
                "Tags": [],
                "Taints": [],
                "Type": "External",
                "Unschedulable": false
            }
        ],
        "RequestId": "354c45c4-0eb2-464d-82f8-3dd55ca88a80",
        "TotalCount": 3
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError.DbRecordNotFound Record not found.
InternalError.Param Param error.
InternalError.UnexpectedInternal Unknown internal error.
InvalidParameter.Param Parameter error.
ResourceNotFound The resource does not exist.
ResourceNotFound.ClusterNotFound The cluster does not exist.
ResourceUnavailable.ClusterState The cluster status does not support this operation.