All Products
Search
Document Center

ApsaraDB for Redis:RestoreInstance

Last Updated:May 28, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
kvstore:RestoreInstanceWRITE
  • DBInstance
    acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

r-bp1zxszhcgatnx****
BackupIdstringNo

The ID of the backup file. You can call the DescribeBackups operation to query the IDs of backup files.

78241****
RestoreTypestringNo

The restoration mode. Default value: 0. Valid values:

  • 0: restores data from the specified backup set.
  • 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 must also specify the RestoreTime parameter.
1
RestoreTimestringNo

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 specify 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.

  • This parameter is available only if you set the RestoreType parameter to 1.

2021-07-06T07:25:57Z
FilterKeystringNo

The key that you want to restore. You can specify multiple keys. Separate multiple keys with commas (,). Regular expressions are supported.

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.

  • This parameter is available only if you set the RestoreType parameter to 1.

key:00000007198*
TimeShiftstringNo

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

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

8D0C0AFC-E9CD-47A4-8395-5C31BF9B****

Examples

Sample success responses

JSONformat

{
  "RequestId": "8D0C0AFC-E9CD-47A4-8395-5C31BF9B****"
}

Error codes

HTTP status codeError codeError message
400ServiceNotSupportThis service not supported.
400MissingParameterMissing Required Param: BackupId or RestoreTime or RestoreType.
400ResroreParamNotMatchrestoreType is not match with backupId or restoreTime.
400InvalidRestoreTime.FormatSpecified restore time is not valid.
400ZoneMigrationError.StillingRunningZone migration task is still running
400InvalidBinlog.NotValidThe available binlog is not valid in recovery time.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-07-20API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
2022-11-22The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: TimeShift