Overview
This API is used to restore a backed-up tenant to the target cluster.
API details
Constraints
The caller must have the permission to create tenants in the target cluster to be restored.
The caller must pass the authentication for the OCP application service.
Request path
POST /api/v2/ob/clusters/{id}/backup/restore
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 | Backup tenant status. Valid values: |
|
| restoreOnlineTenantRequiredParam | Object | No | This parameter is required when the backup tenant is online. | |
| \ | ----backupClusterId | Long | Yes | Backup cluster ID. |
| \ | ----backupTenantId | Long | Yes | Backup tenant ID. |
| \ | ----restoreClusterId | Long | Yes | The ID of the restored cluster. |
| \ | ----restoreEndTime | OffsetDateTime | Yes | Restore to a specific point in time. |
| \ | ----restoreTenantInfoParam | Object | Yes | The target tenant model to be restored. |
| \ | ----name | String | Yes | Tenant name. |
| \ | ----primaryZone | String | No | Primary Zone. |
| \ | ----zones | Arrays | Yes | Zone configuration. |
| \ | ----name | String | Yes | The name of the zone. |
| \ | ----replicaType | String | Yes | Replica type. Valid values: |
| \ | ----resourcePool | Object | Yes | Resource pool configuration. |
| \ | ----unitSpecName | String | Yes | Specification name. |
| \ | ----unitCount | Long | Yes | Number of specifications. |
| restoreOfflineTenantRequiredParam | Object | Yes | This parameter is required when the backup tenant is offline. | |
| \ | ----backupMode | String | Yes | Backup method. |
| \ | ----backupClusterName | String | Yes | The name of the backup cluster. |
| \ | ----backupObClusterId | Long | No | The ID of the backup cluster on the OceanBase side. |
| \ | --------name | String | Yes | The name of the zone. |
| \ | --------replicaType | String | Yes | Replica type. Valid values: |
| \ | --------resourcePool | Object | Yes | Resource pool configuration. |
| \ | --------unitSpecName | String | Yes | Specification name. |
| \ | --------unitCount | Long | Yes | Number of specifications. |
| \ | ----restoreTenantInfoParam | Object | Yes | The target tenant model for recovery is the same as that used in online recovery. |
Response parameters
Parameter |
Type |
Description |
|---|---|---|
| data | Object | For more information, see BackupCommonResponsedata structure. |
| successful | Boolean | 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 encoding that complies with the HTTP Status specification. |
| traceId | String | The trace ID of the request, used for troubleshooting. |
| server | String | The address of the application service that responds to the request. |
Data structure of BackupCommonResponse
Parameter |
Type |
Description |
|
|---|---|---|---|
| obBackupTaskType | String | Backup operation type, such as "CREATE_BACKUP_STRATEGY". | |
| backupObjectOpsResultList | Array | Result set of backup object operations. | |
| \ | --obBackupObjectList | Array | Backup object list. |
| \ | --clusterId | Long | Cluster ID. |
| \ | --tenantId | Long | Tenant ID. |
| \ | --backupDimension | String | Backup dimension. For example, CLUSTER indicates cluster backup, and TENANT indicates tenant backup. |
| \ | --beSuccessful | Boolean | Whether the operation succeeded. |
| \ | --taskIdList | Array | List of task IDs, returned only for asynchronous tasks. |
| \ | --errorCode | Object | Error code. |
| \ | --hint | String | Prompt message. |
Examples
Request example
{
"backupTenantStatus": "ONLINE",
"restoreOnlineTenantRequiredParam": {
"restoreClusterId": 9,
"restoreTenantInfoParam": {
"name": "mysql_1",
"zones": [
{
"name": "zone1",
"replicaType": "FULL",
"resourcePool": {
"unitSpecName": "S1",
"unitCount": 1
}
}
],
"primaryZone": "zone1"
},
"backupClusterId": 9,
"backupTenantId": 21,
"restoreEndTime": "2020-11-11T00:50:00.215+08:00"
}
}
Response example
{
"data": {
"backupObjectOpsResultList": [
{
"beSuccessful": true,
"obBackupObjectList": [
{
"backupDimension": "CLUSTER",
"clusterId": 1000005
}
],
"taskIdList": [
3000041
]
}
],
"obBackupTaskType": "RESTORE"
},
"duration": 51,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-07T14:51:41.135+08:00",
"traceId": "5962f337662d4043"
}
