Purpose
You can call this operation to obtain the resource statistics of 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}/stats
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 OceanBase cluster. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | For more information, see Data structure of ClusterResourceStats. |
| 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 ClusterResourceStats
| Parameter | Type | Description |
|---|---|---|
| clusterId | Integer | The ID of the cluster. |
| clusterName | String | The name of the cluster. |
| obClusterId | Integer | The ID of the OceanBase cluster. |
| cpuTotal | Number | The total number of CPU cores. |
| cpuAssigned | Number | The allocated number of CPU cores. |
| memoryTotalByte | Integer | The total memory size, in bytes. |
| memoryAssignedByte | Integer | The allocated memory size, in bytes. |
| logDiskTotalByte | Integer | The total size of the log disk, in bytes. |
| logDiskAssignedByte | Integer | The allocated space of the log disk, in bytes. |
| logDiskUsedByte | Integer | The occupied space of the log disk, in bytes. |
| dataDiskTotalByte | Integer | The total size of the data disk, in bytes. |
| dataDiskUsedByte | Integer | The occupied space of the data disk, in bytes. |
Examples
Sample request
GET /api/v2/ob/clusters/{id}/stats
Sample response
{
"data": {
"clusterId": 105,
"clusterName": "test4210",
"obClusterId": 122,
"cpuTotal": 8.00,
"cpuAssigned": 3.50,
"memoryAssignedByte": 11811160064,
"memoryTotalByte": 46385646796,
"logDiskTotalByte": 144955146240,
"logDiskAssignedByte": 27917287424,
"logDiskUsedByte": 2415919104,
"dataDiskTotalByte": 837518622720,
"dataDiskUsedByte": 199229440
},
"duration": 284,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2024-04-10T10:39:43.33+08:00",
"traceId": "xyz"
}