调用ListClusters查询账号中所有地域拥有的集群列表。

调试

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

请求参数

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

系统规定参数。取值:ListClusters

PageNumber Integer 1

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

PageSize Integer 10

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

默认值:10

返回数据

名称 类型 示例值 描述
Clusters Array of ClusterInfoSimple

集群详细信息。

ClusterInfoSimple
AccountType String nis

账户服务器类型。可能值:

  • nis
  • ldap
BaseOsTag String CentOS_7.2_64

基础镜像操作系统标签,仅管控节点使用。

ClientVersion String 1.0.64

集群客户端版本。

ComputeSpotPriceLimit Float 0.034

计算节点下ECS实例的每小时最高价格。返回值最多保留小数点后3位。

ComputeSpotStrategy String NoSpot

计算节点竞价策略。可能值:

  • NoSpot:正常按量付费实例。
  • SpotWithPriceLimit:设置上限价格的抢占式实例。
  • SpotAsPriceGo:系统自动出价,跟随当前市场实际价格。
Computes Struct

计算节点信息。

ExceptionCount Integer 0

异常节点数。

NormalCount Integer 1

正常节点数。

OperatingCount Integer 1

操作进行中的节点数量,包括初始化、安装中、释放中等状态的节点。

StoppedCount Integer 0

停止节点数。

Total Integer 2

总节点数。

Count Integer 3

集群计算节点数目。

CreateTime String 2020-10-30T07:39:20.000Z

集群创建时间。

DeployMode String Standard

集群部署模式。可能值:

  • Standard:账号节点、调度节点、登录节点、计算节点分离部署。
  • Advanced:HA模式部署。
  • Simple:账号节点和调度节点混合部署在一个节点上,登录节点和计算节点分离部署。
  • Tiny:账号节点、调度节点、登录节点混合部署在一个节点上,计算节点分离部署。
Description String clusterdescription

集群描述。

EhpcVersion String 1.0.0

EHPC版本。

Id String ehpc-hz-jeJki6****

集群ID。

ImageId String wi_1607_x64_dtc_zh_40G_alibase****

镜像ID。

ImageOwnerAlias String system

镜像类型。可能值:

  • system:公共镜像
  • self:自定义镜像
  • others:共享镜像
  • marketplace:镜像市场镜像
InstanceChargeType String PostPaid

集群实例付费类型。可能值:

  • PostPaid:按量付费
  • PrePaid:包年包月
InstanceType String ecs.n1.tiny

计算节点实例规格。

IsComputeEss Boolean false

是否启用弹性伸缩组。可能值:

  • true:启用
  • false:未启用
Location String PublicCloud

集群所在位置。可能值:

  • OnPremise:混合云集群。
  • PublicCloud:公有云集群。
LoginNodes String {"Id": "i-bp13x4is8pvdhws7e****"}

登录节点列表。

Managers Struct

管理节点信息。

ExceptionCount Integer 0

异常节点数。

NormalCount Integer 1

正常节点数。

OperatingCount Integer 1

操作进行中的节点数量,包括初始化、安装中、释放中等状态的节点。

StoppedCount Integer 0

停止节点数。

Total Integer 2

总管理节点数目。

Name String test

集群名称。

NodePrefix String test

主机前缀名。

NodeSuffix String name

主机后缀名。

OsTag String CentOS_7.2_64

操作系统镜像标签。

RegionId String cn-hangzhou

地域ID。

SchedulerType String pbs

调度服务器类型。可能值:

  • pbs
  • slurm
  • opengridscheduler
  • deadline
Status String running

集群状态。可能值:

  • uninit:未初始化
  • creating:创建中
  • init:初始化中
  • running:运行中
  • exception:异常
  • releasing:释放中
TotalResources Struct

集群资源总量。

Cpu Integer 1

CPU资源。单位:核

Gpu Integer 0

GPU资源。单位:卡

Memory Integer 1024

内存资源。

UsedResources Struct

集群资源使用量。

Cpu Integer 1

CPU资源。单位:核

Gpu Integer 0

GPU资源。单位:卡

Memory Integer 1024

内存资源。

VSwitchId String vsw-bp1lfcjbfb099rrjn****

交换机ID。

VpcId String vpc-b3f3edefefeep0760yju****

VPC ID。

ZoneId String cn-hangzhou-c

可用区ID。

PageNumber Integer 1

当前页码。

PageSize Integer 1

本页条数。

RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

请求ID。

TotalCount Integer 1

列表条目总数。

示例

请求示例

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=ListClusters
&<公共请求参数>

正常返回示例

XML格式

<ListClustersResponse>
      <TotalCount>1</TotalCount>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
      <PageSize>1</PageSize>
      <PageNumber>1</PageNumber>
      <Clusters>
            <ClusterInfoSimple>
                  <ImageOwnerAlias>system</ImageOwnerAlias>
                  <Description>clusterdescription</Description>
                  <NodePrefix>test</NodePrefix>
                  <InstanceChargeType>PostPaid</InstanceChargeType>
                  <ComputeSpotPriceLimit>0.034</ComputeSpotPriceLimit>
                  <NodeSuffix>name</NodeSuffix>
                  <Count>3</Count>
                  <ClientVersion>1.0.64</ClientVersion>
                  <Name>test</Name>
                  <DeployMode>Standard</DeployMode>
                  <TotalResources>
                        <Memory>1024</Memory>
                        <Cpu>1</Cpu>
                        <Gpu>0</Gpu>
                  </TotalResources>
                  <ImageId>wi_1607_x64_dtc_zh_40G_alibase****</ImageId>
                  <InstanceType>ecs.n1.tiny</InstanceType>
                  <IsComputeEss>false</IsComputeEss>
                  <LoginNodes>
                        <Id>i-bp13x4is8pvdhws7e****</Id>
                  </LoginNodes>
                  <Computes>
                        <NormalCount>1</NormalCount>
                        <OperatingCount>0</OperatingCount>
                        <StoppedCount>1</StoppedCount>
                        <Total>2</Total>
                        <ExceptionCount>0</ExceptionCount>
                  </Computes>
                  <Status>running</Status>
                  <ZoneId>cn-hangzhou-c</ZoneId>
                  <VSwitchId>vsw-bp1lfcjbfb099rrjn****</VSwitchId>
                  <CreateTime>2020-10-30T07:39:20.000Z</CreateTime>
                  <SchedulerType>pbs</SchedulerType>
                  <ComputeSpotStrategy>NoSpot</ComputeSpotStrategy>
                  <AccountType>nis</AccountType>
                  <EhpcVersion>1.0.0</EhpcVersion>
                  <BaseOsTag>CentOS_7.2_64</BaseOsTag>
                  <UsedResources>
                        <Memory>1024</Memory>
                        <Cpu>1</Cpu>
                        <Gpu>0</Gpu>
                  </UsedResources>
                  <VpcId>vpc-b3f3edefefeep0760yju****</VpcId>
                  <Managers>
                        <NormalCount>1</NormalCount>
                        <OperatingCount>1</OperatingCount>
                        <StoppedCount>0</StoppedCount>
                        <Total>2</Total>
                        <ExceptionCount>0</ExceptionCount>
                  </Managers>
                  <OsTag>CentOS_7.2_64</OsTag>
                  <Id>ehpc-hz-jeJki6****</Id>
                  <RegionId>cn-hangzhou</RegionId>
                  <Location>PublicCloud</Location>
            </ClusterInfoSimple>
      </Clusters>
</ListClustersResponse>

JSON格式

{
	"TotalCount": 1,
	"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
	"PageSize": 1,
	"PageNumber": 1,
	"Clusters": {
		"ClusterInfoSimple": [
			{
				"ImageOwnerAlias": "system",
				"Description": "clusterdescription",
				"NodePrefix": "test",
				"InstanceChargeType": "PostPaid",
				"ComputeSpotPriceLimit": 0.034,
				"NodeSuffix": "name",
				"Count": 3,
				"ClientVersion": "1.0.64",
				"Name": "test",
				"DeployMode": "Standard",
				"TotalResources": {
					"Memory": 1024,
					"Cpu": 1,
					"Gpu": 0
				},
				"ImageId": "wi_1607_x64_dtc_zh_40G_alibase****",
				"InstanceType": "ecs.n1.tiny",
                "IsComputeEss": false,
				"LoginNodes": [
					{
						"Id": "i-bp13x4is8pvdhws7e****"
					}
				],
				"Computes": {
					"NormalCount": 1,
					"OperatingCount": 0,
					"StoppedCount": 1,
					"Total": 2,
					"ExceptionCount": 0
				},
				"Status": "running",
				"ZoneId": "cn-hangzhou-c",
				"VSwitchId": "vsw-bp1lfcjbfb099rrjn****",
				"CreateTime": "2020-10-30T07:39:20.000Z",
				"SchedulerType": "pbs",
				"ComputeSpotStrategy": "NoSpot",
				"AccountType": "nis",
				"EhpcVersion": "1.0.0",
				"BaseOsTag": "CentOS_7.2_64",
				"UsedResources": {
					"Memory": 1024,
					"Cpu": 1,
					"Gpu": 0
				},
				"VpcId": "vpc-b3f3edefefeep0760yju****",
				"Managers": {
					"NormalCount": 1,
					"OperatingCount": 1,
					"StoppedCount": 0,
					"Total": 2,
					"ExceptionCount": 0
				},
				"OsTag": "CentOS_7.2_64",
				"Id": "ehpc-hz-jeJki6****",
				"RegionId": "cn-hangzhou",
				"Location": "PublicCloud"
			}
		]
	}
}

错误码

HttpCode 错误码 错误信息 描述
400 InvalidParams The specified parameter %s is invalid. 无效的参数: %s
406 EcsError An error occurred while calling the ECS API operation. ECS API调用出错
503 ServiceUnavailable The request has failed due to a temporary failure of the server 请求失败,服务暂时不可用

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