You can call the DescribeBackups operation to query the data backup files of an ApsaraDB RDS instance.

Note A data backup file can be used to restore data only when its BackupStatus value is Success.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeBackups

The operation that you want to perform. Set the value to DescribeBackups.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

BackupId String No 327329803

The ID of the data backup file.

BackupStatus String No Success

The status of the data backup file. Valid values:

  • Success
  • Failed
BackupMode String No Automated

The backup mode of the data backup file. Valid values:

  • Automated
  • Manual
StartTime String No 2011-06-01T16:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

EndTime String No 2011-06-15T16:00Z

The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

PageSize Integer No 30

The number of entries to return on each page. Valid values:

  • 30
  • 50
  • 100

Default value: 30.

PageNumber Integer No 1

The number of the page to return. Valid values: any non-zero positive integer.

Default value: 1.

Response parameters

Parameter Type Example Description
RequestId String 1A6D328C-84B8-40DC-BF49-6C73984D7494

The ID of the request.

TotalEcsSnapshotSize Long 0

The size of the snapshot chain of the instance. Unit: bytes.

PageRecordCount String 30

The number of data backup files on the page.

TotalRecordCount String 100

The total number of entries returned.

PageNumber String 1

The page number of the returned page.

Items Array of Backup

The details of the returned data backup files.

Backup
StorageClass String 0

The storage media used to store the data backup file. Valid values:

  • 0: regular storage
  • 1: archive storage
Encryption String {}

The encryption information of the data backup file.

BackupStatus String Success

The status of the data backup file.

StoreStatus String Disabled

Indicates whether the data backup file can be deleted. Valid values:

  • Enabled: The data backup file can be deleted.
  • Disabled: The data backup file cannot be deleted.
ConsistentTime Long 1576506856

The point in time at which the data in the data backup file is consistent. The return value of this parameter is a timestamp.

Note If the instance runs MySQL 5.6, a timestamp is returned. Otherwise, the value 0 is returned.
BackupType String FullBackup

The backup type that is used to generate the data backup file. Valid values:

  • FullBackup
  • IncrementalBackup
CopyOnlyBackup String 0

The backup mode of the data backup file. Valid values:

  • 0: the standard mode. This mode supports full backups and incremental backups.
  • 1: the copy-only mode. This mode supports only full backups.
    Note This parameter is returned only when the instance runs SQL Server.
BackupEndTime String 2019-02-13T12:20:00Z

The end time of the backup task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

MetaStatus String OK

The status of the data backup file that is used to restore individual databases or tables. Valid values:

  • OK: The data backup file is normal.
  • LARGE: The data backup file contains an abnormally large number of tables. It cannot be used to restore individual databases or tables.
  • EMPTY: The data backup file is generated from a failed backup task.
Note If an empty string is returned, the data backup file cannot be used to restore individual databases or tables.
BackupInitiator String System

The initiator of the backup task. Valid values:

  • System
  • User
BackupIntranetDownloadURL String http://rdsbak-hz-v3.oss-cn-hangzhou-internal.aliyuncs.com/xxxxx

The URL that is used to download the data backup file over an internal network. If the data backup file cannot be downloaded, null is returned.

Note For example, if the instance runs SQL Server and the BackupMethod parameter is set to Snapshot, null is returned.
BackupMethod String Physical

The method that is used to generate the data backup file. Valid values:

  • Logical: logical backup
  • Physical: physical backup
  • Snapshot: snapshot backup
BackupStartTime String 2019-02-03T12:20:00Z

The start time of the backup task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

BackupDownloadURL String http://rdsbak-hz-v3.oss-cn-hangzhou.aliyuncs.com/xxxxx

The URL that is used to download the data backup file over the Internet. If the data backup file cannot be downloaded, null is returned.

Note For example, if the instance runs SQL Server and the BackupMethod parameter is set to Snapshot, null is returned.
IsAvail Integer 1

Indicates whether the data backup file is available. Valid values:

  • 0: The data backup file is unavailable.
  • 1: The data backup file is available.
BackupId String 321020562

The ID of the data backup file.

HostInstanceID String 5882781

The No. of the instance that generates the data backup file. This parameter is used to indicate whether the instance that generates the data backup file is a primary instance or a secondary instance.

BackupSize Long 2167808

The size of the data backup file. Unit: bytes.

BackupMode String Automated

The backup mode of the data backup file. Valid values:

  • Automated
  • Manual
DBInstanceId String rm-uf6wjk5xxxxxxx

The ID of the instance.

Checksum String 1835830439**********

The checksum. The value of this parameter is calculated by using the CRC64 algorithm.

BackupDownloadLinkByDB Array of BackupDownloadLinkByDB

The URL from which you can download the data backup file of the individual database.

BackupDownloadLinkByDB
IntranetDownloadLink String https://cn-hangzhou-internal.bak.rds.aliyuncs.com/custins53664665/hins18676859_2021072909473127987849.zip?Expires=*****&dbList=tb1

The internal URL from which you can download the data backup file.

DataBase String dbs

The name of the database.

DownloadLink String https://cn-hangzhou.bak.rds.aliyuncs.com/custins53664665/hins18676859_2021072909473127987849.zip?Expires=*****&dbList=tb1

The public URL from which you can download the data backup file.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=DescribeBackups
&DBInstanceId=rm-uf6wjk5xxxxxxx
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeBackupsResponse>
    <TotalRecordCount>100</TotalRecordCount>
    <TotalEcsSnapshotSize>0</TotalEcsSnapshotSize>
    <PageRecordCount>30</PageRecordCount>
    <RequestId>1A6D328C-84B8-40DC-BF49-6C73984D7494</RequestId>
    <PageNumber>1</PageNumber>
    <Items>
        <Backup>
            <BackupMethod>Physical</BackupMethod>
            <BackupInitiator>System</BackupInitiator>
            <StorageClass>0</StorageClass>
            <BackupIntranetDownloadURL>http://rdsbak-hz-v3.oss-cn-hangzhou-internal.aliyuncs.com/xxxxx</BackupIntranetDownloadURL>
            <BackupSize>2167808</BackupSize>
            <BackupMode>Automated</BackupMode>
            <BackupId>321020562</BackupId>
            <IsAvail>1</IsAvail>
            <Encryption>{}</Encryption>
            <HostInstanceID>5882781</HostInstanceID>
            <StoreStatus>Disabled</StoreStatus>
            <BackupDownloadURL>http://rdsbak-hz-v3.oss-cn-hangzhou.aliyuncs.com/xxxxx</BackupDownloadURL>
            <DBInstanceId>rm-uf6wjk5xxxxxxx</DBInstanceId>
            <CopyOnlyBackup>0</CopyOnlyBackup>
            <BackupEndTime>2019-02-13T12:20:00Z</BackupEndTime>
            <ConsistentTime>1576506856</ConsistentTime>
            <BackupStartTime>2019-02-03T12:20:00Z</BackupStartTime>
            <MetaStatus>OK</MetaStatus>
            <BackupType>FullBackup</BackupType>
            <BackupStatus>Success</BackupStatus>
            <BackupDownloadLinkByDB>
                <BackupDownloadLinkByDB>
                    <DownloadLink>https://cn-hangzhou.bak.rds.aliyuncs.com/custins53664665/hins18676859_2021072909473127987849.zip?Expires=*****&amp;dbList=tb1</DownloadLink>
                    <IntranetDownloadLink>https://cn-hangzhou-internal.bak.rds.aliyuncs.com/custins53664665/hins18676859_2021072909473127987849.zip?Expires=*****&amp;dbList=tb1</IntranetDownloadLink>
                    <DataBase>dbs</DataBase>
                </BackupDownloadLinkByDB>
            </BackupDownloadLinkByDB>
        </Backup>
    </Items>
</DescribeBackupsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "DescribeBackupsResponse" : {
    "TotalRecordCount" : 100,
    "TotalEcsSnapshotSize" : 0,
    "PageRecordCount" : 30,
    "RequestId" : "1A6D328C-84B8-40DC-BF49-6C73984D7494",
    "PageNumber" : 1,
    "Items" : {
      "Backup" : {
        "BackupMethod" : "Physical",
        "BackupInitiator" : "System",
        "StorageClass" : 0,
        "BackupIntranetDownloadURL" : "http://rdsbak-hz-v3.oss-cn-hangzhou-internal.aliyuncs.com/xxxxx",
        "BackupSize" : 2167808,
        "BackupMode" : "Automated",
        "BackupId" : 321020562,
        "IsAvail" : 1,
        "Encryption" : "{}",
        "HostInstanceID" : 5882781,
        "StoreStatus" : "Disabled",
        "BackupDownloadURL" : "http://rdsbak-hz-v3.oss-cn-hangzhou.aliyuncs.com/xxxxx",
        "DBInstanceId" : "rm-uf6wjk5xxxxxxx",
        "CopyOnlyBackup" : 0,
        "BackupEndTime" : "2019-02-13T12:20:00Z",
        "ConsistentTime" : 1576506856,
        "BackupStartTime" : "2019-02-03T12:20:00Z",
        "MetaStatus" : "OK",
        "BackupType" : "FullBackup",
        "BackupStatus" : "Success",
        "BackupDownloadLinkByDB" : {
          "BackupDownloadLinkByDB" : {
            "DownloadLink" : "https://cn-hangzhou.bak.rds.aliyuncs.com/custins53664665/hins18676859_2021072909473127987849.zip?Expires=*****&amp;dbList=tb1",
            "IntranetDownloadLink" : "https://cn-hangzhou-internal.bak.rds.aliyuncs.com/custins53664665/hins18676859_2021072909473127987849.zip?Expires=*****&amp;dbList=tb1",
            "DataBase" : "dbs"
          }
        }
      }
    }
  }
}

Error codes

For a list of error codes, visit the API Error Center.