Call CreateRestoreTask to create a DBS restoration task.

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 CreateRestoreTask

The operation that you want to perform. Valid values: CreateRestoreTask.

BackupPlanId String Yes dbs1hvb0wwXXXX

The ID of the backup plan.

DestinationEndpointInstanceType String Yes rds

The location of the database. Valid values:

  • RDS
  • ECS
  • Express: a database connected over express connect, VPN Gateway, or smart gateway.
  • Agent: The database connected through the backup Gateway
  • DDS: apsaradb for MongoDB
  • Other: the database is directly connected through IP Address: Port.
RestoreTaskName String Yes test

The name of the restoration task.

DestinationEndpointRegion String No 100.X.X.10:33204

The region of the database.

Note DestinationEndpointInstanceType for RDS, ECS, DDS, Express, or Agent, this parameter is required.
DestinationEndpointInstanceID String No rm-bp1p8c29XXXXX

The ID of the ApsaraDB RDS instance to query.

Note DestinationEndpointInstanceType if the value is RDS, ECS, DDS, or Express, this parameter is required.
DestinationEndpointIP String No rm-bpXXXXX9jv8pxero.mysql.rds.aliyuncs.com

The endpoint used to connect to the database.

Note DestinationEndpointInstanceType is express, agent, or other. This parameter is required.
DestinationEndpointPort Integer Optional 3306

The port that is used to access the database of the primary MySQL server.

Note DestinationEndpointInstanceType is in the format of express, agent, other, or ECS. This parameter is required.
DestinationEndpointDatabaseName String No test

The name of the RDS database.

Note When the database type is PostgreSQL or MongoDB, this parameter is required.
DestinationEndpointUserName String No test

The database account.

Note You must specify this parameter when the database type is Redis, or the database location is agent and the database type is MSSQL.
DestinationEndpointPassword String No Test

The password that is used to log on to the RDS instance.

Note You must specify this parameter when the database type is Redis, or the database location is agent and the database type is MSSQL.
BackupGatewayId Long No 43123424

The ID of the backup gateway.

Note DestinationEndpointInstanceType if you set this parameter to agent, this parameter is required.
RestoreObjects String No [ { "DBName":"The name of the source database to be restored", "NewDBName":"The name of the destination database to be restored", "SchemaName":"The name of the Schema to be restored", "NewSchemaName":"The name of the destination Schema to be restored"}]

Restore an object.

Note For details, see the following RestoreObjects if the database is located in an agent, this parameter is required in other scenarios.
RestoreTime Long No 1554560477000

The time when the fault is restored. Set the value to 1554560477000.

BackupSetId String No dbs1hvb0wXXXXX

The ID of the full backup set used for restoration, which is mutually exclusive to RestoreTime.

DestinationEndpointOracleSID String No test

The SID of the Oracle instance.

Note This parameter is required if the database type is Oracle.
RestoreDir String No test

DestinationEndpointInstanceType this parameter is required when agent is specified and the backup schedule is MySQL.

RestoreHome String No test

Database Program Directory.

DuplicateConflict String No failure

The handling method for conflicts between objects with the same name. Valid values:

  • failure: The object with the same name fails (default).
  • renamenew: renames an object with the same name.
RegionId String No cn-hangzhou

The region ID of the instance. Call DescribeRegions to view the regions supported by DBS.

ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxx

The client token that is used to ensure the idempotency of the request.

Response parameters

Parameter Type Example Description
ErrCode String Param.NotFound

The error code.

ErrMessage String The specified parameter %s value is not valid.

The error message.

HttpStatusCode Integer 200

The HTTP status code.

RequestId String 60AF7C5D-EF4D-4D48-8FD5-C0823FDF28AC

The ID of the request.

RestoreTaskId String s102hXXXXX

The ID of the restoration task.

Success Boolean true

Indicates whether the request succeeded.

Examples

Sample requests

http(s)://dbs-api.cn-hangzhou.aliyuncs.com/? Action=CreateRestoreTask
&BackupPlanId=dbs1hvb0wwXXXX
&DestinationEndpointInstanceType=rds
&RestoreTaskName=test
&<Common request parameters>

Sample success responses

XML format

<CreateRestoreTaskResponse>
  <RestoreTaskId>s102hXXXXX</RestoreTaskId>
  <RequestId>60AF7C5D-EF4D-4D48-8FD5-C0823FDF28AC</RequestId>
  <HttpStatusCode>200</HttpStatusCode>
  <Success>true</Success>
</CreateRestoreTaskResponse>

JSON format

{
    "RestoreTaskId": "s102hXXXXX",
    "RequestId": "60AF7C5D-EF4D-4D48-8FD5-C0823FDF28AC",
    "HttpStatusCode": 200,
    "Success": true
}

Error codes

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