调用RestoreTable恢复PolarDB库表。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String RestoreTable

系统规定参数。取值:RestoreTable

RegionId String cn-hangzhou

地域ID。

DBClusterId String pc-bp***************

集群ID。

说明 您可以通过DescribeDBClusters接口查询账号下所有集群的信息详情。
TableMeta String [ { "tables":[ { "name":"testtb", "type":"table", "newname":"testtb_restore" } ], "name":"testdb", "type":"db", "newname":"testdb_restore" } ]

需要还原的目标库表信息的JSON串,库表信息的值都是字符串类型。

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

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

备份集ID。

说明 若需要按备份集还原目标库表,该参数必传。您可以通过DescribeBackups接口查看备份集ID。
RestoreTime String 2020-10-04T01:40:00Z

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

说明
  • 若需要按时间点还原,该参数必填。
  • 仅支持恢复到7天内的任意时间点。

返回数据

名称 类型 示例值 描述
RequestId String 0C47508C-9DC8-455B-985E-2F2FA8******

请求ID。

示例

请求示例

http(s)://polardb.aliyuncs.com/?Action=RestoreTable
&DBClusterId=pc-bp***************
&TableMeta=[ { "tables":[ { "name":"testtb", "type":"table", "newname":"testtb_restore" } ], "name":"testdb", "type":"db", "newname":"testdb_restore" } ]
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<RestoreTableResponse>  
	  <RequestId>0C47508C-9DC8-455B-985E-2F2FA8******</RequestId>
</RestoreTableResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

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

错误码

HttpCode 错误码 错误信息 描述
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. 操作失败,指定的备份集ID不存在。
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. BackupId和RestoreTime中至少有一个格式不正
400 MissingUserID The request is missing a user_id parameter. 请求缺少user_id参数
400 MissingUID The request is missing a uid parameter. 请求缺少uid参数
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. 操作失败,可用备份在恢复时间内不存在。

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