Create a resource unit specification

2025-03-26 07:47:21  Updated

Description

You can call this operation to create a resource unit specification.

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.
maxCpuCoreCount Number Yes 1.5 The number of CPU cores.
maxMemorySize Integer Yes 6 The size of memory, in GiB.

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 Integer
name String The name of the resource unit specification.
type String The type of the resource unit specification.
maxCpuCoreCount Number The maximum number of CPU cores.
minCpuCoreCount Number The minimum number of CPU cores.
maxMemorySize Integer The maximum size of memory, in GiB.
minMemorySize Integer The minimum size of memory, in GiB.

Examples

Sample request

POST /api/v2/ob/unitSpecs

{
  "name": "C1",
  "maxCpuCoreCount": 1.5,
  "maxMemorySize": 6
}

Sample response

{
  "data": {
    "id": 5,
    "maxCpuCoreCount": 1.5,
    "maxMemorySize": 6,
    "minCpuCoreCount": 1.5,
    "minMemorySize": 6,
    "name": "S1",
    "type": "SYSTEM"
  },
  "duration": 284,
  "server": "xxx.xxx.xxx.xxx",
  "status": 200,
  "successful": true,
  "timestamp": "2022-08-08T16:45:18.674+08:00",
  "traceId": "xxx"
}

Contact Us