查询资源组列表
接口功能介绍
列举已经创建的所有的资源组信息。
URI
GET /v4/cwai/group/list
路径参数
无
Query参数
名称 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
regionID | 是 | String | 区域唯一ID | 81f7728662dd11ec810800155d307d5b | |
sortKey | 否 | String | 用于排序的key | azName | |
sortType | 否 | String | 排序顺序,默认为按照创建时间倒序排列 | descend | |
nameLike | 否 | String | 模糊匹配资源组名称关键字 | worker | |
groupIDLike | 否 | String | 模糊匹配资源组ID关键字 | asdfdd44 | |
pageNo | 否 | Integer | 页号 | 1 | |
pageSize | 否 | Integer | 每一页的大小 | 10 | |
regionID | 是 | String | 区域的唯一ID | xxx-xxx-yyyzzz |
请求参数
请求header参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
userID | 是 | String | 用户ID | 8a122a-xxx-f34d13e73 |
请求体body参数
无
响应参数
名称 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
statusCode | 是 | Integer | 请求成功(800)或者失败(900) | 800 | |
errorCode | 否 | String | 错误代码 | Cwai.Api.xxxx | |
message | 否 | String | 错误信息的英文描述 | Invalid Request | |
returnObj | 否 | Object | 返回的集群信息 | returnObj |
表returnObj
名称 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
totalCount | 是 | Integer | 符合条件的资源组总数 | 10 | |
totalPage | 是 | Integer | 总页数 | 1 | |
currentCount | 是 | Integer | 本次查询返回的资源组个数 | 10 | |
result | 是 | Array | 返回的资源组详情 | result |
表result
名称 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
resourceGroupName | 是 | String | 资源组名称 | cluster-demo | |
resourceGroupID | 是 | String | 资源组唯一ID | asdfdd44-3a45-11ee-b1cf-525400c96778 | |
regionName | 是 | String | 区域名称 | region01 | |
regionID | 是 | String | 区域唯一ID | 81f7728662dd11ec547210155d307d5b | |
azName | 是 | String | 可用区名称 | az1 | |
nodeNum | 是 | Integer | 资源组节点数量 | 10 | |
status | 是 | String | 资源组状态,取值:creating:资源组创建中running:资源组运行中failedCreate:资源组创建失败deleted:资源组已删除failedDelete:资源组删除失败 | running | |
createTime | 是 | Integer | 资源组创建时间,1970年到现在时刻的秒差数值 | 0 | |
comment | 是 | String | 资源组描述 | ||
nodes | 否 | Array of Objects | 资源组节点详情 | node | |
vpcID | 是 | String | 主网卡网络ID | vpc-lt85l2bp5e | |
nodeNum | 是 | Integer | 节点数量 | 1 | |
createTime | 是 | String | 创建时间 | 2023-10-23 15:16:38 | |
message | 是 | String | 备注 |
表node
名称 | 是否必填 | 类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
instanceName | 是 | String | 实例名称 | cwai-master | |
resourceID | 是 | String | 资源ID | f13e86bd53b4426594796987faaea01c | |
hostname | 是 | String | 主机名 | host-worker | |
imageUUID | 是 | String | 物理机操作系统镜像ID | im-xevpi6apqieg3bixmogofyref9qm | |
imageName | 是 | String | 物理机操作系统镜像名称 | CentOS |
请求示例
GET https://Cwai-global.ctapi.ctyun.cn/v4/cwai/group/list?regionID=81f7728662dd11ec810800155d307d5b
Content-Type:application/json
regionID:81f7728662dd11ec810800155d307d5b
请求头header
{"userID" : "8a122a-xxx-f34d13e73"}
请求体body
无
响应示例
HTTP/1.1 200 OK
Content-Type:application/json
{
"statusCode": 800,
"returnObj":{
"currentCount": 1,
"totalCount": 1,
"totalPage": 1,
"result": [
{
"resourceGroupName": "cluster-demo",
"resourceGroupID": "asdfdd44-3a45-11ee-b1cf-525400c96778",
"regionID": "81f7728662dd11ec810800155d307d5b",
"regionName": "region01",
"azName": "az1",
"nodeNum": 10,
"status": "running",
"createTime": 0,
"vpcID": "vpc-lt85l2bp5e",
"comment": "",
"nodes": [
{
"instanceName" : "worker",
"resourceID" : "f13e86bd53b4426594796987faaea01c",
"hostname" : "host-worker",
"imageUUID" : "im-xevpi6apqieg3bixmogofyref9qm",
"imageName" : "CentOS"
}
],
"nodeNum": 1,
"status": "running",
"createTime": "2023-10-23 15:16:38",
"message": ""
}
]
}}
错误参数返回示例
HTTP/1.1 200 OK
Content-Type:application/json
{
"statusCode": 900,
"errorCode": "Cwai.Api.BadRequest",
"message": "***"
}
内部服务错误返回示例
HTTP/1.1 200 OK
Content-Type:application/json
{
"statusCode": 900,
"errorCode": "Cwai.Api.InternalServerError",
"message": "***"
}
状态码
状态码 | 描述 |
---|---|
200 | 表示请求成功 |
错误码
错误码 | 描述 |
---|---|
Cwai.Api.BadRequest | 错误请求 |
Cwai.Api.NotFound | 资源不存在 |
Cwai.Api.StatusUnauthorized | 状态未授权 |
Cwai.Api.InternalServerError | 内部错误 |