Overview
This API is used to access the specified backup storage using the host managed by the current OCP, and parse the source cluster, source tenant, data backup point, log backup interval, and recoverable time interval from it.
A typical scenario is as follows: In the production environment, tenant backups are stored in OSS. The test environment has no association with the production environment's OCP or OceanBase clusters, but can access that OSS. The caller can use this API to parse backup information, select a restore point, and submit an offline tenant restore task.
API details
Constraints
- The caller must pass the authentication for the OCP application service and have the backup read permission.
- The caller must have read permission on the selected resolution host, and the resolution host must be able to access the specified backup storage.
Request path
POST /api/v2/backup/info
Request parameters
Query parameters
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| startTime | DateTime | No | 2026-09-02T10:00:00+08:00 | The start time of the query time range, in ISO 8601 format. |
| endTime | DateTime | No | 2026-09-09T10:00:00+08:00 | End time of the query time range, in ISO 8601 format. |
| timeScopeType | String | No | LATEST_SEVEN_DAYS | Type of the query time range. Valid values:LATEST_SEVEN_DAYS、LATEST_SIX_MONTHS、MONTHS、YEARSandUSER_DEFINED. Default value:LATEST_SEVEN_DAYS. |
Body parameters
Data structure of ParseObBackupInfoParam
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| obBackupStorageBaseInfo | Object | Yes | - | Information about data backup storage. For the data structure, see Data structure of ObBackupStorageBaseInfo. |
| hostIdList | LongArray | Yes | [3001] | Data backup resolution host ID list. At least one host ID managed by the current OCP must be provided. |
| logStorageMode | String | No | SAME_AS_DATA | Log backup storage mode.SAME_AS_DATAindicates that logs and data use the same storage;INDEPENDENTIndicates that logs are stored separately. It is recommended to specify this parameter explicitly. |
| logBackupStorageBaseInfo | Object | Condition Required | - | logStorageModeforINDEPENDENTRequired when ; set toSAME_AS_DATAmust be omitted. The data structure andobBackupStorageBaseInfoThe same. |
| logHostIdList | LongArray | No | [3002] | List of host IDs for parsing independent log backups. When omitted or set to an empty array, the following value is used by default:hostIdList. |
| storageId | Long | No | 10 | The ID of the backup storage configuration already present in OCP. When invoking the application service, you must still provide the complete storage parameters and object storage access credentials; you cannot rely solely on this field. |
Data structure of ObBackupStorageBaseInfo
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| backupStorageType | String | Yes | BACKUP_STORAGE_OSS | Storage type. The types currently supported by this API includeBACKUP_STORAGE_FILE、BACKUP_STORAGE_OSS、BACKUP_STORAGE_COS、BACKUP_STORAGE_OBSandBACKUP_STORAGE_S3. |
| storageUrl | String | Yes | example-bucket/obbackup | Storage directory, up to 1,024 characters in length. It does not need to containfile://、oss://、cos://、obs://ors3://Prefix. |
| ossAccessKey | Object | Condition Required | - | Access information for OSS, only available whenbackupStorageTypeforBACKUP_STORAGE_OSSpassed in. |
| cosAccessKey | Object | Condition Required | - | COS access information, only inbackupStorageTypeforBACKUP_STORAGE_COSpassed in. |
| obsAccessKey | Object | Condition Required | - | OBS access information, only inbackupStorageTypeisBACKUP_STORAGE_OBSpassed in. |
| s3AccessKey | Object | Condition Required | - | S3 access information, only inbackupStorageTypeisBACKUP_STORAGE_S3passed in. |
| customBackupRangeList | Array | No | [] | Custom backup scope. If no custom scope is specified, this parameter is omitted or an empty array is passed. |
| advancedConfigList | Array | No | [] | Advanced backup storage configuration. Omitted or passed as an empty array when no advanced configuration is provided. |
Data structure of object storage access credentials
Storage Type |
Parameter |
Type |
Required |
Description |
|---|---|---|---|---|
| OSS | endpoint | String | Yes | The endpoint of the OSS server. |
| OSS | accessKeyId | String | Yes | OSS AccessKey ID. |
| OSS | accessKeySecret | String | Yes | OSS AccessKey Secret. |
| COS | endpoint | String | Yes | The COS service endpoint. |
| COS | accessKeyId | String | Yes | COS SecretId. |
| COS | accessKeySecret | String | Yes | COS SecretKey. |
| COS | appId | String | Yes | COS AppId. |
| OBS | endpoint | String | Yes | The OBS service endpoint. |
| OBS | accessKeyId | String | Yes | OBS AccessKey ID. |
| OBS | accessKeySecret | String | Yes | OBS Secret Access Key. |
| S3 | endpoint | String | Yes | S3-compatible endpoint. |
| S3 | accessKeyId | String | Yes | S3 AccessKey ID. |
| S3 | accessKeySecret | String | Yes | S3 Secret Access Key. |
| S3 | region | String | No | S3 region. This parameter is required when the storage service specifies a region. |
Notice
COS credentials are sensitive information. Do not write the actual credentials into documentation, code repositories, or general logs.
When logStorageMode is INDEPENDENT, the following constraints also apply:
- Independent log storage only supports
BACKUP_STORAGE_FILEorBACKUP_STORAGE_S3. - The storage root directories for data backup and log backup must be different and not include each other.
- The
logBackupStorageBaseInfoparameter must be specified. If you do not specify thelogHostIdListparameter, OCP will reuse thehostIdListparameter.
Response parameters
Basic Data Structures
Parameter |
Type |
Description |
|---|---|---|
| data | Object | The returned data. For more information, see Data structure of ObClusterBackupInfo. |
| ├─ contents | Array | A list of cluster backup information parsed from the backup storage. |
| successful | Boolean | Whether the request is successful. |
| timestamp | DateTime | The timestamp when the server completed the request. |
| duration | Long | The time taken by the server to process the request, in milliseconds. |
| status | Integer | Status codes that comply with the HTTP Status specification. |
| traceId | String | The trace ID of the request, used for troubleshooting. |
| server | String | The address of the OCP node that responded to the request. |
Data structure of ObClusterBackupInfo
Parameter |
Type |
Description |
|---|---|---|
| clusterName | String | The name of the source cluster for backup. |
| obClusterId | Long | The cluster ID of the source cluster in OceanBase Database. |
| clusterId | Long | The ID of the source cluster for backup in the current OCP. For cross-OCP offline backup, this is usuallynull. |
| online | Boolean | Whether the backup source cluster is under the online management of the current OCP. |
| tenantBackupInfos | Array | List of tenant backup information. For more information, see Data structure of ObTenantBackupInfo. |
| obRecoverableInfoAggregation | Object | The recoverable information is summarized at the cluster level, with a structure identical to that at the tenant level. |
Data structure of ObTenantBackupInfo
Parameter |
Type |
Description |
|---|---|---|
| clusterName | String | The name of the source cluster for backup. |
| obClusterId | Long | The cluster ID of the source cluster in OceanBase Database. |
| clusterId | Long | The ID of the source cluster for backup in the current OCP. For cross-OCP offline backup, it is usuallynull. |
| obTenantId | Long | The tenant ID of the source tenant in OceanBase. |
| tenantId | Long | The ID of the source tenant in the current OCP. For cross-OCP offline backup, it is usuallynull. |
| tenantName | String | Name of the source tenant for backup. |
| mode | String | Tenant compatibility mode. Valid values:MYSQLorORACLE. |
| online | Boolean | Whether the backup source tenant is under the online management of the current OCP. |
| obRecoverableInfoAggregation | Object | Summary of recoverable information for the tenant. |
Data structure of ObRecoverableInfoAggregation
Parameter |
Type |
Description |
|---|---|---|
| obQueryTimeScopeType | String | The time range type used for this response. |
| latestSevenDaysAggregation | Object | List of details.LATEST_SEVEN_DAYS、LATEST_SIX_MONTHSandUSER_DEFINEDUse this field. |
| ├─ obRecoverableSectionItems | Array | List of data backup points, log backup intervals, and actual recoverable intervals. |
| latestMonthsAggregation | Object | Aggregated backup information by day,MONTHSUse this field. |
| ├─ dayFormatAndRecoverableItems | Object | Key isyyyy-MM-dd, the Value is the list of backup information for that day. |
| latestYearsAggregation | Object | Monthly aggregated backup statistics,YEARSUse this field. |
| ├─ monthFormatAndRecoverableStatics | Object | Key isyyyy-MM, where Value contains the number of data backups and the cumulative duration of log backups. |
Data structure of ObRecoverableSectionItem
Parameter |
Type |
Description |
|---|---|---|
| obRecoverableSectionItemType | String | Node type. Valid values:FULL_DATA_BACKUP、INCREMENTAL_DATA_BACKUP、LOG_BACKUPandRECOVERABLE. |
| backupMode | String | Backup mode. Valid values:PHYSICAL_BACKUPorLOGICAL_BACKUP. |
| backupDimension | String | Backup dimension. Valid values:CLUSTERorTENANT. |
| dataBackupRecoverableInfo | Object | Data backup information, which is valid only when the node type is data backup. IncludesfreezeTime、recoverableTime、dataVersionandfullBackupSetId. |
| logRecoverableTimeInterval | Object | Log backup interval, applicable only to node types ofLOG_BACKUPValid for . IncludesstartTimeandendTime. |
| realRecoverableTimeInterval | Object | The actual recoverable range is only applicable to nodes of type.RECOVERABLEValid for . IncludesstartTimeandendTime. |
Examples
Request example
Parse backup information for the last seven days in OSS:
POST /api/v2/backup/info?timeScopeType=LATEST_SEVEN_DAYS
{
"obBackupStorageBaseInfo": {
"backupStorageType": "BACKUP_STORAGE_OSS",
"storageUrl": "example-bucket/obbackup",
"ossAccessKey": {
"endpoint": "oss-cn-hangzhou.aliyuncs.com",
"accessKeyId": "${ACCESS_KEY_ID}",
"accessKeySecret": "${ACCESS_KEY_SECRET}"
}
},
"hostIdList": [3001],
"logStorageMode": "SAME_AS_DATA"
}
When using a file system or NFS, replace the storage part with:
{
"backupStorageType": "BACKUP_STORAGE_FILE",
"storageUrl": "/data/obbackup"
}
Response example
The following example shows only the main fields used in this process:
{
"data": {
"contents": [
{
"clusterName": "prod_cluster",
"obClusterId": 1001,
"clusterId": null,
"online": false,
"tenantBackupInfos": [
{
"clusterName": "prod_cluster",
"obClusterId": 1001,
"clusterId": null,
"obTenantId": 1002,
"tenantId": null,
"tenantName": "tenant_a",
"mode": "MYSQL",
"online": false,
"obRecoverableInfoAggregation": {
"obQueryTimeScopeType": "LATEST_SEVEN_DAYS",
"latestSevenDaysAggregation": {
"obRecoverableSectionItems": [
{
"obRecoverableSectionItemType": "RECOVERABLE",
"backupMode": "PHYSICAL_BACKUP",
"realRecoverableTimeInterval": {
"startTime": "2026-09-02T10:00:00+08:00",
"endTime": "2026-09-09T10:00:00+08:00"
}
}
]
}
}
}
]
}
]
},
"duration": 1280,
"server": "10.0.0.10",
"status": 200,
"successful": true,
"timestamp": "2026-09-09T10:00:01.280+08:00",
"traceId": "3cfec9a5180748ff"
}
