This topic describes how to use the API to retrieve all resource specifications.
Request
Request syntax
GET /api/v1/units/config
Request parameters
None.
Request header
| Parameter | Required | Description |
|---|---|---|
| X-Auth-Token | Yes | The authentication token. |
Request example
GET 10.10.10.1:2886/api/v1/units/config
Response
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Specifies whether the request is successful. |
| timestamp | time.Time | The timestamp when the server completed the request. |
| duration | int | The time (in milliseconds) taken by the server to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| data | []DbaObUnitConfig | The resource specifications. For more information about the data structure of this parameter, see Data structure of DbaObUnitConfig. |
| error | ApiError | The error information generated during the request, which contains the following fields:
|
Data structure of DbaObUnitConfig
| Parameter | Type | Description |
|---|---|---|
| unit_config_id | int | The resource specification ID. |
| name | string | The name of the resource specification. |
| max_cpu | float64 | The upper limit of the CPU specification. |
| min_cpu | float64 | The lower limit of the CPU specification. |
| memory_size | int | The memory specification. |
| log_disk_size | int | The size of the log disk space. |
| max_iops | uint | The upper limit of IOPS. |
| min_iops | uint | The lower limit of IOPS. |
| create_time | time.Time | The creation time of the resource specification. |
| modify_time | time.Time | The modification time of the resource specification. |
Example
Request example
GET 10.10.10.1:2886/api/v1/units/config
Response example
{
"successful": true,
"timestamp": "2020-07-29T09:29:01Z",
"duration": 10,
"status": 200,
"traceId": "81c7ff9b-ab78-4b42-b15f-c467e7ff2874",
"data": [
{
"unit_config_id": 1,
"name": "unit_config_1",
"max_cpu": 100.0,
"min_cpu": 10.0,
"memory_size": 1024,
"log_disk_size": 1024,
"max_iops": 10000,
"min_iops": 1000,
"create_time": "2020-07-29T09:29:01Z",
"modify_time": "2020-07-29T09:29:01Z"
}
],
"error": {}
}
References
You can also call the API by using the SDK.
For more information about how to call the API by using obshell-sdk-python, see Get all resource specifications.
For more information about how to call the API by using obshell-sdk-go, see Get all resource specifications.