查询集群列表
更新时间:2024-11-20
查询集群列表
接口描述
本接口用于查询集群列表,只能查询属于自己账号的集群列表。
请求结构
Plain Text
1GET /v{version}/gaiadb/cluster HTTP/1.1
2HOST: gaiadb.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API 版本号 |
| marker | String | 否 | URL参数 | 批量获取列表的查询的起始位置,是一个由系统生成的字符串,第一次请求可以不设置,后续请求可以设置为上一次请求响应中的 marker 字段值 |
| maxKeys | Integer | 否 | URL参数 | 每页包含的最大数量,最大数量通常不超过100,缺省值为100 |
| clusterIpList | String | 否 | URL参数 | 过滤条件:内网IP,仅返回内网IP列表包含该IP的集群 |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| marker | String | 批量获取列表的查询的起始位置,是一个由系统生成的字符串 |
| maxKeys | Integer | 每页包含的最大数量,最大数量通常不超过100,缺省值为100 |
| isTruncated | boolean | true表示后面还有数据,false表示已经是最后一页 |
| nextMarker | String | 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现 |
| clusters | List<Cluster> | 由Cluster对象组成的数组 |
Cluster 对象
| 参数名称 | 类型 | 描述 |
|---|---|---|
| clusterId | String | 集群ID |
| clusterName | String | 集群名 |
| endpoint | Endpoint | 数据库连接信息 |
| allocatedCpuInCore | Int | CPU核数 |
| allocatedMemoryInMB | Int | 集群内存,单位MB |
| instanceStatus | String | 实例状态,参见集群状态表 |
| instanceCreateTime | Datetime | 实例创建时间,规范参考时间与日期 |
| instanceExpireTime | Datetime | 实例到期时间,规范参考时间与日期 |
| instanceAmount | Integer | 节点数 |
| proxyAmount | Integer | 代理节点数 |
| productType | String | 付费方式,取值:prepay(预付费)、postpay(后付费) |
| multiActiveGroupId | String | 集群所属热活集群组ID,若集群未在任何热活集群组中,则为空字符串 |
| multiActiveGroupRole | String | 集群在热活集群组中的角色,若集群未在任何热活集群组中,则为空字符串 |
| multiActiveGroupName | String | 群所属热活集群组名称,若集群未在任何热活集群组中,则为空字符串 |
| clusterEipList | List<String> | 公网IP列表 |
| clusterIpList | List<String> | 内网IP列表 |
| clusterDnsList | List<String> | 域名列表 |
Endpoint 对象
| 参数名称 | 类型 | 描述 |
|---|---|---|
| port | Integer | 数据库连接信息 |
| address | String | 域名 |
请求示例
Plain Text
1GET /v1/gaiadb/cluster?marker=r-IyWRtII7&maxKeys=1&clusterIpList=192.168.48.13 HTTP/1.1
2HOST: gaiadb.bj.baidubce.com
3Content-Type: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4{
5 "marker": "gaiadb08sk7o",
6 "maxKeys": 1,
7 "nextMarker": "gaiadb603pvc",
8 "isTruncated": true,
9 "clusters": [
10 {
11 "clusterId": "gaiadb08sk7o",
12 "clusterName": "zyh-param",
13 "endpoint": {
14 "port": 3306,
15 "address": "gaiadb08sk7o.gaiadb.bj.baidubce.com"
16 },
17 "allocatedCpuInCore": 2,
18 "allocatedMemoryInMB": 8192,
19 "instanceStatus": "available",
20 "instanceCreateTime": "2022-09-19T07:23:47Z",
21 "instanceExpireTime": null,
22 "instanceAmount": 2,
23 "proxyAmount": 2,
24 "productType": "postpay",
25 "multiActiveGroupId": "",
26 "multiActiveGroupRole": "",
27 "multiActiveGroupName": "",
28 "clusterIpList": ["192.168.48.13", "192.168.48.14"],
29 "clusterEipList": ["199.168.48.13", "199.168.48.14"],
30 "clusterDnsList": ["gaiadbxxx.gaiadb.bj.baidubce.com"]
31 }]
32 }
