Purpose
You can call this operation to query the list of resource units in an OceanBase cluster.
Call description
Limitations
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
GET /api/v2/ob/clusters/{id}/units
Request parameters
The following table describes parameters in the request path.
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The ID of the cluster. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | For more information, see Data structure of UnitInfo. |
| successful | Boolean | Indicates whether the request is 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 responds 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 OceanBase Database tenant. |
| 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 | The unit specification. For more information, see the following table. |
| status | String | The status of the unit. |
| 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 space of the log disk, in bytes. This parameter is available only in OceanBase Database V4.0 and later. |
| dataDiskUsedByte | Integer | The occupied space 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 input/output operations per second (IOPS) of the unit. |
| minIops | Integer | The minimum IOPS of the unit. |
| iopsWeight | Integer | The IOPS weight. |
| logDiskSize | Integer | The size of the log disk, in GB. |
| minMemorySize | Integer | The minimum memory size, in GB. |
| maxMemorySize | Integer | The maximum memory size, in GB. |
Examples
Sample request
GET /api/v2/ob/clusters/{id}/units
Sample response
{
"data": {
"contents": [
{
"dataDiskUsedByte": 79691776,
"logDiskUsedByte": 662790112,
"obTenantId": 1,
"obUnitId": 1,
"status": "ACTIVE",
"svrIp": "xxx.xxx.xxx.xxx",
"svrPort": 2882,
"tenantId": 5883,
"tenantName": "sys",
"unitConfig": {
"iopsWeight": 2,
"logDiskSize": 8,
"logDiskSizeByte": 8589934592,
"maxCpuCoreCount": 2.00,
"maxIops": 0,
"maxMemoryByte": 5368709120,
"maxMemorySize": 5,
"minCpuCoreCount": 2.00,
"minIops": 0,
"minMemoryByte": 5368709120,
"minMemorySize": 5
},
"zone": "zone1"
}
]
},
"duration": 284,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2024-04-10T10:39:43.33+08:00",
"traceId": "xyz"
}