调用ListNodes查询指定集群中的节点列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ehpc:ListNodes |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClusterId |
string |
是 |
待查询的集群 ID。 您可以通过调用 ListClusters 获取集群 ID。 |
ehpc-hz-FYUr32**** |
| Role |
string |
否 |
节点类型。取值范围:
|
Manager |
| HostName |
string |
否 |
节点名称,支持模糊查询,支持 MySQL 的正则表达式。 |
test-HostName |
| PageNumber |
integer |
否 |
显示的页码,起始值为 1。 |
1 |
| PageSize |
integer |
否 |
每页显示的条数。取值范围:1~100 默认值:10 |
10 |
| Sequence |
string |
否 |
节点列表排序方式。取值范围:
默认值:Forward 说明
和 SortBy 同时使用,如 SortBy 设置为 AddedTime,Sequence 设置为 Forward,表示按节点加入时间正序查询。 |
Forward |
| SortBy |
string |
否 |
节点列表排序方式。取值范围:
|
AddedTime |
| Filter |
string |
否 |
节点状态过滤选项。 取值格式为:{"status":"node_status"},请将其中 node_status 替换为节点的状态。节点的取值范围为:
|
{"status":"running"} |
| PrivateIpAddress |
string |
否 |
私网 IP 地址。 |
172.16.**.** |
| HostNamePrefix |
string |
否 |
主机名前缀。查询具有指定前缀的节点。 |
compute |
| HostNameSuffix |
string |
否 |
主机名后缀。查询具有指定后缀的节点。 |
01 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| PageSize |
integer |
本页条数。 |
1 |
| RequestId |
string |
请求 ID。 |
89A1AC0F-4A6C-4F3D-98F9-BEF9A823**** |
| PageNumber |
integer |
当前页码。 |
1 |
| TotalCount |
integer |
列表条目总数。 |
1 |
| Nodes |
object |
||
| NodeInfo |
array<object> |
节点列表信息。 |
|
|
array<object> |
|||
| VpcId |
string |
专有网络 ID。 |
vpc-bp1gnu8br4ay7beb2w**** |
| Status |
string |
节点状态。可能值:
|
running |
| HtEnabled |
boolean |
是否开启超线程。 |
true |
| Expired |
boolean |
包年包月付费节点是否到期。如果是按量付费节点,返回值为 false。 |
false |
| ImageOwnerAlias |
string |
镜像类型。可能值:
|
system |
| LockReason |
string |
节点被锁定类型。可能值:
默认返回为空字符串。 |
financial |
| HostName |
string |
节点名称。 |
test-HostName |
| InstanceType |
string |
节点实例规格。 |
ecs.c5.large |
| PublicIpAddress |
string |
公网 IP 地址。 |
172.16.**.** |
| SpotStrategy |
string |
计算节点竞价策略。 |
NoSpot |
| CreatedByEhpc |
boolean |
是否由 E-HPC 创建。
|
true |
| RegionId |
string |
地域 ID。 |
cn-hangzhou |
| VSwitchId |
string |
交换机 ID。 |
vsw-bp1e47optm9g58zcu**** |
| IpAddress |
string |
节点 IP 地址。 |
172.16.**.** |
| ExpiredTime |
string |
包年包月付费节点到期时间,时间格式为 ISO 8601,使用 UTC 时区。如果是按量付费节点,返回值为空。 |
2020-06-09T06:22:02.000Z |
| Version |
string |
集群客户端版本。 |
1.0.78 |
| ZoneId |
string |
可用区 ID。 |
cn-hangzhou-b |
| AddTime |
string |
加入集群的时间。时间格式为 ISO 8601,使用 UTC 时区。 |
2020-06-09T06:22:02.000Z |
| ImageId |
string |
镜像 ID。 |
centos_7_06_64_20G_alibase_20190711.vhd |
| Location |
string |
节点所在位置。可能值:
|
PublicCloud |
| Id |
string |
节点 ID。 |
i-bp15707mys2rsy0j**** |
| CreateMode |
string |
节点创建方式。可能值:
|
manual |
| Roles |
object |
||
| Role |
array |
节点类别。可能值:
调度器和域服务器都属于管控节点。 |
|
|
string |
节点类别。可能值:
调度器和域服务器都属于管控节点。 |
[“Compute”] |
|
| TotalResources |
object |
该节点使用的资源总量。 |
|
| Gpu |
integer |
GPU 卡个数。 |
0 |
| Cpu |
integer |
CPU 个数。 |
1 |
| Memory |
integer |
内存资源总量。单位:GB |
1024 |
| UsedResources |
object |
计算节点资源使用量,其他类型节点返回值为空。 |
|
| Gpu |
integer |
GPU 卡个数。 |
0 |
| Cpu |
integer |
CPU 个数。 |
0 |
| Memory |
integer |
内存资源总量。单位:GB |
0 |
| StateInSched |
string |
从调度器查看到的节点状态,不同调度器状态不同。 |
active |
示例
正常返回示例
JSON格式
{
"PageSize": 1,
"RequestId": "89A1AC0F-4A6C-4F3D-98F9-BEF9A823****",
"PageNumber": 1,
"TotalCount": 1,
"Nodes": {
"NodeInfo": [
{
"VpcId": "vpc-bp1gnu8br4ay7beb2w****",
"Status": "running",
"HtEnabled": true,
"Expired": false,
"ImageOwnerAlias": "system",
"LockReason": "financial",
"HostName": "test-HostName",
"InstanceType": "ecs.c5.large",
"PublicIpAddress": "172.16.**.**",
"SpotStrategy": "NoSpot",
"CreatedByEhpc": true,
"RegionId": "cn-hangzhou",
"VSwitchId": "vsw-bp1e47optm9g58zcu****",
"IpAddress": "172.16.**.**",
"ExpiredTime": "2020-06-09T06:22:02.000Z",
"Version": "1.0.78",
"ZoneId": "cn-hangzhou-b",
"AddTime": "2020-06-09T06:22:02.000Z",
"ImageId": "centos_7_06_64_20G_alibase_20190711.vhd",
"Location": "PublicCloud",
"Id": "i-bp15707mys2rsy0j****",
"CreateMode": "manual",
"Roles": {
"Role": [
"[“Compute”]"
]
},
"TotalResources": {
"Gpu": 0,
"Cpu": 1,
"Memory": 1024
},
"UsedResources": {
"Gpu": 0,
"Cpu": 0,
"Memory": 0
},
"StateInSched": "active"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParams | The specified parameter %s is invalid. | 指定的参数 %s 无效。 |
| 400 | NotEnabled | You have not enabled this service | 您的账户还未开通此服务 |
| 500 | UnknownError | An unknown error occurred. | 未知错误 |
| 404 | ClusterNotFound | The specified cluster does not exist. | 指定的集群不存在,请您检查该参数是否正确。 |
| 404 | ManagerNotFound | The manager nodes do not exist or their status is abnormal. | 管理节点不存在或状态异常。 |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server | 请求失败,服务暂时不可用 |
| 406 | EcsError | An error occurred while calling the ECS API operation. | ECS API调用出错. %s |
| 406 | DbError | A database service error occurred. | 数据库请求失败 |
| 406 | RedisError | A Redis service error occurred. | Redis请求失败 |
| 406 | AgentError | The agent service request failed. | 集群侧命令运行失败。%s |
| 406 | AliyunError | An Alibaba Cloud product error occurred. | 阿里云产品错误。%s |
| 407 | NotAuthorized | You are not authorized by RAM for this request. | 此请求未获得RAM授权 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。