Overview
You can call this API to create a tenant restore task.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/backup/restore
Request parameters
Path
| Parameter | Type | Required | Description |
|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. |
Query
| Parameter | Type | Required | Description |
|---|---|---|---|
| action | String | Yes | CreateTenantRestoreTask |
| requestId | String | Yes | The unique identifier of the request. |
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| sourceInstanceID | String | Yes | The ID of the source cluster. | obxxx |
| tenantResource | Object | Yes | The specifications of the tenant resource. | {"cpu":1,"memory":4,"unitnum":1} |
| fromRemote | Boolean | Yes | Specifies whether to initiate the restore task from a remote location. | true |
| sourceTenantID | String | Yes | The ID of the source tenant. | txxx |
| restoreTime | String | Yes | The time when the restore task is initiated. | 2026-01-13T05:58:34Z |
| restoreObjectType | String | Yes | The type of the restore object. | tenant |
| restoreObjects | Object | No | The content of the restore object. | [] |
| restoreMode | String | Yes | The restore mode. | from_backup_set |
| targetInstanceID | String | Yes | The ID of the target instance. | obxxx |
| targetTenantName | String | Yes | The name of the target tenant. | mysql_001 |
| targetTenantDescription | String | Yes | The description of the target tenant. | test |
| targetTenantPrimaryZone | String | Yes | The zone of the target tenant. | cn-shanghai-e |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| data | Object | The returned result set is empty. | null |
Examples
Request example
curl --digest -u 'ak:sk' \
-X POST \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/backup/restore' \
--header "Content-Type: application/json" \
--data '{
"sourceInstanceId": "obxxx",
"tenantResource": {
"cpu": 1,
"memory": 4,
"unitNum": 1
},
"fromRemote": false,
"sourceTenantId": "txxx",
"restoreTime": "2026-01-13T05:58:34Z",
"restoreObjectType": "tenant",
"restoreObjects": [],
"restoreMode": "from_backup_set",
"targetInstanceId": "obxxx",
"targetTenantName": "RestoredTenant001",
"targetTenantDescription": "Test",
"targetTenantPrimaryZone": "cn-shanghai-e"
}'
Response example
JSON format
{
"data":{},
"requestId":"4d9124c3-d92b-4a6e-bccd-343f2554fa22",
"success":true
}