首批通过分布式安全可靠测评,为关键业务系统打造
查询 Zone 的服务器列表
更新时间:2023-08-16 15:51:32
功能说明
该接口用于查询目标 OceanBase 集群中指定 Zone 下的服务器信息。
调用说明
接口约束
调用者需至少具备对目标 OceanBase 集群的只读权限。
关于调用者的权限,详情可参见 安全概述。
调用者需要通过 OCP 应用服务鉴权。
请求路径
GET /api/v2/clusters/{clusterId}/zones/{zoneName}/servers
请求参数
| 参数 | 类型 | 必选 | 示例值 | 描述 |
|---|---|---|---|---|
| clusterId | Integer | 是 | 1 | 目标集群的 ID。 |
| zoneName | String | 是 | zone1 | Zone 的名称。 |
基础数据结构
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Object | 请求的数据。 |
| ├─ contents | Array | 服务器信息的数组,数据结构见下表。 |
| successful | Boolean | 请求是否成功。 |
| timestamp | Datetime | 服务端完成请求的时间戳。 |
| duration | Integer | 服务端处理请求的时间(毫秒)。 |
| status | Integer | 符合 HTTP Status 规范的编码。 |
| traceId | String | 请求的 Trace Id,用于排查问题。 |
| server | String | 响应请求的应用服务的地址。 |
服务器信息的数据结构
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Integer | 服务器的 ID。 |
| ip | String | 服务器的 IP 地址。 |
| port | Integer | 服务器的 RPC 端口。 |
| sqlPort | Integer | 服务器的 SQL 端口。 |
| version | String | 服务器的 OB 版本。 |
| withRootServer | Boolean | 是否带 Root Service。 |
| status | String | 服务器的状态。取值范围: * CREATING:创建中 * RUNNING:运行中 * STOPPING:停止中 * STOPPED:已停止 * STARTING:启动中 * RESTARTING:重启中 * DELETING:删除中 * UNAVAILABLE:不可用 * OPERATING:运维中 * DELETED:已删除 |
| updateTime | Datetime | 服务器最后更新时间。 |
| clusterId | Integer | 服务器所属集群的 Id。 |
| zoneName | String | 服务器所属 Zone 的名称。 |
| regionName | String | 服务器所属区域的名称。 |
| idcName | String | 服务器所属机房的名称。 |
| hostId | Integer | 服务器的主机 Id。 |
| hostTypeName | String | 服务器的主机的类型。 |
| startTime | Datetime | 服务器的启动时间。 |
| stopTime | Datetime | 服务器的停止时间。 |
| availableOperations | StringArray | 服务器的可用操作列表。 |
示例
请求示例
请求集群 ID 为 1,Zone 名称为 zone1 下的所有服务器的列表。
GET /api/v2/ob/clusters/1/zones/zone1/servers
返回示例
{
"duration": 46,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2020-12-02T20:23:00.831+08:00",
"traceId": "48920c5a760249f5",
"data": {
"contents": [
{
"clusterId": 1000002,
"hostId": 1000001,
"id": 1000001,
"innerStatus": "ACTIVE",
"ip": "xxx.xxx.xxx.xxx",
"port": 2882,
"sqlPort": 2881,
"startTime": "2020-11-29T22:30:42+08:00",
"status": "RUNNING",
"stopTime": "1970-01-01T08:00:00+08:00",
"updateTime": "2020-11-30T14:42:23+08:00",
"version": "2.2.73_20201117154111-b6aae37ffa2e72f45705508d7e5e93f9c48263b0(Nov 17 2020 16:09:04)",
"withRootserver": true,
"zoneName": "zone1"
}
]
}
}