Description
You can call this operation to create a zone for an OceanBase cluster.
Call description
Prerequisites
You have the permissions to manage the OceanBase cluster.
For more information about the permissions, see Roles overview and Users Overview.
You have passed the authentication for the 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 OceanBase 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. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous task. For more information, see Task information. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An 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"
}