ALIYUN::HBR::RestoreJob

更新时间:
复制 MD 格式

ALIYUN::HBR::RestoreJob is used to create a restore job.

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
SnapshotIdStringYesNoThe ID of the snapshot.None
TargetClientIdStringYesNoThe ID of the destination client.This parameter is required if the RestoreType parameter is set to FILE.
TargetPathStringYesNoThe path to which backup data is restored.Example: /.
SourceTypeStringYesNoThe type of the source file.Valid values:
  • FILE: a file stored in an on-premises machine.
  • ECS_FILE: a file stored in an ECS instance.
SourceClientIdStringYesNoThe ID of the source client.This parameter is required if the SourceType parameter is set to FILE.
TargetInstanceIdStringYesNoThe ID of the destination ECS instance.This parameter is required if the RestoreType parameter is set to ECS_FILE.
VaultIdStringYesNoThe backup vault where the source client is deployed.None
SourceInstanceIdStringYesNoThe ID of the source ECS instance.This parameter is required if the SourceType parameter is set to ECS_FILE.
RestoreTypeStringYesNoThe type of the file after restoration.Valid values:
  • FILE: a file stored in an on-premises machine.
  • ECS_FILE: a file stored in an ECS instance.

Response parameters

Fn::GetAtt

  • Status: the status of the restore job.
  • SourceType: the type of the source file.
  • RestoreId: the ID of the restore job.
  • ErrorMessage: the error message for the restore job.
  • RestoreType: the type of the file after restoration.

Examples

JSON format

{
  "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 format

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