Description
You can call this operation to query units of a tenant.
Call description
Prerequisite
You have the Read-only permission on the cluster to which the tenant belongs.
Request path
GET /api/v2/ob/cluster/{clusterId}/tenants/{tenantId}/units
Path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| clusterld | Long | Yes | 1 | The ID of the cluster to which the tenant belongs. |
| tenantId | Long | Yes | 5 | The ID of the tenant. |
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| zoneName | String | No | zone1 | The name of the zone. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested service data. |
| ├─ contents | Array | The unit data. For more information about the data structure, see the following table. |
| ├─ page | Object | The page information. |
| ├─ totalElements | Integer | The total number of entries. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The page number of the returned page. |
| ├─ size | Integer | The number of entries returned per page. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the server that responded to the request. |
Data structure of the unit information
| 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 to which the unit belongs. |
| serverIp | String | The IP address of the OBServer to which the unit belongs. |
| serverPort | Integer | The port number of the OBServer to which the unit belongs. |
| zoneName | String | The name of the zone. |
| status | String | The status of the unit. |
Examples
Sample request
Query all tenants in the cluster whose ID is 8.
GET /api/v2/ob/clusters/8/tenants/9/units
Sample response
{
"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"
}