调用ListNodes查询指定集群中的节点列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String ListNodes

系统规定参数。取值:ListNodes

ClusterId String ehpc-hz-FYUr32****

集群ID。

Role String Manager

节点角色。取值范围:

  • Manager:管控节点
  • Login:登录节点
  • Compute:计算节点
HostName String test-HostName

节点名称,支持模糊查询,支持MySQL的正则表达式。

PageNumber Integer 1

显示的页码,起始值为1。

PageSize Integer 10

每页显示的条数。取值范围:1~100

默认值:10

Sequence String Forward

支持节点加入时间的正序或逆序查询。取值范围:

  • Forward:按节点的加入时间正序排序。
  • Backward:按节点的加入时间逆序排序。

默认值:Forward

SortBy String AddedTime

节点列表排序方式。取值范围:

  • AddedTime:按加入时间排序
  • HostName:按节点主机名称排序
Filter String uninit

节点列表过滤选项。取值范围:

  • uninit:安装中
  • exception:异常
  • running:运行中
  • initing:初始化中
  • releasing:释放中
  • untracking:未加入集群
  • stopped:已停止
PrivateIpAddress String 172.16.**.**

私网IP地址。

返回数据

名称 类型 示例值 描述
Nodes Array of NodeInfo

节点列表信息。

NodeInfo
AddTime String 2020-06-09T06:22:02.000Z

加入集群的时间。

CreateMode String manual

节点创建方式。可能值:

  • manual:手动扩容
  • autoscale:自动扩容
CreatedByEhpc Boolean true

是否由E-HPC创建。

Expired Boolean false

包年包月付费节点是否到期。如果是按量付费节点,返回值为false。

ExpiredTime String 2020-06-09T06:22:02.000Z

包年包月付费节点到期时间。如果是按量付费节点,返回值为空。

HostName String test-HostName

节点名称。

HtEnabled Boolean true

是否开启超线程。

Id String i-bp15707mys2rsy0j****

节点ID。

ImageId String centos_7_06_64_20G_alibase_20190711.vhd

镜像ID。

ImageOwnerAlias String system

镜像类型。可能值:

  • system:公共镜像
  • self:自定义镜像
  • others:共享镜像
  • marketplace:镜像市场镜像
InstanceType String ecs.c5.large

节点实例规格。

IpAddress String 172.16.**.**

节点IP地址。

Location String PublicCloud

节点所在位置。可能值:

  • OnPremise:本地节点
  • PublicCloud:公共云节点
LockReason String financial

节点被锁定类型。可能值:

  • financial:因欠费被锁定。
  • security:因安全原因被锁定。
  • recycling:抢占式实例的待释放锁定状态。
  • dedicatedhostfinancial:因为专有宿主机欠费导致ECS实例被锁定。

默认返回为空字符串。

PublicIpAddress String 172.16.**.**

公网IP地址。

RegionId String cn-hangzhou

地域ID。

Roles List [“Compute”]

节点类别。可能值:

  • Scheduler:主调度器
  • SchedulerBackup:备用调度器
  • Account:主域服务器
  • AccountBackup:备用域服务器
  • Login:登录节点
  • Compute:计算节点

调度器和域服务器都属于管控节点。

SpotStrategy String NoSpot

计算节点竞价策略。

Status String running

节点状态。可能值:

  • uninit:安装中
  • exception:异常
  • running:运行中
  • initing:初始化中
  • releasing:释放中
  • untracking:未加入集群
  • stopped:已停止
TotalResources Struct

资源总量。

Cpu Integer 1

CPU资源总量。单位:核

Gpu Integer 0

GPU资源总量。单位:卡

Memory Integer 1024

内存资源总量。单位:GB

UsedResources Struct

计算节点资源使用量,其他类型节点返回值为空。

Cpu Integer 0

CPU资源总量。单位:核

Gpu Integer 0

GPU资源总量。单位:卡

Memory Integer 0

内存资源总量。单位:GB

VSwitchId String vsw-bp1e47optm9g58zcu****

交换机ID。

Version String 1.0.78

集群客户端版本。

VpcId String vpc-bp1gnu8br4ay7beb2w****

专有网络ID。

ZoneId String cn-hangzhou-b

可用区ID。

PageNumber Integer 1

当前页码。

PageSize Integer 1

本页条数。

RequestId String 89A1AC0F-4A6C-4F3D-98F9-BEF9A823A5F7

请求ID。

TotalCount Integer 1

列表条目总数。

示例

请求示例

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=ListNodes
&ClusterId=ehpc-hz-FYUr32****
&<公共请求参数>

正常返回示例

XML格式

<ListNodesResponse>
      <TotalCount>1</TotalCount>
      <RequestId>89A1AC0F-4A6C-4F3D-98F9-BEF9A823A5F7</RequestId>
      <PageSize>1</PageSize>
      <PageNumber>1</PageNumber>
      <Nodes>
            <NodeInfo>
                  <Status>running</Status>
                  <ImageOwnerAlias>system</ImageOwnerAlias>
                  <ZoneId>cn-hangzhou-h</ZoneId>
                  <VSwitchId>vsw-bp19uonfl1cz47att****</VSwitchId>
                  <Expired>false</Expired>
                  <Roles>
                        <Role>Compute</Role>
                  </Roles>
                  <AddTime>2020-12-24T03:18:47.000Z</AddTime>
                  <UsedResources>
                        <Memory>0</Memory>
                        <Cpu>0</Cpu>
                        <Gpu>0</Gpu>
                  </UsedResources>
                  <PublicIpAddress></PublicIpAddress>
                  <CreateMode>manual</CreateMode>
                  <VpcId>vpc-bp1se4wjbp0760yju****</VpcId>
                  <Version>1.0.78</Version>
                  <TotalResources>
                        <Memory>1024</Memory>
                        <Cpu>1</Cpu>
                        <Gpu>0</Gpu>
                  </TotalResources>
                  <ImageId>centos_7_06_64_20G_alibase_2019071****</ImageId>
                  <IpAddress>172.11.**.**</IpAddress>
                  <HtEnabled>true</HtEnabled>
                  <Id>i-bp15707mys2rsy0j****</Id>
                  <RegionId>cn-hangzhou</RegionId>
                  <LockReason>financial</LockReason>
                  <InstanceType>ecs.c5.large</InstanceType>
                  <HostName>test-HostName</HostName>
                  <SpotStrategy>NoSpot</SpotStrategy>
                  <Location>PublicCloud</Location>
            </NodeInfo>
      </Nodes>
</ListNodesResponse>

JSON格式

{
	"TotalCount": 1,
	"RequestId": "89A1AC0F-4A6C-4F3D-98F9-BEF9A823A5F7",
	"PageSize": 1,
	"PageNumber": 1,
	"Nodes": {
		"NodeInfo": [{
			"Status": "running",
			"ImageOwnerAlias": "system",
			"ZoneId": "cn-hangzhou-h",
			"VSwitchId": "vsw-bp19uonfl1cz47att****",
			"Expired": false,
			"Roles": {
				"Role": [
					"Compute"
				]
			},
			"AddTime": "2020-12-24T03:18:47.000Z",
			"UsedResources": {
				"Memory": 0,
				"Cpu": 0,
				"Gpu": 0
			},
			"PublicIpAddress": "",
			"CreateMode": "manual",
			"VpcId": "vpc-bp1se4wjbp0760yju****",
			"Version": "1.0.78",
			"TotalResources": {
				"Memory": 1024,
				"Cpu": 1,
				"Gpu": 0
			},
			"ImageId": "centos_7_06_64_20G_alibase_2019071****",
			"IpAddress": "172.11.**.**",
			"HtEnabled": true,
			"Id": "i-bp15707mys2rsy0j****",
			"RegionId": "cn-hangzhou",
			"LockReason": "financial",
			"InstanceType": "ecs.c5.large",
			"HostName": "test-HostName",
			"SpotStrategy": "NoSpot",
			"Location": "PublicCloud"
		}]
	}
}

错误码

HttpCode 错误码 错误信息 描述
503 ServiceUnavailable The request has failed due to a temporary failure of the server 请求失败,服务暂时不可用

访问错误中心查看更多错误码。