Restores the data of an ApsaraDB for Redis instance from a backup file to the instance. If you use the operation together with the data flashback feature, you can restore data of a specified key to a specified point in time that is accurate to the second.
- If your ApsaraDB for Redis instance is performance-enhanced and the data flashback feature is enabled, you can call this operation to restore the data of a specified key to a specified point in time that is accurate to the second. Other keys are not affected. This way, you can achieve more fine-grained data restoration.
- If your ApsaraDB for Redis instance is not performance-enhanced, this operation overwrites the existing data of your instance with the backup data, which is risky. Proceed with caution. We recommend that you call the CreateInstance operation to create an instance. Then, you can restore data to the new instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | RestoreInstance |
The operation that you want to perform. Set the value to RestoreInstance. |
InstanceId | String | Yes | r-bp1zxszhcgatnx**** |
The ID of the instance. |
RegionId | String | No | cn-hangzhou |
The region ID of the instance. You can call the DescribeInstanceAttributee operation to query the region ID of the instance. |
BackupId | String | No | 78241**** |
The ID of the backup file. You can call the DescribeBackups operation to query the IDs of backup files. |
RestoreType | String | No | 1 |
The restoration mode. Valid values:
|
RestoreTime | String | No | 2021-07-06T07:25:57Z |
The point in time to which you want to restore data. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
|
FilterKey | String | No | key:00000007198* |
The key whose data you want to restore. You can specify multiple keys. Separate multiple keys with commas (,). You can also use regular expressions. Note
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 8D0C0AFC-E9CD-47A4-8395-5C31BF9B**** |
The ID of the request. |
Examples
Sample requests
http(s)://r-kvstore.aliyuncs.com/?Action=RestoreInstance
&InstanceId=r-bp1zxszhcgatnx****
&RestoreType=1
&RestoreTime=2021-07-06T07:25:57Z
&FilterKey=key:00000007198*
&<Common request parameters>
Sample success responses
XML
format
<RestoreInstanceResponse>
<RequestId>8D0C0AFC-E9CD-47A4-8395-5C31BF9B****</RequestId>
</RestoreInstanceResponse>
JSON
format
{
"RequestId": "8D0C0AFC-E9CD-47A4-8395-5C31BF9B****"
}
Error codes
For a list of error codes, visit the API Error Center.