RestoreInstance

Updated at:

Recovers data from a specified backup file to an ApsaraDB Tair (Redis® OSS-Compatible) database instance.

Operation description

  • If your instance is a Tair (Enterprise Edition) memory-optimized instance with the classic architecture, you can call this operation to restore specified keys in the current instance to a specific point in time accurate to seconds for more fine-grained data restoration.

  • For other instance types, call the CreateInstance or CreateTairInstance operation to restore backup data to a new instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

kvstore:RestoreInstance

update

*DBInstance

acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

r-bp1zxszhcgatnx****

BackupId

string

No

The ID of the backup file for the instance. You can call the DescribeBackups operation to query the ID.

78241****

RestoreType

string

No

The restoration type. Valid values:

  • 0 (default): This value is deprecated.

  • 1: Restores data to a specified point in time. You can specify this value only when the data flashback feature is enabled for the instance. If you specify this value, you must also specify the RestoreTime parameter.

Valid values:

  • 0 :

    The deprecated default restoration type.

  • 1 :

    Restores data to a specified point in time.

1

RestoreTime

string

No

The point in time to which you want to restore data. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

Note

The point in time cannot be earlier than the time when the data flashback feature is enabled.

2021-07-06T07:25:57Z

FilterKey

string

No

The keys to restore. Regular expressions are supported. Separate multiple values with commas (,).

  • If you do not specify this parameter, the entire instance is restored.

  • If you specify this parameter, only the specified keys are restored. This feature is supported only by instances of the classic edition.

Note

For example, in a regular expression, an asterisk (*) matches the preceding subexpression zero or more times. If you set this parameter to h.*llo, the system matches strings such as hllo and heeeello.

key:00000007198*

TimeShift

string

No

When you restore a classic edition instance, you can shift the expiration time of keys regardless of whether you restore full data or specified keys. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The instance calculates the expiration time by adding the remaining time to live (TTL) of the keys at the specified flashback point in time to the specified expiration shift point in time.

Note
  • This feature supports shifting the expiration time only at the key level. It does not support shifting the expiration time inside keys in Tair-developed data structures, such as the fields in exHash and the skeys in TS.

  • The point in time cannot be earlier than the specified flashback point in time or later than the time when the restoration task is submitted.

2021-07-06T08:25:57Z

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.