You can call the DescribeBackupPolicy operation to query the backup settings of an ApsaraDB RDS instance.

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 DescribeBackupPolicy

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

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

BackupPolicyMode String No DataBackupPolicy

The type of backup that you want to perform. Valid values:

  • DataBackupPolicy: data backup
  • LogBackupPolicy: log backup
CompressType String No 1

The format that is used to compress backup data. Valid values:

  • 0: Backup data is not compressed.
  • 1: Backup data is compressed by using zlib.
  • 2: Backup data is compressed by using zlib that invokes more than one thread in parallel for each backup.
  • 4: Backup data is compressed by using QuickLZ and can be used to restore individual databases and tables.
  • 8: Backup data is compressed by using QuickLZ but cannot be used to restore individual databases or tables. This value is supported only when the instance runs MySQL 8.0.
ReleasedKeepPolicy String No Lastest

The policy that is used to retain archived backup files if the instance is released. Valid values:

  • None: No archived backup files are retained.
  • Lastest: Only the last archived backup file is retained.
  • All: All archived backup files are retained.

Response parameters

Parameter Type Example Description
BackupRetentionPeriod Integer 7

The number of days for which data backup files are retained.

PreferredBackupTime String 15:00Z-16:00Z

The time when a backup is performed. The time follows the ISO 8601 standard in the HH:mmZ-HH:mmZ format. The time is displayed in UTC.

PreferredBackupPeriod String Monday,Wednesday,Friday,Sunday

The cycle based on which backups are performed. If more than one day of the week is specified, the days of the week are separated by commas (,). Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
BackupLog String Enable

Indicates whether the log backup feature is enabled. Value values: Enable and Disabled.

LogBackupRetentionPeriod Integer 7

The number of days for which log backup files are retained.

Duplication String Enable

Indicates whether backup files are dumped to Object Storage Service (OSS) buckets. Valid values: Enable and Disabled.

DuplicationContent String DATA&LOG

The type of backup file that is dumped to OSS buckets. Valid values:

  • DATA: Only data backup files are dumped to OSS buckets.
  • LOG: Only log backup files are dumped to OSS buckets.
  • DATA&LOG: Both data and log backup files are dumped to OSS buckets.
Note This parameter must be specified when you set the Duplication parameter to Enable.
DuplicationLocation Struct

The location where backup files are stored.

Location Struct

The information about the location.

Bucket String mybucket

The name of the OSS bucket to which backup files are dumped.

Endpoint String oss-cn-shanghai.aliyuncs.com

The endpoint of the OSS bucket.

Sotrage String OSS

The media that is used to store backup files. In most cases, backup files are stored in OSS buckets.

EnableBackupLog String 1

Indicates whether the log backup feature is enabled. Valid values:

  • 1: enabled
  • 0: disabled
HighSpaceUsageProtection String Enable

Indicates whether the log backup deletion feature is enabled. If the disk usage exceeds 80% or the remaining disk space is less than 5 GB on the instance, this feature deletes log backup files. Valid values:

  • Disable
  • Enable
LocalLogRetentionHours Integer 0

The number of hours for which log backup files are retained on the instance.

LocalLogRetentionSpace String 30

The maximum disk usage that is allowed for log backup files on the instance.

LogBackupFrequency String LogInterval

The frequency at which log backups are performed. Valid values:

  • The LogInterval value indicates that log backups are performed every 30 minutes.
  • The default frequency is the same as the value of the PreferredBackupPeriod.
Note The LogBackupFrequency parameter is supported only when the instance runs SQL Server
PreferredNextBackupTime String 2018-01-19T15:15Z

The time when the next backup will be performed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

RequestId String B87E2AB3-B7C9-4394-9160-7F639F732031

The ID of the request.

ArchiveBackupKeepCount String 1

The number of archived backup files that can be retained.

ArchiveBackupKeepPolicy String ByMonth

The cycle based on which archived backup files are retained.

ArchiveBackupRetentionPeriod String 365

The number of days for which archived backup files are retained.

BackupInterval String 30

The interval at which backups are performed.

  • If the instance runs MySQL, the interval is the same as the value of the Snapshot Backup Start Time parameter (not the Snapshot Backup Period parameter) in the ApsaraDB RDS console. For more information, see Back up an ApsaraDB RDS for MySQL instance.
  • If the instance runs SQL Server, the interval is the same as the log backup frequency.
Category String HighAvailability

The RDS edition of the instance. Valid values:

  • Basic: the Basic Edition
  • HighAvailability: the High-availability Edition
  • AlwaysOn: the Cluster Edition
  • Finance: the Enterprise Edition
CompressType String 1

The format that is used to compress backup data. Valid values:

  • 0: Backup data is not compressed.
  • 1: Backup data is compressed by using zlib.
  • 2: Backup data is compressed by using zlib that invokes more than one thread in parallel for each backup.
  • 4: Backup data is compressed by using QuickLZ and can be used to restore individual databases and tables.
  • 8: Backup data is compressed by using QuickLZ but cannot be used to restore individual databases or tables. This value is supported only when the instance runs MySQL 8.0.
LogBackupLocalRetentionNumber Integer 60

The number of log backup files that can be retained on the instance.

ReleasedKeepPolicy String None

The policy that is used to retain archived backup files if the instance is released. Valid values:

  • None: No archived backup files are retained.
  • Lastest: Only the last archived backup file is retained.
  • All: All archived backup files are retained.
SupportReleasedKeep Integer 0

A hidden parameter.

Examples

Sample requests

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

Sample success responses

XML format

<DescribeBackupPolicyResponse>
  <Category>Standard</Category>
  <ArchiveBackupRetentionPeriod>0</ArchiveBackupRetentionPeriod>
  <RequestId>292884FE-D689-47A2-9829-C05E63366201</RequestId>
  <Duplication></Duplication>
  <ReleasedKeepPolicy>None</ReleasedKeepPolicy>
  <ArchiveBackupKeepPolicy>ByMonth</ArchiveBackupKeepPolicy>
  <PreferredBackupTime>00:00Z-01:00Z</PreferredBackupTime>
  <LocalLogRetentionHours>18</LocalLogRetentionHours>
  <PreferredNextBackupTime>2021-01-07T00:40Z</PreferredNextBackupTime>
  <DuplicationLocation>
        <Sotrage>OSS</Sotrage>
        <Location>
              <Endpoint></Endpoint>
              <Bucket></Bucket>
        </Location>
  </DuplicationLocation>
  <HighSpaceUsageProtection>Enable</HighSpaceUsageProtection>
  <CompressType>1</CompressType>
  <LogBackupFrequency>LogInterval</LogBackupFrequency>
  <PreferredBackupPeriod>Tuesday,Thursday,Saturday</PreferredBackupPeriod>
  <ArchiveBackupKeepCount>1</ArchiveBackupKeepCount>
  <LogBackupRetentionPeriod>7</LogBackupRetentionPeriod>
  <LogBackupLocalRetentionNumber>60</LogBackupLocalRetentionNumber>
  <BackupLog>Enable</BackupLog>
  <EnableBackupLog>1</EnableBackupLog>
  <SupportReleasedKeep>0</SupportReleasedKeep>
  <LocalLogRetentionSpace>30</LocalLogRetentionSpace>
  <BackupRetentionPeriod>10</BackupRetentionPeriod>
  <DuplicationContent></DuplicationContent>
  <BackupInterval>30</BackupInterval>
</DescribeBackupPolicyResponse>

JSON format

{
    "Category": "Standard",
    "ArchiveBackupRetentionPeriod": 0,
    "RequestId": "292884FE-D689-47A2-9829-C05E63366201",
    "Duplication": "",
    "ReleasedKeepPolicy": "None",
    "ArchiveBackupKeepPolicy": "ByMonth",
    "PreferredBackupTime": "00:00Z-01:00Z",
    "LocalLogRetentionHours": "18",
    "PreferredNextBackupTime": "2021-01-07T00:40Z",
    "DuplicationLocation": {
        "Sotrage": "OSS",
        "Location": {
            "Endpoint": "",
            "Bucket": ""
        }
    },
    "HighSpaceUsageProtection": "Enable",
    "CompressType": "1",
    "LogBackupFrequency": "LogInterval",
    "PreferredBackupPeriod": "Tuesday,Thursday,Saturday",
    "ArchiveBackupKeepCount": 1,
    "LogBackupRetentionPeriod": "7",
    "LogBackupLocalRetentionNumber": 60,
    "BackupLog": "Enable",
    "EnableBackupLog": "1",
    "SupportReleasedKeep": 0,
    "LocalLogRetentionSpace": "30",
    "BackupRetentionPeriod": 10,
    "DuplicationContent": "",
    "BackupInterval": "30"
}

Error codes

HTTP status code Error code Error message Description
404 InvalidDBInstance.NotFound Specified instance does not exist or not support. The error message returned because the specified instance does not exist.

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