Description
You can call this operation to query units of the specified OceanBase cluster.
Call description
Prerequisites
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
GET /api/v2/ob/clusters/{id}/units
Request parameters
Path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The ID of the cluster. |
| tenantId | Long | No | 1L | The ID of the tenant. |
| serverIp | String | No | xx | The IP address of the OBServer node. |
| serverPort | Integer | No | 2881 | The port number of the OBServer node. |
| obUnitIdList | Array | No | - | The IDs of the units. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | For more information, see Data structure of UnitInfo. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The 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 UnitInfo
| Parameter | Type | Description |
|---|---|---|
| obUnitId | Integer | The ID of the unit. |
| tenantId | Integer | The ID of the tenant. |
| tenantName | String | The name of the tenant. |
| obTenantId | Integer | The ID of the tenant in OceanBase Database. |
| svrIp | String | The IP address of the OBServer node. |
| svrPort | Integer | The port number of the OBServer node. |
| zone | String | The name of the zone. |
| unitConfig | UnitConfig | For more information, see Data structure of UnitConfig. |
| status | String | The status of the unit. |
| resourcePoolId | Long | The ID of the resource pool. |
| resourcePoolName | String | The name of the resource pool. |
| migrateType | String | The migration type of the unit. |
| migrateOppositeSvrIp | String | The IP address of the OBServer node at the opposite end of the migration link. |
| migrateOppositeSvrPort | Integer | The port number of the OBServer node at the opposite end of the migration link. |
| manualMigrate | Boolean | Indicates whether the migration is manually initiated. |
| logDiskUsedByte | Integer | The occupied size of the log disk, in bytes. This parameter is available only in OceanBase Database V4.0 and later. |
| dataDiskUsedByte | Integer | The occupied size of the data disk, in bytes. This parameter is available only in OceanBase Database V4.0 and later. |
Data structure of UnitConfig
| Parameter | Type | Description |
|---|---|---|
| maxCpuCoreCount | Number | The maximum number of CPU cores. |
| minCpuCoreCount | Number | The minimum number of CPU cores. |
| maxMemoryByte | Integer | The maximum memory size, in bytes. |
| minMemoryByte | Integer | The minimum memory size, in bytes. |
| logDiskSizeByte | Integer | The size of the log disk, in bytes. |
| maxIops | Integer | The maximum IOPS. |
| minIops | Integer | The minimum IOPS. |
| iopsWeight | Integer | The IOPS weight. |
| logDiskSize | Integer | The size of the log disk, in GiB. |
| minMemorySize | Integer | The minimum memory size, in GiB. |
| maxMemorySize | Integer | The maximum memory size, in GiB. |
Examples
Sample request
GET /api/v2/ob/clusters/{id}/units
Sample response
{
"data": {
"contents": [{
"obTenantId": 1,
"obUnitId": 1,
"resourcePoolId": 1,
"resourcePoolName": "sys_pool",
"status": "ACTIVE",
"svrIp": "xxx.xxx.xxx.xxx",
"svrPort": 2882,
"tenantId": 6000006,
"tenantName": "sys",
"unitConfig": {
"maxCpuCoreCount": 5.00,
"maxMemoryByte": 17179869184,
"maxMemorySize": 16,
"minCpuCoreCount": 2.50,
"minMemoryByte": 12884901888,
"minMemorySize": 12
},
"zone": "zone1"
}]
},
"duration": 68,
"server": "74f95ea2f4",
"status": 200,
"successful": true,
"timestamp": "2025-03-20T16:09:51.794+08:00",
"traceId": "5805be216d4884a8"
}