Initiate tenant recovery

2023-08-15 11:20:59  Updated

Description

You can call this operation to recover a backed-up tenant to the destination cluster.

Call description

Prerequisites

  • You have the permission to create a tenant in the destination cluster for recovery.

  • You have passed 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 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 recovered cluster.
|----restoreEndTime OffsetDateTime Yes The target time point of the cluster to be recovered to.
|----restoreTenantInfoParam Object Yes The target tenant model for recovery.
|----name String Yes The name of the tenant.
|----primaryZone String No The primary zone.
|----zones Arrays 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 settings.
|----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 recovered cluster.
|----obBackupStorageBaseInfo Object Yes The storage information of the backup. For more information, see the data structure in Create a backup strategy for a cluster.
|----restoreEndTime OffsetDateTime Yes The target time point of the tenant to be recovered to.
|----restoreTenantInfoParam Object Yes The target tenant model for recovery, which is the same as that for online recovery.

Response parameters

Parameter Type Description
data Object For more information, see Data structure of BackupCommonResponse .
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.
traceId String The trace ID of the request. This trace ID is used for troubleshooting.
server String The address of the application server that responded to the request.

Data structure of BackupCommonResponse

Parameter Type Description
obBackupTaskType String The backup operation type, for example, CREATE_BACKUP_STRATEGY.
backupObjectOpsResultList Array The operation result set of the backup object.
|--obBackupObjectList Array The list of information returned for the backup object.
|--clusterId Long The ID of the cluster.
|--tenantId Long The ID of the tenant.
|--backupDimension String The backup dimension. Valid values: * CLUSTER * TENANT CLUSTER represents cluster backup and TENANT represents tenant backup. Tenant backup is not supported.
|--beSuccessful Boolean Indicates whether the operation was successful.
|--taskIdList Array The list of task numbers returned for asynchronous tasks.
|--errorCode Object The error code.
|--hint String The prompt information.

Examples

Sample request

{
    "backupTenantStatus": "ONLINE",
    "restoreOnlineTenantRequiredParam": {
        "restoreClusterId": 9,
        "restoreTenantInfoParam": {
            "name": "mysql_1",
            "zones": [
                {
                    "key": "30",
                    "name": "zone1",
                    "replicaType": "FULL",
                    "resourcePool": {
                        "unitSpecName": "S1",
                        "unitCount": 1
                    }
                }
            ],
            "primaryZone": "zone1"
        },
        "backupClusterId": 9,
        "backupTenantId": 21,
        "restoreEndTime": "2020-11-11T00:50:00.215+08:00"
    }
}

Sample response

{
    "data": {
        "backupObjectOpsResultList": [
            {
                "beSuccessful": true,
                "obBackupObjectList": [
                    {
                        "backupDimension": "CLUSTER",
                        "clusterId": 1000005
                    }
                ],
                "taskIdList": [
                    3000041
                ]
            }
        ],
        "obBackupTaskType": "RESTORE"
    },
    "duration": 51,
    "server": "192.168.0.1",
    "status": 200,
    "successful": true,
    "timestamp": "2021-09-07T14:51:41.135+08:00",
    "traceId": "5962f337662d4043"
}

Contact Us