CreateDownload

Updated at:

Creates an advanced download task.

Operation description

Supported DPI engines

  • RDS MySQL (cloud disk instances)

  • RDS PostgreSQL

  • PolarDB for MySQL

  • MongoDB

Related feature documentation

For conditional instances, you can create an advanced download node by point in time or by specifying a backup set. You can set the download destination to a URL or directly write data to your OSS bucket for subsequent data analytics and offline archiving.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dbs:CreateDownload

create

*DBInstance

acs:rds:{#regionId}:{#accountId}:dbinstance/{#DbInstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionCode

string

Yes

The region ID of the instance. You can call the DescribeDBInstanceAttribute (RDS instance) or DescribeDBClusterAttribute (PolarDB instance) operation to query the region ID.

cn-beijing

InstanceName

string

Yes

The instance ID.

rm-wz994c1t1****

BakSetType

string

No

The type of the download task. Valid values:

  • full: full backup set download

  • pitr: point-in-time download

full

BakSetId

string

No

The backup set ID. You can call the DescribeBackups (RDS instance) or DescribeBackups (PolarDB instance) operation to obtain the value of this parameter.

Note

This parameter is required when BakSetType is set to full.

146005****

DownloadPointInTime

string

No

The point in time for the download. The value is a LONG timestamp in milliseconds.

Note

This parameter is required when BakSetType is set to pitr.

1661331864000

BakSetSize

string

No

The size of the full backup set. You can call the DescribeBackups (RDS instance) or DescribeBackups (PolarDB instance) operation to query the size. Unit: bytes.

216****

FormatType

string

No

The target format for download conversion. Valid values:

  • CSV

  • SQL

  • Parquet

  • Bson

  • qp.xb

Note

This parameter is required. The Bson format can be selected only when the instance type is MongoDB. The qp.xb format can be selected only when the instance type is RDS MySQL.

Valid values:

  • qp.xb :

    qp.xb

  • csv :

    csv

  • bson :

    bson

  • csv-with-header :

    csv-with-header

  • parquet :

    parquet

  • sql :

    sql

CSV

TargetType

string

No

The download destination type. Valid values:

  • OSS

  • URL

OSS

TargetBucket

string

No

The name of the OSS bucket.

  • This parameter is required when TargetType is set to OSS.

  • Make sure that your account has the AliyunDBSDefaultRole permissions. For more information about how to grant permissions, see RAM resource authorization. You can also go to the console and follow the instructions to grant permissions.

test123

TargetPath

string

No

The destination path for data download.

Note

This parameter is required when TargetType is set to OSS.

test_db/path

TargetOssRegion

string

No

The region where the OSS bucket resides.

Note

This parameter is required when TargetType is set to OSS.

cn-beijing

PrimaryKeyTypeOnly

string

No

Specifies whether the primary key type in the databases and tables is unique. This field is required only for the MongoDB engine. Valid values:

  • true: The primary key type is unique.

  • false: The primary key type is not unique.

false

IsCluster

string

No

Specifies whether the current instance is a sharded cluster. This field is required only for the MongoDB engine. Valid values:

  • true: The instance is a MongoDB sharded cluster.

  • false: The instance is of another type.

false

AdminDatabase

string

No

The name of the authentication database. This field is required only for the MongoDB engine. Default value: admin.

admin

UseZstd

string

No

Specifies whether the compression algorithm used for the compressed package is zstd. Default value: false.

false

ClusterName

string

No

The ID of the sharded cluster. This field is required only for MongoDB sharded clusters.

dds-0xid8e5336******

IsPhysical

boolean

No

This parameter is required only when your instance type is RDS MySQL and you need to download the qp.xb format. You must set this parameter to true.

true

Response elements

Element

Type

Description

Example

object

The return values.

RequestId

string

The request ID.

A08F908D-2C35-583F-93C1-ED80753F****

ErrCode

string

The error code.

DBS.ParamIsInValid

Success

string

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

ErrMessage

string

The error message.

formatType can not be empty

Code

string

The status code.

DBS.ParamIsInValid

Message

string

The error message.

formatType can not be empty

Data

object

The returned data.

BakSetId

string

The ID of the full backup set.

146005****

DownloadStatus

string

The status of the download task. Valid values:

  • initializing: initializing

  • queueing: queueing

  • running: downloading

  • failed: download failed

  • finished: download succeeded

  • expired: download expired

Note

Tasks whose download destination is a URL expire 3 days after completion.

initializing

Progress

string

The number of downloaded tables and the total number of tables.

Note

If the task is currently in the preparation stage, the progress returned is 0/0.

0/0

BackupSetTime

integer

The point in time corresponding to the point-in-time download task. The value is returned as a timestamp.

1661373070000

RegionCode

string

The region ID.

cn-beijing

TargetPath

string

The destination path for data download.

Note

This parameter is returned when TargetType is set to OSS.

test_db/path

DbList

string

The database and table information. This field is returned when the download task is a database and table filtering task.

testdb

ExportDataSize

integer

The amount of exported data. Unit: bytes.

0

ImportDataSize

integer

The amount of processed data. Unit: bytes.

0

GmtCreate

integer

The time when the task was created. The value is returned as a timestamp.

1661940917570

TaskId

string

The download task ID.

dt-qxnsfq5s****

Format

string

The target conversion format.

CSV

TargetType

string

The download destination type.

URL

Examples

Success response

JSON format

{
  "RequestId": "A08F908D-2C35-583F-93C1-ED80753F****",
  "ErrCode": "DBS.ParamIsInValid",
  "Success": "true",
  "ErrMessage": "formatType can not be empty",
  "Code": "DBS.ParamIsInValid",
  "Message": "formatType can not be empty",
  "Data": {
    "BakSetId": "146005****",
    "DownloadStatus": "initializing",
    "Progress": "0/0",
    "BackupSetTime": 1661373070000,
    "RegionCode": "cn-beijing",
    "TargetPath": "test_db/path",
    "DbList": "testdb",
    "ExportDataSize": 0,
    "ImportDataSize": 0,
    "GmtCreate": 1661940917570,
    "TaskId": "dt-qxnsfq5s****",
    "Format": "CSV",
    "TargetType": "URL"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

200 DBS.DownloadTask.CannotFind Can not find download task. Can not find download task.
200 DBS.DownloadTask.JobAlreadyExist Job already submit in recent days, please check it. Job already submit in recent days, please check it.
200 DBS.DownloadTask.OnlyOneRunningOrFailedTask There can be only one running or failed task for the instance. The current instance can only have one running/failed task at the same time.
200 DBS.DownloadTask.OssForbid OSS is forbidden to access. Please check your OSS bucket. OSS is forbidden to access. Please check your OSS bucket.
200 DBS.DownloadTask.OssStorageTypeInvalid Unsupported bucket storage. Please make sure that your OSS bucket's storgae type is standard. Unsupported bucket storage. Please make sure that your OSS bucket's storgae type is standard.
200 Forbidden.InstanceNotFound instance not found The instance does not exist.
200 DBS.DownloadTask.BakSetError DBS download task bak set error. Your backup set does not meet the requirements. Your backup set does not meet the requirements.
200 DBS.DownloadTask.CustinIdNotSupport DBS DownloadTask CustinIdNotSupport. DBS DownloadTask CustinIdNotSupport.
200 DBS.DownloadTask.CustinNameNotSupport DBS DownloadTask CustinNameNotSupport. DBS DownloadTask CustinNameNotSupport.
200 DBS.DownloadTask.DbTypeNotSupport DBS DownloadTask DbTypeNotSupport. DBS DownloadTask DbTypeNotSupport.
200 DBS.DownloadTask.InstanceInfoNotSupport DBS DownloadTask InstanceInfoNotSupport. DBS DownloadTask InstanceInfoNotSupport.
200 DBS.DownloadTask.InstanceParamNotSupport DBS DownloadTask InstanceParamNotSupport. DBS DownloadTask InstanceParamNotSupport.
200 DBS.DownloadTask.InstanceStorageTypeNotSupport DBS DownloadTask InstanceStorageTypeNotSupport. The instance storage type is not currently supported for Advanced Download.
200 DBS.DownloadTask.InstanceVersionNotSupport DBS DownloadTask InstanceVersionNotSupport. DBS DownloadTask InstanceVersionNotSupport.
200 DBS.DownloadTask.NotSupport DBS DownloadTask NotSupport. DBS DownloadTask NotSupport.
200 DBS.DownloadTask.RegionNotSupport DBS DownloadTask RegionNotSupport. DBS DownloadTask RegionNotSupport.
200 DBS.DownloadTask.UserNotSupport DBS DownloadTask UserNotSupport. DBS DownloadTask UserNotSupport.
403 Request.Forbidden Have no Permissions You are not authorized to perform the current operation. Contact the Alibaba Cloud account to grant permissions in the Resource Access Management (RAM) console before you perform this operation.
403 DBS.NoPermissionException Rejected by ValidationChecker. Rejected by ValidationChecker.
404 DBS.NotExists data source do not existed. DBS.NotExists

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.