Description
You can call this operation to create a zone for an OceanBase cluster.
Call description
Prerequisites
You have the permissions to manage the specified OceanBase cluster.
For more information about the permissions, see Overview.
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
POST /api/v2/ob/clusters/{id}/zones
Path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The ID of the target cluster. |
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| name | String | Yes | foo | The name of the zone. |
| idcName | String | Yes | idc1 | The name of the IDC. |
| servers | Array | Yes | [1,2] | The list of host IDs. |
| architecture | String | No | x86_64 | The CPU architecture. |
| packageOperatingSystem | String | No | xx | The operating system of the software package. If you do not specify this parameter, cluster settings are used by default. |
| startupParameters | Object | No | - | The startup parameters. |
| ├─name | String | No | - | The name of the parameter. |
| ├─value | String | No | - | The value of the parameter. |
| addReplicaParams | Array | No | - | The parameters of tenant replicas. |
| ├─zoneName | String | Yes | zone1 | The name of the zone. |
| ├─replicaType | Enum | Yes | FULL | The type of the replica. |
| ├─resourcePool | Object | Yes | - | The resource pool information. |
| ├─unitSpecName | String | Yes | S1 | The name of the unit config. |
| ├─unitCount | Long | Yes | 1L | The number of units. |
| ├─tenantId | Long | Yes | 1L | The ID of the tenant. |
| ├─tenantName | String | No | tenant1 | The name of the tenant. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task return structure. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed 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 responded to the request. |
Examples
Sample request
POST /api/v2/ob/clusters/1/zones
Body:
{
"name": "zone2",
"idcName": "hz2",
"servers": [
1
]
}
Sample response
{
"data": {
"cluster": {
"id": 21,
"name": "ob_upgrade",
"obClusterId": 22
},
"context": "Context(parallelIdx=-1, stringMap={cluster_name=ob_upgrade, cluster_id=21, service_type=OB_CLUSTER, rpm_name=oceanbase-2.2.75-20210108170301.el7.x86_64.rpm, service_name=ob_upgrade:22, service_version=2.2.75, host.1.zone=zone2, ob_cluster_id=22, zone2.idc=hz2, zone2.region=hangzhou}, listMap={root_server_ips=[xxx.xxx.xxx.xxx], server_ids=[6], host_ids=[1], zone_names=[zone2]})",
"creator": {
"id": 100,
"name": "admin"
},
"id": 107618,
"name": "Add OB Zone",
"startTime": "2021-03-02T10:57:45.471+08:00",
"status": "RUNNING",
"tasks": [
{
"description": "Pre check for install OB",
"downstreams": [
129213
],
"id": 129202,
"name": "Pre check for install OB",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129220
]
},
{
"description": "Start Zone",
"downstreams": [
129215
],
"id": 129203,
"name": "Start Zone",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129210
]
},
{
"description": "Add Zone",
"downstreams": [
129210
],
"id": 129204,
"name": "Add Zone",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129213
]
},
{
"description": "Wait node",
"downstreams": [
129211
],
"id": 129205,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129216
]
},
{
"description": "Wait observer active",
"downstreams": [
129221
],
"id": 129206,
"name": "Wait observer active",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129211
]
},
{
"description": "Make dir for ob",
"downstreams": [
129208
],
"id": 129207,
"name": "Make dir for ob",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129212
]
},
{
"description": "Wait node",
"downstreams": [
129216
],
"id": 129208,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129207
]
},
{
"description": "Prepare add Zone",
"downstreams": [
129220
],
"id": 129209,
"name": "Prepare add Zone",
"operation": "EXECUTE",
"status": "RUNNING",
"upstreams": [
]
},
{
"description": "Wait node",
"downstreams": [
129203
],
"id": 129210,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129204
]
},
{
"description": "Add observer",
"downstreams": [
129206
],
"id": 129211,
"name": "Add observer",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129205
]
},
{
"description": "Wait node",
"downstreams": [
129207
],
"id": 129212,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129219
]
},
{
"description": "Wait node",
"downstreams": [
129204
],
"id": 129213,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129202
]
},
{
"description": "Wait observer active",
"downstreams": [
129218
],
"id": 129214,
"name": "Wait observer active",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129221
]
},
{
"description": "Set Zone idc info",
"downstreams": [
129219
],
"id": 129215,
"name": "Set Zone idc info",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129203
]
},
{
"description": "Start observer process with param",
"downstreams": [
129205
],
"id": 129216,
"name": "Start observer process with param",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129208
]
},
{
"description": "Wait node",
"downstreams": [
129226
],
"id": 129217,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129218
]
},
{
"description": "Start ocp agent service",
"downstreams": [
129217
],
"id": 129218,
"name": "Start ocp agent service",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129214
]
},
{
"description": "Install rpm",
"downstreams": [
129212
],
"id": 129219,
"name": "Install rpm",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129215
]
},
{
"description": "Reserve host",
"downstreams": [
129202
],
"id": 129220,
"name": "Reserve host",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129209
]
},
{
"description": "Restart observer process",
"downstreams": [
129214
],
"id": 129221,
"name": "Restart observer process",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129206
]
},
{
"description": "Wait node",
"downstreams": [
129223
],
"id": 129222,
"name": "Wait node",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129226
]
},
{
"description": "Update Zone status",
"downstreams": [
129224
],
"id": 129223,
"name": "Update Zone status",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129222
]
},
{
"description": "Sync cluster info",
"downstreams": [
129225
],
"id": 129224,
"name": "Sync cluster info",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129223
]
},
{
"description": "Update OB cluster status",
"downstreams": [
],
"id": 129225,
"name": "Update OB cluster status",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129224
]
},
{
"description": "Update observer status",
"downstreams": [
129222
],
"id": 129226,
"name": "Update observer status",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
129217
]
}
]
},
"duration": 217,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-03-02T10:57:45.572+08:00",
"traceId": "1d3f515c734942a3"
}