All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DBS::RestoreTask

Last Updated:Mar 19, 2025

ALIYUN::DBS::RestoreTask is used to create a restoration task of Data Disaster Recovery.

Syntax

{
  "Type": "ALIYUN::DBS::RestoreTask",
  "Properties": {
    "StartTask": Boolean,
    "RestoreDir": String,
    "DuplicateConflict": String,
    "RestoreHome": String,
    "DestinationEndpointPassword": String,
    "DestinationEndpointIP": String,
    "DestinationEndpointPort": Integer,
    "DestinationEndpointOracleSID": String,
    "BackupSetId": String,
    "DestinationEndpointInstanceType": String,
    "RestoreTime": Integer,
    "DestinationEndpointRegion": String,
    "DestinationEndpointDatabaseName": String,
    "DestinationEndpointUserName": String,
    "RestoreObjects": String,
    "RestoreTaskName": String,
    "BackupPlanId": String,
    "BackupGatewayId": Integer,
    "DestinationEndpointInstanceID": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

StartTask

Boolean

No

No

Specifies whether to start the restoration task.

Valid values:

  • true

  • false

DuplicateConflict

String

No

No

The method that is used to handle the restoration task when the object in the restoration task has the same name as an existing object.

Valid values:

  • failure (default): considers the restoration task failed.

  • renamenew: renames the object in the restoration task.

RestoreHome

String

No

No

The program directory of the database.

None.

DestinationEndpointPassword

String

No

No

The password.

This property must be specified except for SQL Server databases that are connected by using backup gateways or Redis databases.

DestinationEndpointIP

String

No

No

The endpoint of the database.

This property must be specified when DestinationEndpointInstanceType is set to Express, Agent, or Other.

DestinationEndpointPort

Integer

No

No

The port of the database.

This property must be specified when DestinationEndpointInstanceType is set to Express, Agent, Other, or ECS.

DestinationEndpointOracleSID

String

No

No

The system ID (SID) of the Oracle database.

This property must be specified for Oracle databases.

BackupSetId

String

No

No

The ID of the full backup set that is used for restoration.

You cannot specify both BackupSetId and RestoreTime.

DestinationEndpointInstanceType

String

Yes

No

The category of the database.

Valid values:

  • RDS: The database is an ApsaraDB RDS database.

  • ECS: The database is a self-managed database deployed on an Elastic Compute Service (ECS) instance.

  • Express: The database is connected by using Express Connect, VPN Gateway, or Smart Access Gateway (SAG).

  • Agent: The database is connected by using a backup gateway.

  • DDS: The database is an ApsaraDB for MongoDB database.

  • Other: The database is connected by using the IP address and port of the database.

RestoreTime

Integer

No

No

The point in time to which you want to restore data.

The value of this property must be a timestamp.

DestinationEndpointRegion

String

No

No

The region of the database.

This property must be specified when DestinationEndpointInstanceType is set to RDS, ECS, DDS, Express, or Agent.

DestinationEndpointDatabaseName

String

No

No

The name of the database.

This property must be specified for PostgreSQL or MongoDB databases.

DestinationEndpointUserName

String

No

No

The username of the account that is used to connect to the database.

This property must be specified except for SQL Server databases that are connected by using backup gateways or Redis databases.

RestoreObjects

String

No

No

The objects that you want to restore by using the restoration task.

This property must be specified except for databases that are connected by using backup gateways.

The value of this property must be in the following format: [ { "DBName":"Source database name", "NewDBName":"Destination database name", "SchemaName":"Source schema name", "NewSchemaName":"Destination schema name"}].

RestoreTaskName

String

Yes

No

The name of the restoration task.

None.

BackupPlanId

String

Yes

No

The ID of the backup schedule.

None.

BackupGatewayId

Integer

No

No

The ID of the backup gateway.

This property must be specified when DestinationEndpointInstanceType is set to Agent.

DestinationEndpointInstanceID

String

No

No

The ID of the database.

This property must be specified when DestinationEndpointInstanceType is set to RDS, ECS, DDS, or Express.

RestoreDir

String

No

No

The directory that is used for restoration.

This property must be specified when DestinationEndpointInstanceType is set to Agent and the backup object of the backup schedule is a MySQL database.

Return values

Fn::GetAtt

RestoreTaskId: the ID of the restoration task.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "StartTask": {
      "Type": "Boolean",
      "Description": "Just create a recovery task and not perform the recovery task temporarily. Do not start restore task.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ],
      "Default": true
    },
    "RestoreDir": {
      "Type": "String",
      "Description": "DestinationEndpointInstanceType this parameter is required when agent is specified and the backup schedule is MySQL."
    },
    "DuplicateConflict": {
      "Type": "String",
      "Description": "The handling method for conflicts between objects with the same name. Valid values:\nfailure: The object with the same name fails (default).\nrenamenew: renames an object with the same name.",
      "AllowedValues": [
        "failure",
        "renamenew"
      ]
    },
    "RestoreHome": {
      "Type": "String",
      "Description": "Database Program Directory."
    },
    "DestinationEndpointPassword": {
      "Type": "String",
      "Description": "The password that is used to log on to the RDS instance.\nNote You must specify this parameter when the database type is Redis, or the database location\nis agent and the database type is MSSQL."
    },
    "DestinationEndpointIP": {
      "Type": "String",
      "Description": "The endpoint used to connect to the database.\nNoteDestinationEndpointInstanceType is express, agent, or other. This parameter is required."
    },
    "DestinationEndpointPort": {
      "Type": "Number",
      "Description": "The port that is used to access the database of the primary MySQL server.\nNoteDestinationEndpointInstanceType is in the format of express, agent, other, or ECS. This parameter is required."
    },
    "DestinationEndpointOracleSID": {
      "Type": "String",
      "Description": "The SID of the Oracle instance.\nNote This parameter is required if the database type is Oracle."
    },
    "BackupSetId": {
      "Type": "String",
      "Description": "The ID of the full backup set used for restoration, which is mutually exclusive to\nRestoreTime."
    },
    "DestinationEndpointInstanceType": {
      "Type": "String",
      "Description": "The location of the database. Valid values: \n- rds \n- ecs \n- express: a database connected over express connect, VPN Gateway, or smart gateway. \n- agent: The database connected through the backup Gateway \n- dds: apsaradb for MongoDB \n- kvstore \n- polardb \n- drds \n- dg: the database is directly connected through IP Address: Port."
    },
    "RestoreTime": {
      "Type": "Number",
      "Description": "The time when the fault is restored. Set the value to 1554560477000."
    },
    "DestinationEndpointRegion": {
      "Type": "String",
      "Description": "The region of the database.\nNoteDestinationEndpointInstanceType for RDS, ECS, DDS, Express, or Agent, this parameter is required."
    },
    "DestinationEndpointDatabaseName": {
      "Type": "String",
      "Description": "The name of the RDS database.\nNote When the database type is PostgreSQL or MongoDB, this parameter is required."
    },
    "DestinationEndpointUserName": {
      "Type": "String",
      "Description": "The database account.\nNote You must specify this parameter when the database type is Redis, or the database location\nis agent and the database type is MSSQL."
    },
    "RestoreObjects": {
      "Type": "String",
      "Description": "Restore an object.\nNote For details, see the following RestoreObjects if the database is located in an agent, this parameter is required in other scenarios."
    },
    "RestoreTaskName": {
      "Type": "String",
      "Description": "The name of the restoration task."
    },
    "BackupPlanId": {
      "Type": "String",
      "Description": "The ID of the backup plan."
    },
    "BackupGatewayId": {
      "Type": "Number",
      "Description": "The ID of the backup gateway.\nNoteDestinationEndpointInstanceType if you set this parameter to agent, this parameter is required."
    },
    "DestinationEndpointInstanceID": {
      "Type": "String",
      "Description": "The ID of the ApsaraDB RDS instance to query.\nNoteDestinationEndpointInstanceType if the value is RDS, ECS, DDS, or Express, this parameter is required."
    }
  },
  "Resources": {
    "RestoreTask": {
      "Type": "ALIYUN::DBS::RestoreTask",
      "Properties": {
        "StartTask": {
          "Ref": "StartTask"
        },
        "RestoreDir": {
          "Ref": "RestoreDir"
        },
        "DuplicateConflict": {
          "Ref": "DuplicateConflict"
        },
        "RestoreHome": {
          "Ref": "RestoreHome"
        },
        "DestinationEndpointPassword": {
          "Ref": "DestinationEndpointPassword"
        },
        "DestinationEndpointIP": {
          "Ref": "DestinationEndpointIP"
        },
        "DestinationEndpointPort": {
          "Ref": "DestinationEndpointPort"
        },
        "DestinationEndpointOracleSID": {
          "Ref": "DestinationEndpointOracleSID"
        },
        "BackupSetId": {
          "Ref": "BackupSetId"
        },
        "DestinationEndpointInstanceType": {
          "Ref": "DestinationEndpointInstanceType"
        },
        "RestoreTime": {
          "Ref": "RestoreTime"
        },
        "DestinationEndpointRegion": {
          "Ref": "DestinationEndpointRegion"
        },
        "DestinationEndpointDatabaseName": {
          "Ref": "DestinationEndpointDatabaseName"
        },
        "DestinationEndpointUserName": {
          "Ref": "DestinationEndpointUserName"
        },
        "RestoreObjects": {
          "Ref": "RestoreObjects"
        },
        "RestoreTaskName": {
          "Ref": "RestoreTaskName"
        },
        "BackupPlanId": {
          "Ref": "BackupPlanId"
        },
        "BackupGatewayId": {
          "Ref": "BackupGatewayId"
        },
        "DestinationEndpointInstanceID": {
          "Ref": "DestinationEndpointInstanceID"
        }
      }
    }
  },
  "Outputs": {
    "RestoreTaskId": {
      "Description": "The ID of the restoration task.",
      "Value": {
        "Fn::GetAtt": [
          "RestoreTask",
          "RestoreTaskId"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
 StartTask:
  Type: Boolean
  Description: >-
   Just create a recovery task and not perform the recovery task temporarily.
   Do not start restore task.
  AllowedValues:
   - 'True'
   - 'true'
   - 'False'
   - 'false'
  Default: true
 RestoreDir:
  Type: String
  Description: >-
   DestinationEndpointInstanceType this parameter is required when agent is
   specified and the backup schedule is MySQL.
 DuplicateConflict:
  Type: String
  Description: >-
   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.
  AllowedValues:
   - failure
   - renamenew
 RestoreHome:
  Type: String
  Description: Database Program Directory.
 DestinationEndpointPassword:
  Type: String
  Description: >-
   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.
 DestinationEndpointIP:
  Type: String
  Description: >-
   The endpoint used to connect to the database.

   NoteDestinationEndpointInstanceType is express, agent, or other. This
   parameter is required.
 DestinationEndpointPort:
  Type: Number
  Description: >-
   The port that is used to access the database of the primary MySQL server.

   NoteDestinationEndpointInstanceType is in the format of express, agent,
   other, or ECS. This parameter is required.
 DestinationEndpointOracleSID:
  Type: String
  Description: |-
   The SID of the Oracle instance.
   Note This parameter is required if the database type is Oracle.
 BackupSetId:
  Type: String
  Description: >-
   The ID of the full backup set used for restoration, which is mutually
   exclusive to

   RestoreTime.
 DestinationEndpointInstanceType:
  Type: String
  Description: >-
   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

   - kvstore

   - polardb

   - drds

   - dg: the database is directly connected through IP Address: Port.
 RestoreTime:
  Type: Number
  Description: The time when the fault is restored. Set the value to 1554560477000.
 DestinationEndpointRegion:
  Type: String
  Description: >-
   The region of the database.

   NoteDestinationEndpointInstanceType for RDS, ECS, DDS, Express, or Agent,
   this parameter is required.
 DestinationEndpointDatabaseName:
  Type: String
  Description: >-
   The name of the RDS database.

   Note When the database type is PostgreSQL or MongoDB, this parameter is
   required.
 DestinationEndpointUserName:
  Type: String
  Description: >-
   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.
 RestoreObjects:
  Type: String
  Description: >-
   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.
 RestoreTaskName:
  Type: String
  Description: The name of the restoration task.
 BackupPlanId:
  Type: String
  Description: The ID of the backup plan.
 BackupGatewayId:
  Type: Number
  Description: >-
   The ID of the backup gateway.

   NoteDestinationEndpointInstanceType if you set this parameter to agent,
   this parameter is required.
 DestinationEndpointInstanceID:
  Type: String
  Description: >-
   The ID of the ApsaraDB RDS instance to query.

   NoteDestinationEndpointInstanceType if the value is RDS, ECS, DDS, or
   Express, this parameter is required.
Resources:
 RestoreTask:
  Type: 'ALIYUN::DBS::RestoreTask'
  Properties:
   StartTask:
    Ref: StartTask
   RestoreDir:
    Ref: RestoreDir
   DuplicateConflict:
    Ref: DuplicateConflict
   RestoreHome:
    Ref: RestoreHome
   DestinationEndpointPassword:
    Ref: DestinationEndpointPassword
   DestinationEndpointIP:
    Ref: DestinationEndpointIP
   DestinationEndpointPort:
    Ref: DestinationEndpointPort
   DestinationEndpointOracleSID:
    Ref: DestinationEndpointOracleSID
   BackupSetId:
    Ref: BackupSetId
   DestinationEndpointInstanceType:
    Ref: DestinationEndpointInstanceType
   RestoreTime:
    Ref: RestoreTime
   DestinationEndpointRegion:
    Ref: DestinationEndpointRegion
   DestinationEndpointDatabaseName:
    Ref: DestinationEndpointDatabaseName
   DestinationEndpointUserName:
    Ref: DestinationEndpointUserName
   RestoreObjects:
    Ref: RestoreObjects
   RestoreTaskName:
    Ref: RestoreTaskName
   BackupPlanId:
    Ref: BackupPlanId
   BackupGatewayId:
    Ref: BackupGatewayId
   DestinationEndpointInstanceID:
    Ref: DestinationEndpointInstanceID
Outputs:
 RestoreTaskId:
  Description: The ID of the restoration task.
  Value:
   'Fn::GetAtt':
    - RestoreTask
    - RestoreTaskId