RestoreInstance

更新时间:
复制 MD 格式

Restores data from a specified backup file to a Tair (Redis-compatible) instance.

Operation description

  • For Tair memory-enhanced enterprise edition instances that use the classic architecture, you can restore specified keys to a point in time with precision to the second for granular data recovery.

  • For all other instance types, use 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 ID of the instance.

r-bp1zxszhcgatnx****

BackupId

string

No

The ID of the backup file. You can find backup file IDs by calling the DescribeBackups operation.

78241****

RestoreType

string

No

The restore method. Valid values:

  • 0 (default): This value is deprecated.

  • 1: Restores data to a specific point in time. You can set this parameter to 1 only if the Data Flashback feature is enabled for the instance. If you set this parameter to 1, you must also specify the RestoreTime parameter.

1

RestoreTime

string

No

The restore point in time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

Note

This point in time cannot be earlier than the time when the Data Flashback feature was enabled.

2021-07-06T07:25:57Z

FilterKey

string

No

The keys to restore, which can be specified as a regular expression. To specify multiple keys, separate them 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 available only for instances that use the classic architecture.

Note

In a regular expression, the asterisk (*) matches the preceding element zero or more times. For example, if you set this parameter to h.*llo, strings such as hllo and heeeello are matched.

key:00000007198*

TimeShift

string

No

For instances that use the classic architecture, you can apply an offset to the expiration time of restored keys. This applies whether you restore the entire instance or only specific keys. The system calculates a key's remaining time-to-live (TTL) at the specified flashback point in time and then adds this TTL to the TimeShift value to set the key's new expiration time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC).

Note
  • This feature adjusts the expiration time for top-level keys only. It does not apply to the expiration times of elements within Tair-specific data structures, such as fields in an exHash or secondary keys (Skeys) in a Time Series (TS) data structure.

  • The specified time must be later than RestoreTime and earlier than the task submission time.

2021-07-06T08:25:57Z

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error response

JSON format

{
"RequestId" : "AFA391BF-808F-4DA6-80A2-A382108A0945"
}

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.