All Products
Search
Document Center

CreateRestoreTask

Last Updated: Mar 27, 2020

Description

You can call this operation to create a DBS restore task.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to CreateRestoreTask.
DestinationEndpointInstanceType String Yes The location of the database. Valid values:
  • rds
  • ecs
  • express: for databases connected to Alibaba Cloud through Express Connect, VPN Gateway, or Smart Access Gateway.
  • agent: for databases connected to Alibaba Cloud through a backup gateway.
  • dds: for ApsaraDB for MongoDB databases.
  • other: for databases connected to Alibaba Cloud through IP addresses and port numbers.
DestinationEndpointRegion String No The region of the database. This parameter is required if the value of the DestinationEndpointInstanceType parameter is rds, ecs, dds, express, or agent.
DestinationEndpointInstanceID String No The ID of the database instance. This parameter is required if the value of the DestinationEndpointInstanceType parameter is rds, ecs, dds, or express.
DestinationEndpointIP String No The connection endpoint of the database. This parameter is required if the value of the DestinationEndpointInstanceType parameter is express, agent, or other.
DestinationEndpointPort Integer No The port number of the database. This parameter is required if the value of the DestinationEndpointInstanceType parameter is express, agent, other, or ecs.
DestinationEndpointDatabaseName String No The name of the database. This parameter is required for PostgreSQL databases, MongoDB databases, and agent-based MSSQL databases.
DestinationEndpointUserName String No The username for logging on to the database. This parameter is required for most databases, except for Redis databases and agent-based MSSQL databases.
DestinationEndpointPassword String No The password for logging on to the database. This parameter is required for most databases, except for Redis databases and agent-based MSSQL databases.
BackupGatewayId Long No The ID of the backup gateway. This parameter is required if the value of the DestinationEndpointInstanceType parameter is agent.
RestoreObjects String No The objects to be restored. For more information, see the description of the RestoreObjects parameter. This parameter is required for most databases, except for agent-based databases.
RestoreTime Long No The time point to which the database will be restored. Example: 1554560477000.
BackupSetId String No The ID of the full backup set to be used in the restore task. This parameter and the RestoreTime parameter are mutually exclusive.
RestoreTaskName String Yes The name of the restore task.
DestinationEndpointOracleSID String No The system ID (SID) of the Oracle database. This parameter is required for Oracle databases.
RestoreDir String No The destination directory to which the database will be restored. This parameter is required for agent-based MySQL databases.
BackupPlanId String Yes The ID of the backup schedule.
DuplicateConflict String No The method of dealing with objects with the same names. Valid values:
  • failure: The restore task fails when detecting objects with the same names. This is the default value.
  • renamenew: The restore task renames objects with the same names starting from the second occurrence.

RestoreObjects

The RestoreObjects parameter is defined as a JSON string. Certain regular expressions can be used in the object configuration.

The RestoreObjects parameter is defined as follows:

[
    {
        "DBName":"Name of the database to be restored",
        "NewDBName":"Name of the destination database to which the objects will be restored",
        "SchemaName":"Schema name of the database to be restored",
        "NewSchemaName":"Schema name of the destination database to which the objects will be restored"
    }
]

SchemaName and NewSchemaName are applicable only to SQL Server databases. DBName and NewDBName are used to specify the names of other databases.

NewDBName and NewSchemaName indicate the database name and schema name of the destination database to which the objects will be restored. If the destination database has the same database name and schema name as the source database, you do not need to specify these two parameters.

You can use the following regular expressions to define different object names:

  • A period (.) matches any single character except '\r\n'.
  • An asterisk () matches zero or more occurrences of a subexpression which occurs before. For example, h.llo matches strings such as hllo and heeeello.
  • A question mark (?) matches zero or one occurrence of a subexpression which occurs before. For example, h.?llo matches hllo and hello, but not haello.
  • The [characters] character set matches any character included in the brackets ([ ]). For example, h[aello] matches hallo and hello.
  • The [^characters] negative character set does not match any character included in the brackets ([ ]). For example, h[^ae]llo matches hcllo and hdllo, but not hallo or hello.
  • The [character1-character2] character range matches any character included in the range from character1 to character2, for example, [0-9] and [a-z].

Response parameters

Parameter Type Description
RestoreTaskId String The ID of the restore task.

Error codes

Error code Error message Description
RestoreTaskNotCreate Restore Task not Create. The error message returned because the restore task cannot be created.