This topic describes how to upgrade the version of OceanBase Database Proxy (ODP) using obshell.
Note
This API is supported starting with obshell V4.2.6.
API details
Constraints
- The obshell server will perform security verification on this API. For more information, see API hybrid encryption.
- The ODP service must be managed by the obshell instance.
Request path
POST /api/v1/obproxy/upgrade
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| version | string | Yes | 4.3.3.0 | The target version for the upgrade. |
| release | string | Yes | 5.el7 | The target release build number for the upgrade. |
| upgrade_dir | string | No | /data/upgrade | The directory used for the upgrade task. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request was successful. |
| timestamp | time.Time | The timestamp when the server completed the request. |
| duration | int | The time taken by the server to process the request, in milliseconds. |
| status | int | The HTTP status code following the HTTP status specification. |
| traceId | string | The Trace ID of the request. |
| data | DagDetailDTO | For more information, see the DagDetailDTO data structure section below. |
| error | ApiError | The error generated by the request, including the following information:
|
The data structure of DagDetailDTO is as follows:
| Parameter | Type | Description |
|---|---|---|
| id | string | The general ID of the DAG. |
| dag_id | int | The DAG ID, which is the primary key stored in OceanBase Database. |
| name | string | The name of the DAG. |
| stage | int | The current execution stage of the DAG. |
| max_stage | int | The total number of stages in the DAG execution process. |
| state | string | The execution status of the DAG. |
| operator | string | The type of DAG operation. |
| start_time | time.Time | The start time of DAG execution. |
| end_time | time.Time | The end time of DAG execution. |
| additional_data | map[string]any | Other data of the DAG. |
| nodes | []NodeDetailDTO | The information of all nodes in the DAG. For more information, see Get details about a node. |
Examples
Request example
POST 10.10.10.1:2886/api/v1/obproxy/upgrade
Here is an example: Initiate an upgrade request for ODP on the 10.10.10.1:2886 node to upgrade it to 4.3.3.0-5.el7.
{
"version": "4.3.3.0",
"release": "'5.el7'
}
Response example
{
"successful": true,
"timestamp": "2025-03-20T16:41:13.943708524+08:00",
"duration": 13,
"status": 200,
"traceId": "987a5b278dbcbf72",
"data": {
"id": "401949121070808811",
"dag_id": 11,
"name": "Upgrade obproxy",
"stage": 1,
"max_stage": 10,
"state": "READY",
"operator": "RUN",
"start_time": "2025-03-20T16:41:13.940921477+08:00",
"end_time": "2025-03-20T16:41:13.940921477+08:00",
"additional_data": null,
"nodes": null
}
}
References
In addition to using the CLI to call the API, you can also use the SDK. For more information about how to request API methods through obshell-sdk-python, see Upgrade ODP.