RestoreTable - 恢复PolarDB实例的某些数据库或表到原实例

恢复PolarDB库表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

polardb:RestoreTable

update

*dbcluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}

请求参数

名称

类型

必填

描述

示例值

DBClusterId

string

集群 ID。

说明

您可以通过 DescribeDBClusters 接口查询账号下所有集群的信息详情。

pc-bp***************

TableMeta

string

需要还原的目标库表信息的 JSON 串,库表信息的值都是字符串类型。 例如,[ { "tables":[ { "name":"testtb", "type":"table", "newname":"testtb_restore" } ], "name":"testdb", "type":"db", "newname":"testdb_restore" } ]

说明

您可以通过 DescribeMetaList 接口查看支持恢复的库表名称详情,并将支持恢复的库表信息填入上述例子中的对应位置。

[ { "tables":[ { "name":"testtb", "type":"table", "newname":"testtb_restore" } ], "name":"testdb", "type":"db", "newname":"testdb_restore" } ]

BackupId

string

备份集 ID。

说明

若需要按备份集还原目标库表,该参数必传。您可以通过 DescribeBackups 接口查看备份集 ID。

111111

RestoreTime

string

还原时间点,格式为 YYYY-MM-DDThh:mmZ(UTC 时间)。

说明
  • 若需要按时间点还原,该参数必填。

  • 仅支持恢复到 7 天内的任意时间点。

2020-10-04T01:40:00Z

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

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

示例

正常返回示例

JSON格式

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

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidRestoreType.Format Specified restore type is not valid. 操作失败,指定的还原类型无效。
400 InvalidRestoreTime.Format Specified restore time is not valid. 操作失败,指定的恢复时间无效。
400 InvalidBackupSetID.NotFound Specified backup set ID does not exist.
400 IncorrectBackupSetState Current backup set state does not support operations.
400 InvalidDBName.Duplicate Specified DB name already exists in the This instance. 操作失败,此实例中已存在指定的数据库名称。
400 InvalidParameters.Format Specified parameters is not valid. 指定的参数无效。
400 InsufficientResourceCapacity There is insufficient capacity available for the requested instance. 操作失败,请求的实例没有足够的可用容量。
400 InvalidRestoreType.NotFound At least one of BackupId and RestoreTime is malformed. BackupIdRestoreTime中至少有一个格式不正
400 MissingUserID The request is missing a user_id parameter. 请求缺少user_id参数
400 MissingUID The request is missing a uid parameter. 请求缺少uid参数
403 OperationDenied.ArchiveRestore Archive instance does not support restore table. 历史库不支持库表恢复
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. 当前的记录中不存在提供的DBClusterId。
404 InvalidBackup.NotFound The available backup does not exist in recovery time. 操作失败,可用备份在恢复时间内不存在。
404 InvalidDBClusterId.NotFound The DBInstanceId provided does not exist in our records. 当前的记录中不存在提供的DBClusterId。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情