This API is used to upload the RPM package required for agent upgrade.
Call description
Limitations
If you set a password in the request, you must specify the X-OCS-Auth field in the header for authentication. For more information, see Authentication based on public-key encryption.
Request path
POST /api/v1/upgrade/package
Request type
multipart/form-data
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| file | file | Yes | The path to the RPM package required for the upgrade. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | Boolean | Indicates whether the request is 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. |
| data | Object | For more information, see the data structure of UpgradePkgInfo. |
| error | Object | The information about the error that occurred. |
The following table describes the data structure of UpgradePkgInfo.
| Parameter | Type | Description |
|---|---|---|
| pkgId | Integer | The ID of the RPM package. |
| name | String | The name of the RPM package. |
| version | String | The version of the RPM package. |
| releaseDistribution | String | The release version and build version of the RPM package. |
| Distribution | String | The release version of the RPM package. |
| release | String | The build version of the RPM package. |
| architecture | String | The system architecture of the RPM package. |
| Size | Integer | The size of the RPM package, in bytes, after it is decompressed. |
| PayloadSize | Integer | The size of the RPM package, in bytes. |
| ChunkCount | Integer | The number of chunks of the RPM package. |
| Md5 | String | The MD5 value of the RPM package. |
| UpgradeDepYaml | String | The file that specifies the upgrade path. |
| GmtModify | Time | The time when the RPM package was modified. |
Examples
Sample request
-F "file=@/home/rpmbuild/RPMS/x86_64/oceanbase-ce-4.2.1.1-101000062023110109.el7.x86_64.rpm"
/api/v1/upgrade/package
Sample response
{
"successful": true,
"timestamp": "2024-01-09T16:55:58.153159003+08:00",
"duration": 68288,
"status": 200,
"traceId": "42464438789e774e",
"data": {
"PkgId": 1,
"Name": "oceanbase-ce",
"Version": "4.2.1.1",
"ReleaseDistribution": "101000062023110109.el7",
"Distribution": "el7",
"Release": "101000062023110109",
"Architecture": "x86_64",
"Size": 433648329,
"PayloadSize": 96547244,
"ChunkCount": 6,
"Md5": "550d75397013d00ca0a8e529d17020c3",
"UpgradeDepYaml": "# Describes the upgrade dependencies of different OceanBase Database versions.\n# For more information, see release/ptw5y7.\n\n# For each officially released OceanBase Database version, a record with the following attributes is added to the .yaml file:\n# * version: the source version or a transition version during the upgrade. The value is a version number in the A.B.C format. If the value is in the A.B.C-D format, the build number must be greater than or equal to D.\n# * can_be_upgraded_to: the target versions that the current version can be *directly* upgraded to. The value is a list of versions that are determined through compatibility tests by the QA of OceanBase Database.\n# * deprecated: indicates whether the current version has been deprecated. The default value is False. The value True indicates that the current version has been deprecated and \n# can serve as the source version or a transition version of the upgrade, but cannot be the target version of the upgrade. \n# * require_from_binary: The default value is False. The value True indicates that if the current version acts as a transition version of the upgrade, you must run the upgrade script and upgrade the OBServer node to this version.\n#\n\n# The OceanBase Database upgrade module of OceanBase Cloud Platform (OCP) reads this file. Given the source and target versions of the upgrade, the upgrade module automatically\n# determines the shortest upgrade path if the preceding requirements are met. Algorithm:\n# The upgrade module builds a diagram based on the following descriptions. Each version is represented by a node and the value of can_be_upgraded_to is represented by a\n# side. The upgrade module finds the shortest path between the source and target versions. Except the start node, other nodes in an upgrade path\n# must not represent a version that has been deprecated. If two version formats A.B.C and A.B.C-D are matched, the latter is preferred.\n# \n#\n\n- version: 4.0.0.0\n can_be_upgraded_to:\n - 4.1.0.0\n\n# 4.1.0.x is barrier\n- version: 4.1.0.0-100000192023032010 # V4.1 BETA cannot be the target version of the upgrade.\n can_be_upgraded_to:\n - 4.1.0.0\n deprecated: True\n\n- version: 4.1.0.0\n can_be_upgraded_to:\n - 4.1.0.1\n\n- version: 4.1.0.1\n can_be_upgraded_to:\n - 4.1.0.2\n\n- version: 4.1.0.2\n can_be_upgraded_to:\n - 4.2.0.0\n require_from_binary:\n value: True\n when_come_from: [4.0.0.0, 4.1.0.0-100000192023032010]\n\n- version: 4.2.0.0-100000152023080109 # V4.2 RC2 cannot be the target version of the upgrade.\n can_be_upgraded_to:\n - 4.2.0.0\n deprecated: True\n\n- version: 4.2.0.0-100010022023081817 # V4.2 RC2 hotfix cannot be the target version of the upgrade.\n can_be_upgraded_to:\n - 4.2.0.0\n deprecated: True\n\n- version: 4.2.0.0\n can_be_upgraded_to:\n - 4.2.1.0\n\n# 4.2.1.x is barrier\n- version: 4.2.1.0\n can_be_upgraded_to:\n - 4.2.1.1\n\n- version: 4.2.1.1\n can_be_upgraded_to:\n - 4.3.0.0\n require_from_binary:\n value: True\n when_come_from: [4.1.0.0, 4.1.0.1, 4.1.0.2, 4.2.0.0]\n",
"GmtModify": "0001-01-01T00:00:00Z"
}
}