You can call the CheckCreateDdrDBInstance operation to check whether the data of a source ApsaraDB RDS instance can be restored to a destination ApsaraDB RDS instance by using a cross-region data backup file.

Before you call this operation, make sure that the source instance runs one of the following database engines:

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CheckCreateDdrDBInstance

The operation that you want to perform. Set the value to CheckCreateDdrDBInstance.

DBInstanceClass String Yes rds.mysql.s1.small

The type of the destination instance. For more information, see Primary instance types.

DBInstanceStorage Integer Yes 20

The storage capacity of the destination instance. Valid values: 5 to 2000. Unit: GB.

The storage capacity increases at increments of 5 GB. For more information, see Primary instance types.

Engine String Yes MySQL

The database engine that is run on the destination instance. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
EngineVersion String Yes 5.6

The version of the database engine that is run on the destination the instance. The value of this parameter varies based on the value of the Engine parameter. Valid values:

  • MySQL: 5.5, 5.6, 5.7, and 8.0
  • SQL Server: 2008r2, 08r2_ent_ha, 2012, 2012_ent_ha, 2012_std_ha, 2012_web, 2014_std_ha, 2016_ent_ha, 2016_std_ha, 2016_web, 2017_std_ha, 2017_ent, 2019_std_ha, and 2019_ent
  • PostgreSQL: 9.4, 10.0, 11.0, 12.0, and 13.0
RegionId String Yes cn-hangzhou

The region ID of the destination instance. You can call the DescribeRegions operation to query the most recent region list of region IDs.

RestoreType String Yes 0

The restoration method that you want to use. Valid values:

  • 0: restores data from a data backup file. If you select this value, you must also specify the BackupSetId parameter.
  • 1: restores data to a point in time. If you select this value, you must also specify the RestoreTime, SourceRegion and SourceDBInstanceName parameters.

Default value: 0.

BackupSetId String No 14358

The ID of the data backup file that is used for the restoration. You can call the DescribeCrossRegionBackups operation to query backup set IDs.

Note If you set the RestoreType parameter to 0, you must also specify this parameter.
RestoreTime String No 2019-05-30T03:29:10Z

The point in time to which you want to restore data. The point in time that you specify must be earlier than the current time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note If you set the RestoreType parameter to 1, you must also specify this parameter.
SourceRegion String No cn-hangzhou

The region ID of the source instance if you want to restore data to a point in time.

Note If you set the RestoreType parameter to 1, you must also specify this parameter.
SourceDBInstanceName String No rm-uf6wjk5xxxxxxx

The ID of the source instance if you want to restore data to a point in time.

Note If you set the RestoreType parameter to 1, you must also specify this parameter.

Response parameters

Parameter Type Example Description
IsValid String true

Indicates whether the data of the source instance can be restored across regions. Valid values: true and false

RequestId String 1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=CheckCreateDdrDBInstance
&RegionId=cn-hangzhou
&Engine=MySQL
&DBInstanceClass=rds.mysql.s1.small
&DBInstanceStorage=20
&EngineVersion=5.6
&RestoreType=0
&BackupSetId=14358
&<Common request parameters>

Sample success responses

XML format

<CheckCreateDdrDBInstanceResponse>
    <IsValid>true</IsValid>
    <RequestId>346C62D7-8BB9-4516-93E7-25A469EAABCB</RequestId>
</CheckCreateDdrDBInstanceResponse>

JSON format

{
	"IsValid": "true",
	"RequestId": "346C62D7-8BB9-4516-93E7-25A469EAABCB"
}

Error codes

HTTP status code Error code Error message Description
400 IncorrectDBInstanceType Current DB instance engine and type does not support operations. The error message returned because the operation is not supported for the specified database engine and instance type.
400 InvalidRestoreType.Format Specified restore type is not valid. The error message returned because an invalid value is specified for the RestoreType parameter.
400 IncorrectBackupSetMethod Current backup set method does not support operations. The error message returned because the specified data backup file cannot be used to restore individual databases and tables.
400 InvalidBackupType.Format Specified backup type is not valid. The error message returned because the specified backup type is invalid.

For a list of error codes, visit the API Error Center.