Purpose
You can call this operation to obtain the resource statistics of all OBServer nodes in a 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}/serverStats
Request parameters
The following table describes parameters in the request path.
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | - | The ID of the OceanBase cluster. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | For more information, see Data structure of ServerResourceStats. |
| 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 ServerResourceStats
| Parameter | Type | Description |
|---|---|---|
| ip | String | The IP address of the OBServer node. |
| port | Integer | The port number of the OBServer node. |
| zone | String | The name of the zone. |
| 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}/serverStats
Sample response
{
"data": {
"contents": [
{
"ip": "xxx.xxx.xxx.xxx",
"port": 2882,
"zone": "zone1",
"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"
}