Query zones of an OceanBase cluster

2023-08-22 02:46:05  Updated

Description

You can call this operation to query zones of an OceanBase cluster.

Call description

Prerequisites

  • You have the Read-only permission on the OceanBase cluster.

    For more information about the permissions, see Security overview.

  • You have passed the authentication for the OCP application service.

Request path

GET /api/v2/ob/clusters/{id}/zones

Path parameters

Parameter Type Required Example value Description
id Integer Yes 100 The ID of the OceanBase cluster in which zones need to be queried.

Response parameters

Parameter Type Description
data Object The requested data.
├─ contents Array The array of the zone information. For more information about the data structure, see the following table.
├─ page Object The page information.
├─ totalElements Integer The total number of entries.
├─ totalPage Integer The total number of pages.
├─ number Integer The page number of the returned page.
├─ size Integer The number of entries returned per page.
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 zone information

Parameter Type Description
name String The name of the zone.
idcName String The name of the IDC to which the zone belongs.
regionName String The region to which the zone belongs.
servers Array The list of servers.
clusterId Long The ID of the OceanBase cluster generated by the OCP system.
obClusterId Long The ID of the OceanBase cluster generated by the OceanBase Database system.
serverCount Integer The number of servers.
hostCount Integer The number of hosts

Data structure of the server information

Parameter Type Description
id String The ID of the OBServer.
ip String The IP address of the OBServer.
port Integer The port number of the OBServer.
sqlPort Integer The SQL port number.
version String The version information.
withRootserver Boolean Indicates whether the Root Service was enabled.
status String The status of the OBServer.
clusterId Long The ID of the OceanBase cluster to which the OBServer belongs. This ID is generated by the OCP system.
zoneName String The name of the zone to which the OBServer belongs.
regionName String The region to which the OBServer belongs.
idcName String The IDC to which the OBServer belongs.
hostId Long The host ID corresponding to the OBServer.
hostTypeName String The name of the host type.
startTime DateTime The start time of the OBServer.
stopTime DateTime The stop time of the OBServer.

Examples

Sample request

Query zones of a cluster

GET /api/v2/ob/clusters/100/zones

Sample response

{
    "data": {
        "contents": [
            {
                "clusterId": 12000001,
                "compactionStatus": "IDLE",
                "createTime": "2021-09-02T16:31:34+08:00",
                "hostCount": 1,
                "idcId": 3,
                "idcName": "hz3",
                "innerStatus": "ACTIVE",
                "name": "zone1",
                "obClusterId": 22,
                "regionName": "hangzhou",
                "rootServer": {
                    "address": "xxx.xxx.xxx.xxx:2882",
                    "role": "LEADER",
                    "sql_port": 2881
                },
                "serverCount": 1,
                "servers": [
                    {
                        "clusterId": 12000001,
                        "hostId": 4000003,
                        "hostTypeName": "forge",
                        "id": 12000001,
                        "idcName": "hz3",
                        "innerStatus": "ACTIVE",
                        "ip": "xxx.xxx.xxx.xxx",
                        "port": 2882,
                        "regionName": "hangzhou",
                        "sqlPort": 2881,
                        "startTime": "2021-09-02T08:39:29.295684Z",
                        "status": "RUNNING",
                        "stopTime": "1970-01-01T00:00:00Z",
                        "updateTime": "2021-09-02T16:39:58+08:00",
                        "version": "3.1.0_20210412122703-1c10f0b3ad39105cd5d12eb566ebe3a374ea38f5(Apr 12 2021 12:57:39)",
                        "withRootserver": true,
                        "zoneName": "zone1"
                    }
                ],
                "status": "RUNNING",
                "updateTime": "2021-09-03T02:01:31+08:00"
            }
        ]
    },
    "duration": 593,
    "server": "xxx.xxx.xxx.xxx",
    "status": 200,
    "successful": true,
    "timestamp": "2021-09-03T10:28:31.861+08:00",
    "traceId": "340849601d4d4ffe"
}

Contact Us