Description
You can call this operation to upgrade an OceanBase cluster.
Call description
Prerequisites
You have the permission to upgrade 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}/upgrade
Path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Long | Yes | 1 | The ID of the OceanBase cluster to be upgraded. |
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| rpmFileName | String | Yes | - | This parameter is deprecated and will be removed from later versions. |
| upgradeMode | Enum | Yes | ROLLING | The upgrade mode. Valid values: |
| destVersion | String | Yes | 2.2.77-202204041221 | The target version. |
| operatingSystem | String | Yes | el7 | The operating system. |
| freezeServer | Boolean | No | false | Specifies whether to perform a minor compaction before stopping the server. |
| zoneOrder | Array | No | [zone1,zone2] | The upgrade sequence of zones when upgrading the primary cluster. |
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/22/upgrade
Body:
{
"upgradeMode": "ROLLING",
"destVersion": "4.3.5-2024024041221",
"operatingSystem": "el7",
"freezeServer": false,
"zoneOrder": [
"[zone1,zone2]"
]
}
Sample response
{
"data": {
"cluster": {
"id": 22,
"name": "terran",
"obClusterId": 1
},
"context": "Context(parallelIdx=-1, stringMap={cluster_version=2.2.73-20201211175814, cluster_name=terran, cluster_id=22, target_cluster_status=RUNNING, primary_cluster_id=22}, listMap={binary_upgrade_versions=[2.2.75-20210108170301], cluster_ids=[22], upgrade_versions=[2.2.74, 2.2.75-20210108170301]})",
"creator": {
"id": 100,
"name": "admin"
},
"id": 108368,
"name": "Submit upgrade OB cluster dag",
"startTime": "2021-03-02T12:04:48.487+08:00",
"status": "RUNNING",
"tasks": [
{
"description": "Update OB cluster status",
"downstreams": [
],
"id": 130229,
"name": "Update OB cluster status",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
130230
]
},
{
"description": "Wait dag success",
"downstreams": [
130229
],
"id": 130230,
"name": "Wait dag success",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
130233
]
},
{
"description": "Start node",
"downstreams": [
130232
],
"id": 130231,
"name": "Start node",
"operation": "EXECUTE",
"status": "RUNNING",
"upstreams": [
]
},
{
"description": "Prepare upgrade cluster",
"downstreams": [
130233
],
"id": 130232,
"name": "Prepare upgrade cluster",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
130231
]
},
{
"description": "Submit cluster upgrade task",
"downstreams": [
130230
],
"id": 130233,
"name": "Submit cluster upgrade task",
"operation": "EXECUTE",
"status": "PENDING",
"upstreams": [
130232
]
}
]
},
"duration": 176,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-03-02T12:04:48.524+08:00",
"traceId": "b2a365d384444f76"
}