Query details about a tenant

2023-08-15 02:30:55  Updated

Description

You can call this operation to query details about a tenant.

Call description

Prerequisite

You have the Read-only permission on the cluster to which the tenant belongs.

Request path

GET /api/v2/ob/cluster/{clusterId}/tenants/{tenantId}

Path parameters

Parameter Type Required Example value Description
clusterld Long Yes 1 The ID of the cluster to which the tenant belongs.
tenantId Long Yes 5 The ID of the tenant.

Response parameters

Basic data structure

Parameter Type Description
data Object The details about the tenant.
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 server that responded to the request.

Data structure of the tenant details

Parameter Type Description
id Long The ID of the tenant.
name String The name of the tenant.
clusterName String The name of the cluster to which the tenant belongs.
clusterId Long The ID of the cluster to which the tenant belongs. This ID is generated by the OCP system.
obClusterId Long The ID of the cluster to which the tenant belongs. This ID is generated by the OceanBase Database system.
clusterType String The type of the cluster to which the tenant belongs. Valid values: * PRIMARY * STANDBY
mode String The mode of the tenant. Valid values: * ORACLE * MYSQL
createTime Datetime The time when the tenant was created.
primaryZone String The zone priorities of the tenant.
zoneList String The zone list of the tenant.
locality String The replica distribution of the tenant.
status String The status of the tenant. Valid values: * NORMAL * CREATING * MODIFYING * DELETING
locked Boolean Indicates whether the tenant was locked.
readonly Boolean Indicates whether the tenant was read-only.
obVersion String The OceanBase Database version of the cluster to which the tenant belongs.
description String The description of the tenant.
charset String The character set.
collation String The sorting rule.
zones Array The zones of the tenant.
whitelist String The whitelist of the tenant.

Data structure of zone information

Parameter Type Description
name String The name of the zone.
replicaType String The type of the replica.
resourcePool Object The data structure of the resource pool information.
units Array The list of units.

Data structure of the resource pool information

Parameter Type Description
id String The ID of the resource pool.
name String The name of the resource pool.
unitCount Integer The number of units.
unitConfig Object The data structure of unit configurations.

Data structure of unit configurations

Parameter Type Description
maxCpuCoreCount Double The maximum number of CPUs in the unit.
minCpuCoreCount Double The minimum number of CPUs in the unit.
maxMemorySize Integer The maximum memory size of the unit, in GB.
minMemorySize Integer The minimum memory size of the unit, in GB.

Data structure of unit information

Parameter Type Description
id Integer The ID of the unit.
resourcePoolId Integer The ID of the resource pool to which the unit belongs.
serverId Integer The ID of the OBServer to which the unit belongs.
serverIp String The IP address of the OBServer to which the unit belongs.
serverPort Integer The port number of the OBServer to which the unit belongs.
zoneName String The name of the zone.
status String The status of the unit.

Examples

Sample request

GET /api/v2/ob/clusters/8/tenants/9

Sample response

{
  "data": {
    "charset": "utf8mb4",
    "clusterId": 12000001,
    "clusterName": "protoss",
    "clusterStatus": "RUNNING",
    "clusterType": "PRIMARY",
    "collation": "utf8mb4_general_ci",
    "createTime": "2021-09-02T16:39:57+08:00",
    "id": 14000001,
    "locality": "FULL{1}@zone1",
    "locked": false,
    "mode": "MYSQL",
    "name": "sys",
    "obClusterId": 22,
    "obTenantId": 1,
    "obVersion": "3.1.0",
    "primaryZone": "zone1",
    "readonly": false,
    "sqlAuditEnabled": true,
    "status": "NORMAL",
    "whitelist": "%",
    "zoneList": "zone1",
    "zones": [
      {
        "name": "zone1",
        "replicaType": "FULL",
        "resourcePool": {
          "id": 1,
          "name": "sys_pool",
          "unitConfig": {
            "maxCpuCoreCount": 5.00,
            "maxMemorySize": 9,
            "minCpuCoreCount": 2.50,
            "minMemorySize": 8
          },
          "unitCount": 1
        },
        "units": [
          {
            "id": 1,
            "resourcePoolId": 1,
            "serverId": 12000001,
            "serverIp": "192.168.0.1",
            "serverPort": 2882,
            "status": "ACTIVE",
            "zoneName": "zone1"
          }
        ]
      }
    ]
  },
  "duration": 476,
  "server": "192.168.0.2",
  "status": 200,
  "successful": true,
  "timestamp": "2021-09-06T00:47:21.093+08:00",
  "traceId": "0b10e088732d432e"
}

Contact Us