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 OceanBase cluster. |
Query
| Parameter |
Type |
Required |
Description |
| requestId |
String |
Yes |
The ID of the request. This parameter is used for tracing. |
| Parameter |
Type |
Required |
Description |
| X-Ob-Project-Id |
String |
Yes |
The ID of the project. |
Body
| Parameter |
Type |
Required |
Description |
Example value |
| sourceInstanceId |
String |
Yes |
The ID of the original cluster. |
obxxx |
| tenantResource |
Object |
Yes |
The resource specifications of the tenant. |
{"cpu":1,"memory":4,"unitnum":1} |
| fromRemote |
Boolean |
Yes |
Specifies whether to initiate the restore from a remote cluster. |
true |
| sourceTenantId |
String |
Yes |
The ID of the original tenant. |
txxx |
| restoreTime |
String |
Yes |
The restore time. |
2026-01-13T05:58:34Z |
| restoreObjectType |
String |
Yes |
The type of the restore object. |
tenant |
| restoreObjects |
Array |
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 '<Your ak:sk>' \
-X POST \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/backup/restore?requestId={requestId}' \
--header "X-Ob-Project-Id: {projectId}" \
--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,
"server": "xxx.xxx.x.xxx:xxxx"
}