Description
You can call this operation to obtain a list of resource unit specifications.
Call description
Prerequisites
You have passed the authentication for the OCP application service.
Request path
GET /api/v2/ob/unitSpecs
Request parameters
Query:
| name | String | No | S1 | The name of the unit specification. |
| name | String | No | S1 | The name of the resource unit specification. |
| type | String | No | SYSTEM | The type of the resource unit specification. Valid values:SYSTEM: a system default type.CUSTOM: a custom type. |
| clusterId | Long | No | 1 | The ID of the cluster. |
| storageArchitecture | String | No | SHARED_NOTHING | The applicable storage architecture. Valid values: SHARED_NOTHING (distributed and centralized), SHARED_STORAGE (AI clusters). NULL indicates general (usable for SN and SS), and non-NULL indicates applicable only to this architecture. |
| page | Integer | No | 1 | The page number. Default value: 1. |
| size | Integer | No | 10 | The number of items per page. Items are returned by default in the maximum pagination size. Default upper limit is 5,000, which can be adjusted by system configuration. |
| sort | String | No | id,asc | The field to sort by. Items are sorted in ascending order by id by default. |
Basic data structure
| Parameter | Type | Description |
| data | Object | The information about the unit specification. For more information, see the following table. |
| data | Object | The list of unit specifications. For more information, see UnitSpec data structure. |
| timestamp | Datetime | The timestamp when the server completes the request. |
| duration | Integer | The 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 UnitSpec
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The ID of the unit specification. |
| name | String | The name of the unit specification. |
| type | String | The type of the unit specification. Valid values:SYSTEM: a system default type.CUSTOM: a custom type. |
| maxCpuCoreCount | Double | The maximum number of CPU cores. |
| minCpuCoreCount | Double | The minimum number of CPU cores. |
| maxMemorySize | Long | The maximum memory size of the unit, in GB. |
| minMemorySize | Long | The minimum memory size of the unit, in GB. |
| logDiskSize | Long | The size of the log disk, in GB. |
| maxIops | Long | The maximum IOPS. Value range: ≥ 1024. |
| minIops | Long | The minimum IOPS. Value range: ≥ 1024. |
| iopsWeight | Integer | The IOPS weight. |
| notRecommended | Boolean | When an OB version is specified and the OB cluster of that version is not suitable for using this unit specification, the value is true, indicating that its use is not recommended. |
| dataDiskSize | Long | The size of the local cache disk, in GB. This parameter is used only by SS. |
| dataDiskQuota | Long | The data storage quota per unit, in GB. This parameter takes effect only in SN clusters where OB is greater than or equal to 4.0. |
| maxNetBandwidth | Long | The network bandwidth, in Mbps. This parameter is used only by SS. |
| storageArchitecture | String | The applicable storage architecture. Valid values: SHARED_NOTHING (distributed and centralized), SHARED_STORAGE (AI clusters). NULL indicates general (available for both SN and SS), and non-NULL indicates applicable only to that architecture. |
| unitSpecLimit | Object | When an OB version is specified and the OB cluster of that version is not suitable for using this unit specification, this parameter is returned, and its value is an object containing the limitation description. |
Examples
Sample request
GET /api/v2/ob/unitSpecs
Sample response
{
"data": {
"contents": [
{
"id": 5,
"maxCpuCoreCount": 1.5,
"maxMemorySize": 6,
"minCpuCoreCount": 1.5,
"minMemorySize": 6,
"name": "S1",
"type": "SYSTEM",
"logDiskSize": 10,
"maxIops": 10000,
"minIops": 10000,
"iopsWeight": 1,
"notRecommended": false,
"storageArchitecture": null
},
{
"id": 1000001,
"maxCpuCoreCount": 2,
"maxMemorySize": 7,
"minCpuCoreCount": 2,
"minMemorySize": 7,
"name": "C1",
"type": "CUSTOM",
"logDiskSize": 12,
"maxIops": 20000,
"minIops": 20000,
"iopsWeight": 2,
"notRecommended": false,
"storageArchitecture": "SHARED_NOTHING"
}
],
"page": {
"number": 1,
"size": 10,
"totalElements": 2,
"totalPages": 1
}
},
"duration": 284,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2022-08-08T16:45:18.674+08:00",
"traceId": "7b2030b217b84eac"
}