All Products
Search
Document Center

PolarDB:RestoreTable

Last Updated:Jun 17, 2024

Restores PolarDB databases and tables.

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
polardb:RestoreTableWrite
  • dbcluster
    acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The cluster ID.

Note You can call the DescribeDBClusters operation to query the details of all clusters within your account.
pc-bp***************
TableMetastringYes

The JSON string that contains the information of the database and the table that you want to restore. All values of the database and table information are of the string type. Example: [ { "tables":[ { "name":"testtb", "type":"table", "newname":"testtb_restore" } ], "name":"testdb", "type":"db", "newname":"testdb_restore" } ].

Note You can call the DescribeMetaList operation to query the names and details of databases and tables that can be restored and enter their information into the corresponding locations in the preceding example.
[ { "tables":[ { "name":"testtb", "type":"table", "newname":"testtb_restore" } ], "name":"testdb", "type":"db", "newname":"testdb_restore" } ]
BackupIdstringNo

The ID of the backup set.

Note You must specify this parameter if you need to restore a database or a table by using a backup set. You can call the DescribeBackups operation to query the ID of the backup set.
111111
RestoreTimestringNo

The point in time for the restoration. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. The time must be in UTC.

Note
  • You must specify this parameter if you need to restore the database or the table to a point in time.

  • You can restore your cluster to a particular time only over the past seven days.

2020-10-04T01:40:00Z

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0C47508C-9DC8-455B-985E-2F2FA8******

Examples

Sample success responses

JSONformat

{
  "RequestId": "0C47508C-9DC8-455B-985E-2F2FA8******"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidRestoreType.FormatSpecified restore type is not valid.The specified restore type is invalid.
400InvalidRestoreTime.FormatSpecified restore time is not valid.The specified restoration time is invalid.
400InvalidBackupSetID.NotFoundSpecified backup set ID does not exist.The specified backup set ID does not exist.
400IncorrectBackupSetStateCurrent backup set state does not support operations.This operation is not supported while the backup set is in the current state.
400InvalidDBName.DuplicateSpecified DB name already exists in the This instance.The specified DBName parameter already exists in the cluster.
400InvalidParameters.FormatSpecified parameters is not valid.The specified parameters are invalid.
400InsufficientResourceCapacityThere is insufficient capacity available for the requested instance.Insufficient storage capacity for the specified cluster.
400InvalidRestoreType.NotFoundAt least one of BackupId and RestoreTime is malformed.The format of the specified BackupId or RestoreTime parameter is invalid.
400MissingUserIDThe request is missing a user_id parameter.You must specify the UserID parameter in the request.
400MissingUIDThe request is missing a uid parameter.You must specify the UID parameter in the request.
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
404InvalidBackup.NotFoundThe available backup does not exist in recovery time.The specified backup does not exist within the time range for restoration.

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

Change history

Change timeSummary of changesOperation
2023-09-12The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 404 change
    delete Error Codes: 400
    Added Error Codes: 403