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