ALIYUN::DBS::RestoreTask類型用於建立資料災備DDR(Data Disaster Recovery)恢複任務。
文法
{
"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
}
}屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
StartTask | Boolean | 否 | 否 | 是否啟動恢複任務。 | 取值:
|
DuplicateConflict | String | 否 | 否 | 同名對象衝突處理方式。 | 取值:
|
RestoreHome | String | 否 | 否 | 資料庫程式目錄。 | 無 |
DestinationEndpointPassword | String | 否 | 否 | 密碼。 | 資料庫類型為Redis,或者資料庫所在位置為Agent且資料庫類型為MSSQL時該參數非必須,否則必須指定該參數。 |
DestinationEndpointIP | String | 否 | 否 | 資料庫連接地址。 | DestinationEndpointInstanceType取值為Express、Agent或Other時,該參數必須指定。 |
DestinationEndpointPort | Integer | 否 | 否 | 資料庫連接埠。 | DestinationEndpointInstanceType取值為Express、Agent、Other或ECS時,該參數必須指定。 |
DestinationEndpointOracleSID | String | 否 | 否 | Oracle SID名稱。 | 資料庫類型為Oracle時,該參數必須指定。 |
BackupSetId | String | 否 | 否 | 恢複所使用的全量備份組ID。 | 不能與RestoreTime同時指定。 |
DestinationEndpointInstanceType | String | 是 | 否 | 資料庫所在位置。 | 取值:
|
RestoreTime | Integer | 否 | 否 | 恢復點。 | 時間戳記格式。 |
DestinationEndpointRegion | String | 否 | 否 | 資料庫地區。 | DestinationEndpointInstanceType為RDS、ECS、DDS、Express或Agent時,該參數必須指定。 |
DestinationEndpointDatabaseName | String | 否 | 否 | 資料庫名稱。 | 資料庫類型為PostgreSQL或MongoDB時,該參數必須指定。 |
DestinationEndpointUserName | String | 否 | 否 | 資料庫帳號。 | 資料庫類型為Redis,或者資料庫所在位置為Agent且資料庫類型為MSSQL時該參數非必須,否則必須指定該參數。 |
RestoreObjects | String | 否 | 否 | 恢複對象。 | 當資料庫所在位置為Agent時,該參數非必須,否則必須指定該參數。 格式: |
RestoreTaskName | String | 是 | 否 | 恢複任務名稱。 | 無 |
BackupPlanId | String | 是 | 否 | 備份計劃ID。 | 無 |
BackupGatewayId | Integer | 否 | 否 | 備份網關ID。 | DestinationEndpointInstanceType取值為Agent時,該參數須指定。 |
DestinationEndpointInstanceID | String | 否 | 否 | 資料庫執行個體ID。 | DestinationEndpointInstanceType取值為RDS、ECS、DDS或Express時,該參數必須指定。 |
RestoreDir | String | 否 | 否 | 恢複目錄。 | DestinationEndpointInstanceType取值為Agent且備份計劃為MySQL時,該參數必須指定。 |
傳回值
Fn::GetAtt
RestoreTaskId:恢複任務ID。
樣本
JSON格式
{
"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格式
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