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 the BackupStatus parameter of the data backup file 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 IDs of the data backup files to query.

BackupStatus String No Success

The status of the data backup files to query. Valid values:

  • Success
  • Failed
BackupMode String No Automated

The mode based on which the data backup files to query are generated. 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:mm 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
TotalRecordCount String 100

The total number of entries returned.

PageNumber String 1

The page number of the returned page.

PageRecordCount String 30

The number of data backup files on the page.

Items Array of Backup

An array that consists of data backup files.

Backup
BackupId String 321020562

The ID of the data backup file.

DBInstanceId String rm-uf6wjk5xxxxxxx

The ID of the instance.

HostInstanceID String 5882781

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

BackupStatus String Success

The status of the data backup file.

BackupStartTime String 2019-02-03T12:20:00Z

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

BackupEndTime String 2019-02-13T12:20:00Z

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

BackupType String FullBackup

The type of backup that was performed to generate the data backup file. Valid values:

  • FullBackup
  • IncrementalBackup
BackupMode String Automated

The mode based on which the data backup file was generated. Valid values:

  • Automated
  • Manual
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
BackupDownloadURL String http://rdsbak-hz-v3.oss-cn-hangzhou.aliyuncs.com/xxxxx

The URL from which the data backup file can be downloaded over the Internet. If the data backup file cannot be downloaded over the Internet, a null string is returned.

Note For example, if the BackupMethod parameter of an ApsaraDB RDS for SQL Server instance is set to Snapshot, a null string is returned.
BackupIntranetDownloadURL String http://rdsbak-hz-v3.oss-cn-hangzhou-internal.aliyuncs.com/xxxxx

The URL from which the data backup file can be downloaded over an internal network. If the data backup file cannot be downloaded over an internal network, a null string is returned.

Note For example, if the instance runs SQL Server and you set the BackupMethod parameter to Snapshot, a null string is returned.
BackupSize Long 2167808

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

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.
BackupInitiator String System

The initiator of the backup task that generated the data backup file. Valid values:

  • System
  • User
ConsistentTime Long 1576506856

The point in time at which the data in the data backup file is consistent. The 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.
CopyOnlyBackup String 0

The mode that is used to generate 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 If the instance runs SQL Server, this parameter is returned.
Encryption String {}

The encrypted information of the data backup file.

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.
MetaStatus String OK

The status of the data backup file that is used to restore individual databases and 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 a null string is returned, the data backup file does not support database- and table-level restoration.
StorageClass String 0

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

  • 0: regular storage
  • 1: archive storage
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.

Examples

Sample requests

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

Sample success responses

XML format

<DescribeBackupsResponse>
  <TotalRecordCount>1</TotalRecordCount>
  <PageRecordCount>1</PageRecordCount>
  <TotalEcsSnapshotSize>0</TotalEcsSnapshotSize>
  <RequestId>B0BBC25A-6B3E-4BFD-A052-48664294E20D</RequestId>
  <PageNumber>1</PageNumber>
  <Items>
        <Backup>
              <BackupMethod>Snapshot</BackupMethod>
              <BackupInitiator>System</BackupInitiator>
              <StorageClass>0</StorageClass>
              <BackupMode>Automated</BackupMode>
              <BackupSize>161061273600</BackupSize>
              <BackupId>677987116</BackupId>
              <IsAvail>1</IsAvail>
              <HostInstanceID>9232003</HostInstanceID>
              <BackupDBNames></BackupDBNames>
              <StoreStatus>Disabled</StoreStatus>
              <DBInstanceId>rm-uf6wjk5xxxxxxx</DBInstanceId>
              <BackupDownloadURL></BackupDownloadURL>
              <BackupEndTime>2020-07-11T05:07:33Z</BackupEndTime>
              <BackupStartTime>2020-07-11T05:07:33Z</BackupStartTime>
              <ConsistentTime>0</ConsistentTime>
              <BackupType>FullBackup</BackupType>
              <MetaStatus></MetaStatus>
              <BackupScale>DBInstance</BackupScale>
              <BackupStatus>Success</BackupStatus>
        </Backup>
  </Items>
  <TotalBackupSize>161061273600</TotalBackupSize>
</DescribeBackupsResponse>

JSON format

{
    "TotalRecordCount": 1,
    "PageRecordCount": 1,
    "TotalEcsSnapshotSize": "0",
    "RequestId": "B0BBC25A-6B3E-4BFD-A052-48664294E20D",
    "PageNumber": 1,
    "Items": {
        "Backup": [
            {
                "BackupMethod": "Snapshot",
                "BackupInitiator": "System",
                "StorageClass": "0",
                "BackupMode": "Automated",
                "BackupSize": 161061273600,
                "BackupId": 677987116,
                "IsAvail": 1,
                "HostInstanceID": 9232003,
                "BackupDBNames": "",
                "StoreStatus": "Disabled",
                "DBInstanceId": "rm-uf6wjk5xxxxxxx",
                "BackupDownloadURL": "",
                "BackupEndTime": "2020-07-11T05:07:33Z",
                "BackupStartTime": "2020-07-11T05:07:33Z",
                "ConsistentTime": "0",
                "BackupType": "FullBackup",
                "MetaStatus": "",
                "BackupScale": "DBInstance",
                "BackupStatus": "Success"
            }
        ]
    },
    "TotalBackupSize": "161061273600"
}

Error codes

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