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.

Note
  • 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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:

  • 0: restores data from the specified backup set. 0 is the default value.
  • 1: restores data to a specified point in time. You can specify this value only if the data flashback feature is enabled for the instance. If you specify this value, you also need to set the RestoreTime parameter.
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
  • If the data flashback feature is enabled for the instance, you can set this parameter and the FilterKey parameter to restore the data of the specified key to the 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.
  • You can set this parameter only if you set the RestoreType parameter to 1.
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
  • In a regular expression, an asterisk (*) matches zero or more occurrences of a subexpression that occurs before. For example, if you set this parameter to h.*llo, strings such as hllo and heeeello are matched.
  • You can set this parameter only if you set the RestoreType parameter to 1.

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.