Purpose
You can call this operation to preview a restore task. The paths of all backup resources are returned.
Call description
Limitations
You have the permission to create a tenant in the target cluster restored.
Request path
POST /api/v2/ob/clusters/{id}/backup/restore/preview
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1001 | The ID of the backed-up cluster. |
Data structure of RestoreTenantParam
| Parameter | Type | Required | Description |
|---|---|---|---|
| backupTenantStatus | String | Yes | The status of the backed-up tenant. Valid values: ONLINE and OFFLINE. |
| restoreOnlineTenantRequiredParam | Object | No | This parameter is required when the backed-up tenant is online. |
| ├─ backupClusterId | Long | Yes | The ID of the backed-up cluster. |
| ├─ backupTenantId | Long | Yes | The ID of the backed-up tenant. |
| ├─ restoreClusterId | Long | Yes | The ID of the restored cluster. |
| ├─ restoreEndTime | OffsetDateTime | Yes | The target point in time to which the cluster is to be restored. |
| ├─ restoreTenantInfoParam | Object | Yes | The target tenant model for restore. |
| ├─ name | String | Yes | The name of the tenant. |
| ├─ primaryZone | String | No | The primary zone. |
| ├─ zones | Array | Yes | The zone settings. |
| ├─ name | String | Yes | The name of the zone. |
| ├─ replicaType | String | Yes | The type of the replica. Valid values: FULL, LOGONLY, and READONLY. |
| ├─ resourcePool | Object | Yes | The resource pool. |
| ├─ unitSpecName | String | Yes | The name of the unit specification. |
| ├─ unitCount | Long | Yes | The number of units. |
| restoreOfflineTenantRequiredParam | Object | This parameter is required when the backed-up tenant is offline. | |
| ├─ backupMode | String | Yes | The backup method. |
| ├─ backupClusterName | String | Yes | The name of the backed-up cluster. |
| ├─ backupObClusterId | Long | No | The ID of the backed-up OceanBase cluster. |
| ├─ backupTenantName | String | Yes | The name of the backed-up tenant. |
| ├─ backupObTenantId | Long | No | The ID of the backed-up OceanBase Database tenant. |
| ├─ restoreClusterId | Long | Yes | The ID of the restored cluster. |
| ├─ obBackupStorageBaseInfo | Object | Yes | The backup storage information. For more information, see the data structure in Create a backup strategy for a cluster. |
| ├─ restoreEndTime | OffsetDateTime | Yes | The target point in time to which the cluster is to be restored. |
| ├─ restoreTenantInfoParam | Object | Yes | The target tenant model for restore, which is the same as that for online restore. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Array | For more information, see Data structure of RestorePreviewItem. |
| 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. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responds to the request. |
Data structure of RestorePreviewItem
| Parameter | Type | Description |
|---|---|---|
| backupDest | String | The backup path. |
| backupId | Long | The ID of the backup set. |
| backupType | String | The backup set or backup piece. |
| copyId | Long | The copy ID. |
Examples
Sample request
{
"backupTenantStatus": "ONLINE",
"restoreOnlineTenantRequiredParam": {
"restoreClusterId": 14,
"backupClusterId": 14,
"backupTenantId": 280,
"restoreEndTime": "2024-04-06T14:16:02.000000+08:00",
"restoreTenantInfoParam": {
"name": "test1",
"zones": [{
"key": "15",
"checked": true,
"name": "zone1",
"replicaType": "FULL",
"resourcePool": {
"unitSpecName": "S1",
"unitCount": 1
}
}],
"primaryZone": "zone1",
"tableRestoreObjects": []
}
}
}
Sample response
{
"data": {
"contents": [
{
"backupDest": "file:///obbackup/backup_3245/1704259760/incarnation_1/1002/data/backup_set_24_full_20240406",
"backupId": "24",
"backupType": "BACKUP_SET",
"copyId": "0"
},
{
"backupDest": "file:///obbackup/backup_3245/1704259760/incarnation_1/1002/clog/6_38_20240405",
"backupId": "38",
"backupType": "BACKUP_PIECE",
"copyId": "0"
}
]
},
"duration": 117,
"server": "d21b8dbaea",
"status": 200,
"successful": true,
"timestamp": "2024-04-25T19:12:16.452+08:00",
"traceId": "596d720b94a542a6"
}