Description
You can call this operation to create a resource unit specification. Access permission: CLUSTER:*:READ. You must have at least read permission on any cluster to operate this interface.
Call description
Prerequisites
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
POST /api/v2/ob/unitSpecs
Request parameters
Body parameters
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| name | String | Yes | C1 | The name of the resource unit specification. It cannot be empty. It must start with a letter, be 2 to 32 characters in length, and can contain only letters, digits, and underscores. |
| group | String | No | Default | The name of the group. |
| maxCpuCoreCount | Double | Yes | 1.5 | The maximum number of CPU cores. It cannot be empty. Value range: 0.5 to 999. It must be an integer multiple of 0.5. |
| minCpuCoreCount | Double | No | 1.5 | The minimum number of CPU cores. Value range: 0.5 to 999. It must be an integer multiple of 0.5. If not specified, it is equal to maxCpuCoreCount. It cannot be greater than maxCpuCoreCount. |
| maxMemorySize | Long | Yes | 6 | The maximum size of memory, in GiB. It cannot be empty. Value range: 1 to 10000. |
| minMemorySize | Long | No | 6 | The minimum size of memory, in GiB. It cannot be greater than maxMemorySize. Value range: 1 to 10000. If not specified, it is equal to maxMemorySize. |
| logDiskSize | Long | No | 10 | The size of the log disk, in GiB. Value range: 2 to 10000. This parameter takes effect in OB 4.0 and later. |
| maxIops | Long | No | 10000 | The maximum IOPS. Value range: ≥ 1024. This parameter takes effect in OB 4.0 and later. |
| minIops | Long | No | 10000 | The minimum IOPS. Value range: ≥ 1024. This parameter takes effect in OB 4.0 and later. It cannot be greater than maxIops. If not specified, it is equal to maxIops. |
| iopsWeight | Integer | No | 1 | The IOPS weight. This parameter takes effect in OB 4.0 and later. If not specified and maxIops is not empty, the default value is 1. |
| dataDiskSize | Long | No | 10 | The size of the local cache disk, in GiB. This parameter is used only by SS. When you specify this parameter, the value must be a positive integer that is greater than or equal to ceil(minCpuCoreCount × 2) GiB. |
| dataDiskQuota | Long | No | 5 | The quota for data storage per unit, in GiB. When you specify this parameter, the value must be greater than or equal to 2. This parameter takes effect in SN clusters where OB is greater than or equal to 4.0. |
| maxNetBandwidth | Long | No | 100 | The network bandwidth, in Mbps. This parameter is used only by SS. When you specify this parameter, the value must be greater than 0. |
| storageArchitecture | String | No | SHARED_NOTHING | The applicable storage architecture. Value range: SHARED_NOTHING (distributed and centralized), SHARED_STORAGE (AI cluster). NULL indicates general (available for both SN and SS), and non-NULL indicates applicable only to this architecture. |
Response parameters
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The information about the unit specification. For more information, see the following table. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes the request. |
| duration | Integer | The amount of 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 resource unit specification. |
| name | String | The name of the resource unit specification. |
| type | String | The type of the resource unit specification. Valid values: |
| maxCpuCoreCount | Double | The maximum number of CPU cores. Value range: 0.5–999. Must be an integer multiple of 0.5. |
| minCpuCoreCount | Double | The minimum number of CPU cores. Value range: 0.5–999. Must be an integer multiple of 0.5. |
| maxMemorySize | Long | The maximum size of memory, in GiB. |
| minMemorySize | Long | The minimum size of memory, in GiB. |
| logDiskSize | Long | The size of the log disk, in GiB. |
| 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 GiB. This parameter is used only in SS. |
| dataDiskQuota | Long | The data storage quota per unit, in GiB. 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 in SS. The value must be greater than 0. |
| storageArchitecture | String | The applicable storage architecture. Valid values: SHARED_NOTHING (distributed and centralized), SHARED_STORAGE (AI cluster). 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 object containing the limitation description is returned. |
Examples
Sample request
POST /api/v2/ob/unitSpecs
{
"name": "C1",
"maxCpuCoreCount": 1.5,
"maxMemorySize": 6
}
Sample response
{
"data": {
"id": 5,
"name": "S1",
"type": "SYSTEM",
"maxCpuCoreCount": 1.5,
"minCpuCoreCount": 1.5,
"maxMemorySize": 6,
"minMemorySize": 6,
"notRecommended": false
},
"duration": 284,
"server": "xxx.xxx.xxx.xxx",
"status": 200,
"successful": true,
"timestamp": "2022-08-08T16:45:18.674+08:00",
"traceId": "xxx"
}