Feature description
Queries the software packages managed by OCP. You can filter the software package list by package name, type, version, operating system, or architecture, and sort the list by upload time.
Call instructions
Interface constraints
The caller must have the PACKAGE_VIEWER privilege.
Request path
GET /api/v2/software-packages
Request parameters
body:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| keyword | String | No | agent | The search keyword for the software package. The package names are filtered based on this keyword. |
| type | StringArray | No | OB_SERVER_INSTALL_PACKAGE,OB_AGENT_INSTALL_PACKAGE | The software package type. Valid values: |
| version | StringArray | No | 3.1.0,3.1.1 | The software package version. Multiple versions can be specified. |
| operatingSystem | StringArray | No | alios,el7 | The operating system type. Multiple types can be specified. |
| architecture | StringArray | No | x84_64,arm | The system architecture. Multiple architectures can be specified. |
| page | Integer | No | 1 | The page number of the requested data. The value starts from 1. The default value is 1. |
| size | Integer | No | 10 | The size of the requested data. The default value is 10, and the maximum value is 2000. |
| sort | String | No | name,asc | The sorting rule for the requested data. |
Returned result
Basic data structure
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | An array of SoftwarePackageMeta objects. For more information, see SoftwarePackageMeta data structure. |
| ├─ page | Object | Paging information. |
| ├─ totalElements | Integer | The total number of records. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The current page number. |
| ├─ size | Integer | The size of the current page. |
| 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 that conforms to the HTTP Status specification. |
| traceId | String | The Trace ID of the request, which is used to troubleshoot issues. |
| server | String | The address of the application service that responded to the request. |
SoftwarePackageMeta data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Integer | The ID of the software package. |
| name | String | The name of the software package. |
| fileName | String | The full name of the software package file. |
| extension | String | The extension of the software package. |
| size | Integer | The size of the software package, in bytes. |
| sha1 | String | The SHA1 of the software package. |
| downloadUrl | String | The URL for downloading the software package. |
| type | String | The type of the software package. Valid values: OB_SERVER_INSTALL_PACKAGE: the OceanBase installation package.OCP_AGENT_INSTALL_PACKAGE: the OCP Agent installation package.OBPROXY_INSTALL_PACKAGE: the OBProxy installation package.OB_BACKUP_AGENT_INSTALL_PACKAGE: the backup and recovery installation package.OTHERS_RPM: other installation packages. |
| version | String | The version of the software package. |
| buildNumber | String | The build number of the software package. |
| operatingSystem | String | The operating system supported by the software package. |
| architecture | String | The architecture of the software package. |
| deletable | Boolean | Indicates whether the software package can be deleted. |
Example
Request example
GET /api/v2/software-packages?page=1&size=10&type=OCP_AGENT_INSTALL_PACKAGE
Response example
{
"data": {
"contents": [
{
"architecture": "x86_64",
"buildNumber": "1898294",
"createTime": "2020-08-10T15:16:50+08:00",
"deletable": true,
"downloadUrl": "http://xxx.xxx.xxx.xxx:8080/api/v2/files/sys-package/t-oceanbase-ocp-agent-2.4.2-1898294.alios7.x86_64.rpm",
"extension": "rpm",
"fileName": "t-oceanbase-ocp-agent-2.4.2-1898294.alios7.x86_64.rpm",
"id": 12,
"installationDataList": [],
"name": "t-oceanbase-ocp-agent",
"operatingSystem": "alios7",
"sha1": "e3277366579eac7ecf7a5b6313f2807229567a12",
"size": 31017340,
"type": "OCP_AGENT_INSTALL_PACKAGE",
"version": "2.4.2"
},
{
"architecture": "x86_64",
"buildNumber": "1884049",
"createTime": "2020-05-25T16:32:51+08:00",
"deletable": true,
"downloadUrl": "http://xxx.xxx.xxx.xxx:8080/api/v2/files/sys-package/t-oceanbase-ocp-agent-2.4.0-1884049.alios7.x86_64.rpm",
"extension": "rpm",
"fileName": "t-oceanbase-ocp-agent-2.4.0-1884049.alios7.x86_64.rpm",
"id": 10,
"installationDataList": [],
"name": "t-oceanbase-ocp-agent",
"operatingSystem": "alios7",
"sha1": "4a6c96b46268121b32a0590729bf44ad9068b6b9",
"size": 29867460,
"type": "OCP_AGENT_INSTALL_PACKAGE",
"version": "2.4.0"
}
],
"page": {
"number": 1,
"size": 10,
"totalElements": 2,
"totalPages": 1
}
},
"duration": 9,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-24T21:15:45.533+08:00",
"traceId": "b31aec4d58104ecd"
}
