This topic describes how to upload the installation package required for upgrading OceanBase Database Proxy (ODP) to the obshell metadata database using obshell.
Note
This API is supported starting with obshell V4.2.6.
API details
Constraints
- The obshell server performs 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/package
Request type
multipart/form-data
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| file | file | Yes | N/A | The RPM package to be uploaded. |
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 conforming to the HTTP Status specification. |
| traceId | string | The Trace ID of the request. |
| data | sqlite.UpgradePkgInfo | For more information, see the data structure of UpgradePkgInfo section below. |
| error | ApiError | The error generated by the request, which includes the following information:
|
The data structure of UpgradePkgInfo is as follows:
| Parameter | Type | Description |
|---|---|---|
| pkgId | int | The software package ID. |
| name | string | The name of the software package. |
| version | string | The version of the software package. |
| releaseDistribution | string | The build number of the software package's release version. |
| distribution | string | The distribution of the software package. |
| release | string | The build number of the software package. |
| architecture | string | The architecture of the software package. |
| Size | int | The decompressed size of the software package, in bytes. |
| PayloadSize | int | The size of the software package, in bytes. |
| ChunkCount | int | The number of slices of the software package. |
| Md5 | string | The MD5 of the software package. |
| GmtModify | time.Time | The modification time of the software package. |
Examples
Request example
POST 10.10.10.1:2886/api/v1/obproxy/package
-F "file=@/home/rpmbuild/RPMS/x86_64/obproxy-ce-4.3.3.0-5.el7.x86_64.rpm"
/api/v1/obproxy/package
Response example
{
"successful": true,
"timestamp": "2025-03-20T16:36:37.887767957+08:00",
"duration": 1491,
"status": 200,
"traceId": "e01a49a077931ea4",
"data": {
"PkgId": 2,
"Name": "obproxy-ce",
"Version": "4.3.3.0",
"ReleaseDistribution": "5.el7",
"Distribution": "el7",
"Release": "5",
"Architecture": "x86_64",
"Size": 118448854,
"PayloadSize": 29122380,
"ChunkCount": 2,
"Md5": "ab2e9b3b86eeafc482170927210a2fa4",
"GmtModify": "2025-03-20T08:36:37Z"
}
}
References
In addition to using the CLI to call the API, you can also use the SDK. For more information about how to call the API through the obshell-sdk-python package, see Upload an ODP installation package.