Restores the data in a backup file to a specified ApsaraDB for Redis instance.
Operation description
-
If your instance is a persistent memory-optimized instance or DRAM-based instance that is compatible with Redis 5.0 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.
-
For other instance series, this operation overwrites the existing data of your instance with the backup data. 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
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
kvstore:RestoreInstance | update |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the instance. | r-bp1zxszhcgatnx**** |
BackupId | string | No | The ID of the backup file. You can call the DescribeBackups operation to query the IDs of backup files. | 78241**** |
RestoreType | string | No | The restoration mode. Default value: 0. Valid values:
| 1 |
RestoreTime | string | No | 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
| 2021-07-06T07:25:57Z |
FilterKey | string | No | The key that you want to restore. You can specify multiple keys. Separate multiple keys with commas (,). Regular expressions are supported. Note
| key:00000007198* |
TimeShift | string | No | The expiration offset time point of a key. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The key expires after the remaining validity period of the key elapses based on the expiration offset time point. Note
This time point must be between the specified flashback time point and the submission time of the data restoration task.
| 2021-07-06T08:25:57Z |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "8D0C0AFC-E9CD-47A4-8395-5C31BF9B****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | ServiceNotSupport | This service not supported. |
400 | MissingParameter | Missing Required Param: BackupId or RestoreTime or RestoreType. |
400 | ResroreParamNotMatch | restoreType is not match with backupId or restoreTime. |
400 | InvalidRestoreTime.Format | Specified restore time is not valid. |
400 | ZoneMigrationError.StillingRunning | Zone migration task is still running |
400 | InvalidBinlog.NotValid | The available binlog is not valid in recovery time. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-07-20 | API Description Update. The Error code has changed | View Change Details |
2022-11-22 | The Error code has changed. The request parameters of the API has changed | View Change Details |