All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DBS::Download

Last Updated:Aug 12, 2024

ALIYUN::DBS::Download is used to create an advanced download task.

Syntax

{
  "Type": "ALIYUN::DBS::Download",
  "Properties": {
    "BakSetId": String,
    "InstanceName": String,
    "DownloadPointInTime": String,
    "BakSetType": String,
    "BakSetSize": String,
    "TargetPath": String,
    "TargetType": String,
    "TargetOssRegion": String,
    "DeleteBackupSetInOss": Boolean,
    "TargetBucket": String,
    "FormatType": String,
    "DownloadAddressDuration": Integer
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

BakSetId

String

No

No

The ID of the full backup set.

You can call the DescribeBackups operation to query the ID of the full backup set. For more information about the operation, see Query the data backup files.

Note

This property must be specified when BakSetType is set to full.

InstanceName

String

Yes

No

The instance ID.

None.

DownloadPointInTime

String

No

No

The point in time at which the backup set is downloaded.

Specify a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC. The timestamp is of the Long type. Example: 1661331864000.

Note

This property must be specified when BakSetType is set to pitr.

BakSetType

String

No

No

The type of the download task.

Valid values:

  • full: The task is used to download a full backup set.

  • pitr: The task is used to download a backup set at a specific point in time.

BakSetSize

String

No

No

The size of the full backup set.

You can call the DescribeBackups operation to query the size of the full backup set. For more information about the operation, see Query the data backup files.

TargetPath

String

No

No

The destination path to which the backup set is downloaded.

This property must be specified when TargetType is set to OSS.

TargetType

String

No

No

The type of the destination to which the backup set is downloaded.

Valid values:

  • OSS

  • URL

TargetOssRegion

String

No

No

The region where the Object Storage Service (OSS) bucket resides.

This property must be specified when TargetType is set to OSS.

DeleteBackupSetInOss

Boolean

No

Yes

Specifies whether to delete the backup set from OSS when the stack is deleted.  

Valid values:

  • true

  • false (default)

TargetBucket

String

No

No

The name of the OSS bucket that is used to store the backup set.

This property must be specified when TargetType is set to OSS.

Make sure that your account has the AliyunDBSDefaultRole permission. For more information about how to obtain the permission, see Use RAM for resource authorization. To obtain the permission, you can also follow the operation instructions in the Resource Access Management (RAM) console.

FormatType

String

Yes

No

The destination format to which the downloaded backup set is converted.

Valid values:

  • CSV

  • SQL

  • Parquet

DownloadAddressDuration

Integer

No

No

The validity period of the URL when TargetType is set to URL.

Valid values: 300 to 86400. Unit: seconds.

Default value: 7200.  

Return values

Fn::GetAtt

  • InstanceName: the instance ID.

  • BakSetId: the ID of the backup set.

  • DownloadAddressInfo: the information about the download address.

  • TaskId: the ID of the download task.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      BakSetId:
        Type: String
        Description:
          en: |-
            The ID of the backup set. You can call the DescribeBackups operation to query the ID of the backup set.
            This parameter is required if the BakSetType parameter is set to full.
        Default: 146005****
      InstanceName:
        Type: String
        Description:
          en: The ID of the instance.
        Default: rm-wz994c1t1****
      DownloadPointInTime:
        Type: String
        Description:
          en: |-
            The point in time at which the backup set is downloaded. 
            Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.
            This parameter is required if the BakSetType parameter is set to pitr.
        Default: '1661331864000'
      BakSetType:
        Type: String
        Description:
          en: |-
            The type of the download task. Valid values:
            full: downloads a full backup set
            pitr: downloads a backup set at a specific point in time.
        Default: full
      BakSetSize:
        Type: String
        Description:
          en: |-
            The size of the full backup set. Unit: bytes. 
            You can call the DescribeBackups operation to query the size of the full backup set.
        Default: 216****
      TargetPath:
        Type: String
        Description:
          en: |-
            The destination path to which the backup set is downloaded.
            This parameter is required if the TargetType parameter is set to OSS.
        Default: test_db/path
      TargetType:
        Type: String
        Description:
          en: |-
            The type of the destination to which the backup set is downloaded. 
            Valid values: OSS|URL
        Default: OSS
      TargetOssRegion:
        Type: String
        Description:
          en: |-
            The region in which the OSS bucket resides.
            This parameter is required if the TargetType parameter is set to OSS.
        Default: cn-beijing
      DeleteBackupSetInOss:
        Type: Boolean
        Description:
          en: |-
            Whether to delete the backup set in OSS when deleting the stack.
            Valid values: true|false, default is true.
        Default: true
      TargetBucket:
        Type: String
        Description:
          en: |-
            The name of the OSS bucket that is used to store the backup set.
            This parameter is required if the TargetType parameter is set to OSS.
            Make sure that your account is granted the AliyunDBSDefaultRole permission. 
            For more information, see Use RAM for resource authorization. 
            You can also grant permissions based on the operation instructions in the Resource Access Management (RAM) console.
        Default: test123
      FormatType:
        Type: String
        Description:
          en: |-
            The format to which the downloaded backup set is converted. 
            Valid values: CSV|SQL|Parquet
        Default: CSV
      DownloadAddressDuration:
        Type: Number
        Description:
          en: |-
            When the download target is a URL, set the link validity period. 
            The default URL validity period is 7200 seconds. 
            The effective duration range can be set from 300 seconds to 86400 seconds
        MinValue: 300
        MaxValue: 86400
        Default: 2700
    Resources:
      Download:
        Type: ALIYUN::DBS::Download
        Properties:
          BakSetId:
            Ref: BakSetId
          InstanceName:
            Ref: InstanceName
          DownloadPointInTime:
            Ref: DownloadPointInTime
          BakSetType:
            Ref: BakSetType
          BakSetSize:
            Ref: BakSetSize
          TargetPath:
            Ref: TargetPath
          TargetType:
            Ref: TargetType
          TargetOssRegion:
            Ref: TargetOssRegion
          DeleteBackupSetInOss:
            Ref: DeleteBackupSetInOss
          TargetBucket:
            Ref: TargetBucket
          FormatType:
            Ref: FormatType
          DownloadAddressDuration:
            Ref: DownloadAddressDuration
    Outputs:
      InstanceName:
        Description: The ID of the instance.
        Value:
          Fn::GetAtt:
            - Download
            - InstanceName
      BakSetId:
        Description: The ID of the backup set.
        Value:
          Fn::GetAtt:
            - Download
            - BakSetId
      DownloadAddressInfo:
        Description: The download address information.
        Value:
          Fn::GetAtt:
            - Download
            - DownloadAddressInfo
      TaskId:
        Description: The ID of the download task.
        Value:
          Fn::GetAtt:
            - Download
            - TaskId
    
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "BakSetId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the backup set. You can call the DescribeBackups operation to query the ID of the backup set.\nThis parameter is required if the BakSetType parameter is set to full."
          },
          "Default": "146005****"
        },
        "InstanceName": {
          "Type": "String",
          "Description": {
            "en": "The ID of the instance."
          },
          "Default": "rm-wz994c1t1****"
        },
        "DownloadPointInTime": {
          "Type": "String",
          "Description": {
            "en": "The point in time at which the backup set is downloaded. \nSpecify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.\nThis parameter is required if the BakSetType parameter is set to pitr."
          },
          "Default": "1661331864000"
        },
        "BakSetType": {
          "Type": "String",
          "Description": {
            "en": "The type of the download task. Valid values:\nfull: downloads a full backup set\npitr: downloads a backup set at a specific point in time."
          },
          "Default": "full"
        },
        "BakSetSize": {
          "Type": "String",
          "Description": {
            "en": "The size of the full backup set. Unit: bytes. \nYou can call the DescribeBackups operation to query the size of the full backup set."
          },
          "Default": "216****"
        },
        "TargetPath": {
          "Type": "String",
          "Description": {
            "en": "The destination path to which the backup set is downloaded.\nThis parameter is required if the TargetType parameter is set to OSS."
          },
          "Default": "test_db/path"
        },
        "TargetType": {
          "Type": "String",
          "Description": {
            "en": "The type of the destination to which the backup set is downloaded. \nValid values: OSS|URL"
          },
          "Default": "OSS"
        },
        "TargetOssRegion": {
          "Type": "String",
          "Description": {
            "en": "The region in which the OSS bucket resides.\nThis parameter is required if the TargetType parameter is set to OSS."
          },
          "Default": "cn-beijing"
        },
        "DeleteBackupSetInOss": {
          "Type": "Boolean",
          "Description": {
            "en": "Whether to delete the backup set in OSS when deleting the stack.\nValid values: true|false, default is true."
          },
          "Default": true
        },
        "TargetBucket": {
          "Type": "String",
          "Description": {
            "en": "The name of the OSS bucket that is used to store the backup set.\nThis parameter is required if the TargetType parameter is set to OSS.\nMake sure that your account is granted the AliyunDBSDefaultRole permission. \nFor more information, see Use RAM for resource authorization. \nYou can also grant permissions based on the operation instructions in the Resource Access Management (RAM) console."
          },
          "Default": "test123"
        },
        "FormatType": {
          "Type": "String",
          "Description": {
            "en": "The format to which the downloaded backup set is converted. \nValid values: CSV|SQL|Parquet"
          },
          "Default": "CSV"
        },
        "DownloadAddressDuration": {
          "Type": "Number",
          "Description": {
            "en": "When the download target is a URL, set the link validity period. \nThe default URL validity period is 7200 seconds. \nThe effective duration range can be set from 300 seconds to 86400 seconds"
          },
          "MinValue": 300,
          "MaxValue": 86400,
          "Default": 2700
        }
      },
      "Resources": {
        "Download": {
          "Type": "ALIYUN::DBS::Download",
          "Properties": {
            "BakSetId": {
              "Ref": "BakSetId"
            },
            "InstanceName": {
              "Ref": "InstanceName"
            },
            "DownloadPointInTime": {
              "Ref": "DownloadPointInTime"
            },
            "BakSetType": {
              "Ref": "BakSetType"
            },
            "BakSetSize": {
              "Ref": "BakSetSize"
            },
            "TargetPath": {
              "Ref": "TargetPath"
            },
            "TargetType": {
              "Ref": "TargetType"
            },
            "TargetOssRegion": {
              "Ref": "TargetOssRegion"
            },
            "DeleteBackupSetInOss": {
              "Ref": "DeleteBackupSetInOss"
            },
            "TargetBucket": {
              "Ref": "TargetBucket"
            },
            "FormatType": {
              "Ref": "FormatType"
            },
            "DownloadAddressDuration": {
              "Ref": "DownloadAddressDuration"
            }
          }
        }
      },
      "Outputs": {
        "InstanceName": {
          "Description": "The ID of the instance.",
          "Value": {
            "Fn::GetAtt": [
              "Download",
              "InstanceName"
            ]
          }
        },
        "BakSetId": {
          "Description": "The ID of the backup set.",
          "Value": {
            "Fn::GetAtt": [
              "Download",
              "BakSetId"
            ]
          }
        },
        "DownloadAddressInfo": {
          "Description": "The download address information.",
          "Value": {
            "Fn::GetAtt": [
              "Download",
              "DownloadAddressInfo"
            ]
          }
        },
        "TaskId": {
          "Description": "The ID of the download task.",
          "Value": {
            "Fn::GetAtt": [
              "Download",
              "TaskId"
            ]
          }
        }
      }
    }