您可以调用DescribeClusterNodes接口,查询符合条件的节点列表信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cs:DescribeClusterNodes |
get |
*Cluster
|
无 | 无 |
请求语法
GET /clusters/{ClusterId}/nodes HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClusterId |
string |
是 |
集群 ID。 |
c82e6987e2961451182edacd74faf**** |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| instanceIds |
string |
否 |
节点实例 ID 列表,多值使用英文半角逗号(,)分隔。 |
"i-bp11xjhwkj8k966u****,i-bp1dmhc2bu5igkyq****" |
| nodepool_id |
string |
否 |
节点池 ID。 |
npe25633140a7d4fbea56cd0479c****** |
| state |
string |
否 |
集群节点状态,按照集群节点运行状态进行过滤,取值:
默认值: |
running |
| pageSize |
string |
否 |
每页可显示的最大记录数。取值范围为[1,100]。 默认值:10。 |
10 |
| pageNumber |
string |
否 |
当前查询的页码数。 默认值:1。 |
1 |
| nodeNames |
string |
否 |
cn-hangzhou.192.168.0.1 |
|
| nodeIps |
string |
否 |
192.168.0.1 |
|
| nodeLabels |
string |
否 |
nodeLabels=app=nginx,env=prod |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回数据体。 |
||
| nodes |
array<object> |
节点详情列表。 |
|
|
object |
节点详情。 |
||
| creation_time |
string |
节点创建时间。 |
2025-04-16T07:28:00Z |
| error_message |
string |
节点创建时错误信息。 |
error*** |
| expired_time |
string |
节点到期时间。 |
2099-12-31T15:59:00Z |
| host_name |
string |
节点主机名。 |
iZ2vcckdmxp7u0urj2k**** |
| image_id |
string |
节点使用的系统镜像 ID。 |
aliyun_3_x64_20G_alibase_20241218.vhd |
| instance_charge_type |
string |
节点付费类型。取值:
|
PostPaid |
| instance_id |
string |
节点实例 ID。 |
i-2vcckdmxp7u0urj2**** |
| instance_name |
string |
节点在集群中的名称。 |
worker-k8s-for-cs-c5cdf7e3938bc4f8eb0e44b21a80f**** |
| instance_role |
string |
节点角色类型:
|
Worker |
| instance_status |
string |
节点对应的 ECS 状态。
|
Running |
| instance_type |
string |
节点规格。 |
ecs.c5.xlarge |
| instance_type_family |
string |
节点所属 ECS 规格族名称。 |
ecs.c5 |
| ip_address |
array |
节点 IP 地址。 |
|
|
string |
IP 地址。 |
192.168.xx.xx |
|
| is_aliyun_node |
boolean |
是否为阿里云实例。取值:
|
true |
| node_name |
string |
节点名称,集群内节点标识。 |
cn-chengdu.192.168xx.xx |
| node_status |
string |
节点是否就绪。取值:
|
Ready |
| nodepool_id |
string |
节点池 ID。 |
np0794239424a84eb7a95327369d56**** |
| source |
string |
节点通过何种方式初始化,例如:手动创建或 ROS 创建。 |
ess |
| state |
string |
节点运行状态。取值:
|
running |
| spot_strategy |
string |
抢占式实例类型,取值:
|
NoSpot |
| page |
object |
分页信息。 |
|
| page_number |
integer |
当前页码。 |
1 |
| page_size |
integer |
每页可显示的最大记录数。 |
10 |
| total_count |
integer |
结果总数。 |
5 |
示例
正常返回示例
JSON格式
{
"nodes": [
{
"creation_time": "2025-04-16T07:28:00Z",
"error_message": "error***",
"expired_time": "2099-12-31T15:59:00Z",
"host_name": "iZ2vcckdmxp7u0urj2k****",
"image_id": "aliyun_3_x64_20G_alibase_20241218.vhd",
"instance_charge_type": "PostPaid",
"instance_id": "i-2vcckdmxp7u0urj2****",
"instance_name": "worker-k8s-for-cs-c5cdf7e3938bc4f8eb0e44b21a80f****",
"instance_role": "Worker",
"instance_status": "Running",
"instance_type": "ecs.c5.xlarge",
"instance_type_family": "ecs.c5",
"ip_address": [
"192.168.xx.xx"
],
"is_aliyun_node": true,
"node_name": "cn-chengdu.192.168xx.xx",
"node_status": "Ready",
"nodepool_id": "np0794239424a84eb7a95327369d56****",
"source": "ess",
"state": "running",
"spot_strategy": "NoSpot"
}
],
"page": {
"page_number": 1,
"page_size": 10,
"total_count": 5
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。