调用ListClusters分页查询集群列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListClusters |
系统规定参数。取值:ListClusters。 |
RegionId | String | 是 | cn-hangzhou |
地域ID。 |
CreateType | String | 否 | ON-DEMAND |
集群创建类型。可选值: ON-DEMAND。 MANUAL。 |
MachineType | String | 否 | ECS |
机器类型。 |
IsDesc | Boolean | 否 | false |
是否倒序排列。 |
DepositType | String | 否 | HALF_MANAGED |
托管类型,标识集群是全托管还是半托管。枚举值: HALF_MANAGED。 FULLY_MANAGED。 |
PageNumber | Integer | 否 | 1 |
分页分数,从1开始。 |
PageSize | Integer | 否 | 10 |
分页大小。 |
DefaultStatus | Boolean | 否 | true |
是否查询默认状态为初始化中、等待构建、空闲、运行中、释放中、创建失败的集群。 |
Name | String | 否 | cluster_name |
集群名。 |
ResourceGroupId | String | 否 | rg-bp67acfmxazb4p**** |
DDI实例和节点ECS实例所在的企业资源组ID |
Tag.N.Key | String | 否 | TestKey |
DDI实例和节点ECS实例的标签键。 |
Tag.N.Value | String | 否 | TestValue |
DDI实例和节点ECS实例的标签值。N的取值范围:1~20。一旦传入该值,可以为空字符串。标签值的取值范围1~128,不能以acs:开头,不能包含http://或者https://。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
PageSize | Integer | 10 |
分页大小。 |
RequestId | String | BF4FBAC6-B03E-4BFB-B6DB-EB53C34F2E22 |
请求ID。 |
PageNumber | Integer | 1 |
分页页数。 |
TotalCount | Integer | 12 |
查询总数。 |
Clusters | Array of ClusterInfo |
集群列表。 |
|
ClusterInfo | |||
Type | String | 标准型 |
集群类型。 |
Status | String | IDEL |
集群状态。 |
RunningTime | Integer | 2345 |
已运行时间(秒)。 |
MetaStoreType | String | local |
统一元数据类型。 |
MachineType | String | ECS |
集群的主机类型,目前默认为ECS。 |
OrderList | String | 0 |
订单列表。 |
CreateTime | Long | 1542784048000 |
创建时间。 |
ChargeType | String | PostPaid |
付费类型。 |
DepositType | String | HALF_MANAGED |
托管类型,标识集群是全托管还是半托管。枚举值:HALF_MANAGED、FULLY_MANAGED。 |
Period | Integer | 10 |
包年包月时间(可选包月数量有:1、2、3、4、5、6、7、8、9、12、24、36。) |
K8sClusterId | String | [] |
K8s集群ID。 |
ExpiredTime | Long | 1542784048000 |
包年包月集群超时时间。 |
HasUncompletedOrder | Boolean | false |
是否有未完成的订单。 |
Name | String | cluster_name |
集群名。 |
CreateResource | String | ECM_DDI |
自动附加到DDI集群的标签。 |
Id | String | C-010A704DA760**** |
集群ID。 |
Tags | Array of Tag |
标签。 |
|
Tag | |||
TagValue | String | [] |
标签值。 |
TagKey | String | [] |
标签键。 |
OrderTaskInfo | Object |
保留字段,订单任务信息。 |
|
TargetCount | Integer | 0 |
保留字段。 |
CurrentCount | Integer | 0 |
保留字段。 |
OrderIdList | String | 0 |
保留字段。 |
FailReason | Object |
创建失败原因。 |
|
ErrorMsg | String | The specified ImageId does not exist. |
错误信息。 |
RequestId | String | B8DC3A91-3953-4444-92BB-DBC29C47EC1A |
请求ID。 |
ErrorCode | String | InvalidImageId.NotFound |
错误码。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ListClusters
&RegionId=cn-hangzhou
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<TotalCount>12</TotalCount>
<RequestId>BF4FBAC6-B03E-4BFB-B6DB-EB53C34F2E22</RequestId>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<Clusters>
<ClusterInfo>
<Status>IDEL</Status>
<CreateResource>ECM_DDI</CreateResource>
<CreateTime>1542784048000</CreateTime>
<MachineType>ECS</MachineType>
<DepositType>HALF_MANAGED</DepositType>
<Period>10</Period>
<MetaStoreType>local</MetaStoreType>
<K8sClusterId/>
<Name>cluster_name</Name>
<Type>标准型</Type>
<ChargeType>PostPaid</ChargeType>
<ExpiredTime>1542784048000</ExpiredTime>
<Id>C-010A704DA760****</Id>
<OrderList>0</OrderList>
<HasUncompletedOrder>false</HasUncompletedOrder>
<RunningTime>2345</RunningTime>
</ClusterInfo>
<ClusterInfo>
<Tags>
<Tag>
<TagKey/>
<TagValue/>
</Tag>
</Tags>
</ClusterInfo>
<ClusterInfo>
<OrderTaskInfo>
<OrderIdList>0</OrderIdList>
<TargetCount>0</TargetCount>
<RequestId>B8DC3A91-3953-4444-92BB-DBC29C47EC1A</RequestId>
<ErrorMsg>The specified ImageId does not exist.</ErrorMsg>
<CurrentCount>0</CurrentCount>
<ErrorCode>InvalidImageId.NotFound</ErrorCode>
</OrderTaskInfo>
<FailReason>
<OrderIdList>0</OrderIdList>
<TargetCount>0</TargetCount>
<RequestId>B8DC3A91-3953-4444-92BB-DBC29C47EC1A</RequestId>
<ErrorMsg>The specified ImageId does not exist.</ErrorMsg>
<CurrentCount>0</CurrentCount>
<ErrorCode>InvalidImageId.NotFound</ErrorCode>
</FailReason>
</ClusterInfo>
</Clusters>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 12,
"RequestId" : "BF4FBAC6-B03E-4BFB-B6DB-EB53C34F2E22",
"PageSize" : 10,
"PageNumber" : 1,
"Clusters" : {
"ClusterInfo" : [ {
"Status" : "IDEL",
"CreateResource" : "ECM_DDI",
"CreateTime" : 1542784048000,
"MachineType" : "ECS",
"DepositType" : "HALF_MANAGED",
"Period" : 10,
"MetaStoreType" : "local",
"K8sClusterId" : "",
"Name" : "cluster_name",
"Type" : "标准型",
"ChargeType" : "PostPaid",
"ExpiredTime" : 1542784048000,
"Id" : "C-010A704DA760****",
"OrderList" : 0,
"HasUncompletedOrder" : false,
"RunningTime" : 2345
}, {
"Tags" : {
"Tag" : {
"TagKey" : "",
"TagValue" : ""
}
}
}, {
"OrderTaskInfo" : {
"OrderIdList" : 0,
"TargetCount" : 0,
"RequestId" : "B8DC3A91-3953-4444-92BB-DBC29C47EC1A",
"ErrorMsg" : "The specified ImageId does not exist.",
"CurrentCount" : 0,
"ErrorCode" : "InvalidImageId.NotFound"
},
"FailReason" : {
"OrderIdList" : 0,
"TargetCount" : 0,
"RequestId" : "B8DC3A91-3953-4444-92BB-DBC29C47EC1A",
"ErrorMsg" : "The specified ImageId does not exist.",
"CurrentCount" : 0,
"ErrorCode" : "InvalidImageId.NotFound"
}
} ]
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | EcmClusterId.NotFound | The cluster ID is invalid. | 指定集群Id不存在 |
400 | DB.Fail | A database access error occurred. | 数据库访问错误,请重试或者提工单 |
400 | RAM.Permission.NotAllow | You are not authorized to perform the operation. | 没有权限执行此操作,请联系主账号授权 |
400 | InternalError | The request processing has failed due to some unknown error. | 内部错误,请提工单 |
400 | Invalid.Cluster.Status | The cluster status %s is invalid. | 指定集群状态不合法 |
400 | Invalid.Cluster.Type | The cluster type %s is invalid. | 指定集群类型不合法 |
400 | User.OtherUserResource.NotAllow | You are not authorized to operate other users resource. | 不能操作其它用户的资源 |
403 | Params.Illegal | The format of the specified parameter is invalid. | 参数格式错误 |
访问错误中心查看更多错误码。
访问错误中心查看更多错误码。