You can call the DescribeBackupPolicy operation to query the backup settings of an 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 backup type. Valid values:

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

The method 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 available 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
LogBackupRetentionPeriod Integer 7

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

ArchiveBackupKeepPolicy String ByMonth

The cycle based on which archived backup files are retained.

ArchiveBackupKeepCount String 1

The number of archived backup files that are retained.

LocalLogRetentionHours Integer 0

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

BackupRetentionPeriod Integer 7

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

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

The ID of the request.

PreferredBackupPeriod String Monday,Wednesday,Friday,Sunday

The cycle based on which you want to perform a backup. Separate multiple values with commas (,). Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
CompressType String 1

The method 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 available only when the instance runs MySQL 8.0.
SupportReleasedKeep Integer 0

A reserved parameter.

LocalLogRetentionSpace String 30

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

SupportVolumeShadowCopy Integer 1

Indicates whether the instance supports snapshot backups. Valid values:

  • 1: The instance supports snapshot backups.
  • 0: The instance does not support snapshot backups.
Note This parameter is returned only when the instance runs SQL Server.
BackupMethod String Physical

The backup method of the instance. Valid values:

  • Physical: physical backup
  • Snapshot: snapshot backup
Note This parameter is returned only when the instance runs SQL Server and uses standard SSDs or enhanced SSDs (ESSDs).
LogBackupFrequency String LogInterval

The backup frequency of logs. Valid values:

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

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

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 binary log files. Valid values:

  • Disable
  • Enable
ArchiveBackupRetentionPeriod String 365

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

BackupInterval String 30

The backup interval. Unit: minutes.

  • 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.
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.
PreferredBackupTime String 15:00Z-16:00Z

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

LogBackupLocalRetentionNumber Integer 60

The number of binary log files that are retained on the instance.

Category String Standard

Indicates whether to enable the single-digit second backup feature. This feature allows ApsaraDB RDS to complete a backup within single-digit seconds. Valid values:

  • Flash: The single-digit second backup feature is enabled.
  • Standard: The single-digit second backup feature is disabled.
Note This parameter takes effect only when you set the BackupPolicyMode parameter to DataBackupPolicy.
EnableBackupLog String 1

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

  • 1: The log backup feature is enabled.
  • 0: The log backup feature is disabled.
BackupLog String Enable

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

  • Enable
  • Disabled
EnableIncrementDataBackup Boolean True

Indicates whether incremental backup is enabled. Valid values:

  • True: Incremental backup is enabled.
  • False: Incremental backup is disabled.

Examples

Sample requests

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

Sample success responses

XML format

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

<DescribeBackupPolicyResponse>
<Category>Standard</Category>
<ArchiveBackupRetentionPeriod>0</ArchiveBackupRetentionPeriod>
<RequestId>292884FE-D689-47A2-9829-C05E63366201</RequestId>
<Duplication/>
<ReleasedKeepPolicy>None</ReleasedKeepPolicy>
<ArchiveBackupKeepPolicy>ByMonth</ArchiveBackupKeepPolicy>
<PreferredBackupTime>00:00Z-01:00Z</PreferredBackupTime>
<LocalLogRetentionHours>18</LocalLogRetentionHours>
<PreferredNextBackupTime>2021-01-07T00:40Z</PreferredNextBackupTime>
<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>
<SupportVolumeShadowCopy>1</SupportVolumeShadowCopy>
<LocalLogRetentionSpace>30</LocalLogRetentionSpace>
<BackupRetentionPeriod>10</BackupRetentionPeriod>
<DuplicationContent/>
<BackupInterval>30</BackupInterval>
</DescribeBackupPolicyResponse>

JSON format

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

{
  "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",
  "HighSpaceUsageProtection" : "Enable",
  "CompressType" : "1",
  "LogBackupFrequency" : "LogInterval",
  "PreferredBackupPeriod" : "Tuesday,Thursday,Saturday",
  "ArchiveBackupKeepCount" : 1,
  "LogBackupRetentionPeriod" : "7",
  "LogBackupLocalRetentionNumber" : 60,
  "BackupLog" : "Enable",
  "EnableBackupLog" : "1",
  "SupportReleasedKeep" : 0,
  "SupportVolumeShadowCopy" : 1,
  "LocalLogRetentionSpace" : "30",
  "BackupRetentionPeriod" : 10,
  "DuplicationContent" : "",
  "BackupInterval" : "30"
}

Error codes

HTTP status code Error code Error message Description
400 IO.Exception IO exception, retry later. The error message returned because I/O errors occurred.
400 InternalFailure Internal failure, retry later. The error message returned because the request failed. Try again later.
400 InvalidParameter.OwnerAccount The specified parameter OwnerAccount is not valid. The error message returned because the value of the OwnerAccount parameter is invalid. Check the value.
404 InvalidDBInstance.NotFound Specified instance does not exist or not support. The error message returned because the instance cannot be found, is deleted, or does not support the operation.

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