This topic describes how to use the API to get information about all resource pools in a cluster.
Request parameters
The following table describes the request parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| password | string | No | The password for authentication. If you do not specify a password, no authentication is performed. |
| tenantId | int | Yes | The ID of the tenant. |
| zoneId | int | Yes | The ID of the zone. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request is successful. |
| timestamp | time.Time | The timestamp when the request is completed on the server. |
| duration | int | The time (in milliseconds) required to process the request on the server. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| data | []DbaObResourcePool | Information about the resource pools, which is described in Data structure of DbaObResourcePool. |
| error | ApiError | The error information generated by the request, which contains the following fields:
|
The data structure of DbaObResourcePool is described as follows:
| Parameter | Type | Description |
|---|---|---|
| id | int | The ID of the resource pool. |
| name | string | The name of the resource pool. |
| zone_list | string | The list of zones where the resource pool is located. |
| unit_num | int | The number of units in the resource pool. |
| unit_config_id | int | The ID of the resource specification used by the resource pool. |
| tenant_id | int | The ID of the tenant to which the resource pool belongs. |
| replica_type | string | The replica type on the resource pool. |
| create_time | time.Time | The creation time of the resource pool. |
| modify_time | time.Time | The modification time of the resource pool. |
Examples
Request example
GET 10.10.10.1:2886/api/v1/resource-pools
Response example
{
"successful": true,
"timestamp": "2024-10-14T15:49:07.354211125+08:00",
"duration": 4,
"status": 200,
"traceId": "b1cebf73debb0d68",
"data": {
"contents": [
{
"id": 1,
"name": "sys_pool",
"zone_list": "zone1;zone2;zone3",
"unit_num": 1,
"UnitCount": 0,
"unit_config_id": 1,
"tenant_id": 1,
"replica_type": "FULL",
"CreateTime": "2024-10-14T10:24:57.972281+08:00",
"ModifyTime": "2024-10-14T10:24:57.982035+08:00"
},
{
"id": 1002,
"name": "t1_zone2_1728872814",
"zone_list": "zone2",
"unit_num": 1,
"UnitCount": 0,
"unit_config_id": 1001,
"tenant_id": 1002,
"replica_type": "FULL",
"CreateTime": "2024-10-14T10:26:55.045879+08:00",
"ModifyTime": "2024-10-14T10:26:55.562399+08:00"
},
{
"id": 1003,
"name": "t1_zone3_1728872814",
"zone_list": "zone3",
"unit_num": 1,
"UnitCount": 0,
"unit_config_id": 1001,
"tenant_id": 1002,
"replica_type": "FULL",
"CreateTime": "2024-10-14T10:26:55.057419+08:00",
"ModifyTime": "2024-10-14T10:26:55.562399+08:00"
}
]
}
}
References
You can also call the API by using SDK methods in addition to the CLI.
For information about how to call the API by using the obshell-sdk-python, see Get information about all resource pools.
For information about how to call the API by using the obshell-sdk-go, see Get information about all resource pools.