Description
You can call this operation to query servers in a zone of an OceanBase cluster.
Call description
Prerequisites
You have the Read-only permission on the OceanBase cluster.
For more information about the permissions, see Roles overview and Users Overview.
You have passed the authentication for the OCP application service.
Request path
GET /api/v2/clusters/{clusterId}/zones/{zoneName}/servers
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| clusterId | Integer | Yes | 1 | The ID of the cluster. |
| zoneName | String | Yes | zone1 | The name of the zone. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | The array of the server information. For more information about the data structure, see the following table. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of the server information
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The ID of the server. |
| ip | String | The IP address of the server. |
| port | Integer | The RPC port number of the server. |
| sqlPort | Integer | The SQL port number of the server. |
| version | String | The OceanBase Database version of the server. |
| withRootServer | Boolean | Indicates whether the Root Service was enabled. |
| status | String | The status of the server. Valid values: CREATING RUNNING STOPPING STOPPED STARTING RESTARTING DELETING UNAVAILABLE OPERATING: The server is being maintained. DELETED |
| updateTime | Datetime | The last update time of the server. |
| clusterId | Integer | The ID of the cluster to which the server belongs. |
| zoneName | String | The name of the zone to which the server belongs. |
| regionName | String | The name of the region to which the server belongs. |
| idcName | String | The name of the IDC to which the server belongs. |
| hostId | Integer | The host ID of the server. |
| hostTypeName | String | The host type of the server. |
| startTime | Datetime | The start time of the server. |
| stopTime | Datetime | The stop time of the server. |
| availableOperations | StringArray | The available operations of the server. |
Examples
Sample request
Query all servers that belong to zone1 in the cluster whose ID is 1.
GET /api/v2/ob/clusters/1/zones/zone1/servers
Sample response
{
"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"
}
]
}
}