ALIYUN::HBR::RestoreJob類型用于創建恢復任務。

語法

{
  "Type": "ALIYUN::HBR::RestoreJob",
  "Properties": {
    "SnapshotId": String,
    "TargetClientId": String,
    "TargetPath": String,
    "SourceType": String,
    "SourceClientId": String,
    "TargetInstanceId": String,
    "VaultId": String,
    "SourceInstanceId": String,
    "RestoreType": String
  }
}

屬性

屬性名稱 類型 必須 允許更新 描述 約束
SnapshotId String 快照ID。
TargetClientId String 目標客戶端ID。 當RestoreType取值為FILE時該參數必須指定。
TargetPath String 恢復路徑,將備份數據恢復到指定目錄。 示例值:/
SourceType String 源文件類型。 取值:
  • FILE:本地文件。
  • ECS_FILE:ECS文件。
SourceClientId String 源客戶端ID。 當SourceType取值為FILE時該參數必須指定。
TargetInstanceId String 目標客戶端ID。 當RestoreType取值為ECS_FILE時該參數必須指定。
VaultId String 待恢復的源客戶端所在的備份庫。
SourceInstanceId String 源實例ID。 當SourceType取值為ECS_FILE時該參數必須指定。
RestoreType String 恢復類型。 取值:
  • FILE:本地文件。
  • ECS_FILE:ECS文件。

返回值

Fn::GetAtt

  • Status:恢復任務狀態。
  • SourceType:源文件類型。
  • RestoreId:恢復任務ID。
  • ErrorMessage:恢復任務錯誤信息。
  • RestoreType:恢復類型。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SnapshotId": {
      "Type": "String",
      "Description": "Snapshot ID"
    },
    "TargetClientId": {
      "Type": "String",
      "Description": "Target client ID. It should be provided when RestoreType=FILE."
    },
    "TargetPath": {
      "Type": "String",
      "Description": "Target path. For instance, \"/\"."
    },
    "SourceType": {
      "Type": "String",
      "Description": "Source type",
      "AllowedValues": [
        "FILE",
        "ECS_FILE"
      ]
    },
    "SourceClientId": {
      "Type": "String",
      "Description": "Source client ID. It should be provided when SourceType=FILE."
    },
    "TargetInstanceId": {
      "Type": "String",
      "Description": "Source client ID. It should be provided when RestoreType=ECS_FILE."
    },
    "VaultId": {
      "Type": "String",
      "Description": "Vault ID"
    },
    "SourceInstanceId": {
      "Type": "String",
      "Description": "Source instance ID. It should be provided when SourceType=ECS_FILE."
    },
    "RestoreType": {
      "Type": "String",
      "Description": "Restore type",
      "AllowedValues": [
        "FILE",
        "ECS_FILE"
      ]
    }
  },
  "Resources": {
    "RestoreJob": {
      "Type": "ALIYUN::HBR::RestoreJob",
      "Properties": {
        "SnapshotId": {
          "Ref": "SnapshotId"
        },
        "TargetClientId": {
          "Ref": "TargetClientId"
        },
        "TargetPath": {
          "Ref": "TargetPath"
        },
        "SourceType": {
          "Ref": "SourceType"
        },
        "SourceClientId": {
          "Ref": "SourceClientId"
        },
        "TargetInstanceId": {
          "Ref": "TargetInstanceId"
        },
        "VaultId": {
          "Ref": "VaultId"
        },
        "SourceInstanceId": {
          "Ref": "SourceInstanceId"
        },
        "RestoreType": {
          "Ref": "RestoreType"
        }
      }
    }
  },
  "Outputs": {
    "Status": {
      "Description": "Restore job status",
      "Value": {
        "Fn::GetAtt": [
          "RestoreJob",
          "Status"
        ]
      }
    },
    "SourceType": {
      "Description": "Source type",
      "Value": {
        "Fn::GetAtt": [
          "RestoreJob",
          "SourceType"
        ]
      }
    },
    "RestoreId": {
      "Description": "Restore job ID",
      "Value": {
        "Fn::GetAtt": [
          "RestoreJob",
          "RestoreId"
        ]
      }
    },
    "ErrorMessage": {
      "Description": "Error message of restore job",
      "Value": {
        "Fn::GetAtt": [
          "RestoreJob",
          "ErrorMessage"
        ]
      }
    },
    "RestoreType": {
      "Description": "Restore type",
      "Value": {
        "Fn::GetAtt": [
          "RestoreJob",
          "RestoreType"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SnapshotId:
    Type: String
    Description: Snapshot ID
  TargetClientId:
    Type: String
    Description: Target client ID. It should be provided when RestoreType=FILE.
  TargetPath:
    Type: String
    Description: 'Target path. For instance, "/".'
  SourceType:
    Type: String
    Description: Source type
    AllowedValues:
      - FILE
      - ECS_FILE
  SourceClientId:
    Type: String
    Description: Source client ID. It should be provided when SourceType=FILE.
  TargetInstanceId:
    Type: String
    Description: Source client ID. It should be provided when RestoreType=ECS_FILE.
  VaultId:
    Type: String
    Description: Vault ID
  SourceInstanceId:
    Type: String
    Description: Source instance ID. It should be provided when SourceType=ECS_FILE.
  RestoreType:
    Type: String
    Description: Restore type
    AllowedValues:
      - FILE
      - ECS_FILE
Resources:
  RestoreJob:
    Type: 'ALIYUN::HBR::RestoreJob'
    Properties:
      SnapshotId:
        Ref: SnapshotId
      TargetClientId:
        Ref: TargetClientId
      TargetPath:
        Ref: TargetPath
      SourceType:
        Ref: SourceType
      SourceClientId:
        Ref: SourceClientId
      TargetInstanceId:
        Ref: TargetInstanceId
      VaultId:
        Ref: VaultId
      SourceInstanceId:
        Ref: SourceInstanceId
      RestoreType:
        Ref: RestoreType
Outputs:
  Status:
    Description: Restore job status
    Value:
      'Fn::GetAtt':
        - RestoreJob
        - Status
  SourceType:
    Description: Source type
    Value:
      'Fn::GetAtt':
        - RestoreJob
        - SourceType
  RestoreId:
    Description: Restore job ID
    Value:
      'Fn::GetAtt':
        - RestoreJob
        - RestoreId
  ErrorMessage:
    Description: Error message of restore job
    Value:
      'Fn::GetAtt':
        - RestoreJob
        - ErrorMessage
  RestoreType:
    Description: Restore type
    Value:
      'Fn::GetAtt':
        - RestoreJob
        - RestoreType