Feature description
Queries the unit list of a tenant.
Call instructions
API constraints
The caller must have the read privilege on the specified cluster.
Request path
GET /api/v2/ob/cluster/{id}/tenants/{tenantId}/units
Request parameters
path:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| id | Long | Yes | 1000001 | The cluster ID of the target tenant in OCP. |
| tenantId | Long | Yes | 1000005 | The tenant ID of the target tenant in OCP. |
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| zoneName | String | No | zone1 | The name of the zone. |
Return result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The business data requested. |
| ├─ contents | Array | The data of the unit. See Unit data structure for more information. |
| ├─ page | Object | The pagination information. |
| ├─ totalElements | Integer | The total number of records. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The current page number. |
| ├─ size | Integer | The size of the current page. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes processing the request. |
| duration | Integer | The time taken by the server to process the request (in milliseconds). |
| status | Integer | The HTTP status code that conforms to the HTTP Status specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot problems. |
| server | String | The address of the server that responds to the request. |
Unit data structure
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 node to which the unit belongs. |
| serverIp | String | The IP address of the OBServer node to which the unit belongs. |
| serverPort | Integer | The port number of the OBServer node to which the unit belongs. |
| zoneName | String | The name of the zone. |
| status | String | The status of the unit. |
Example
Request example
Query all tenants under the cluster with ID 1000001.
GET /api/v2/ob/clusters/1000001/tenants/1000005/units
Response example
{
"data": {
"contents": [
{
"id": 1,
"resourcePoolId": 1,
"serverId": 12000001,
"serverIp": "xxx.xxx.xxx.xxx",
"serverPort": 2882,
"status": "ACTIVE",
"zoneName": "zone1"
}
]
},
"duration": 109,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-06T01:14:54.903+08:00",
"traceId": "8f0c78a65a4f49b0"
}
