All Products
Search
Document Center

Database Backup:DescribeBackupPolicy

Last Updated:Sep 18, 2024

Queries the information about the backup policy of a PolarDB for MySQL instance.

Operation description

Supported database engine

PolarDB for MySQL

Note The API operation is available only to specific customers. If you want to call this API operation, request permissions by joining the Database Backup (DBS) DingTalk group (ID 35585947) for customer consultation.

References

Topics related to backup policies of PolarDB for MySQL instances

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dbs:DescribeBackupPolicyget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionCodestringNo

The region in which the backup set resides.

cn-beijing
InstanceNamestringNo

The ID of the PolarDB for MySQL cluster.

pc-2ze3nrr64c5******

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

54A63B3B-AA10-1CC3-A6BB-6CCE98D19628
Messagestring

The returned message.

instanceName can not be empty.
Dataobject

The details of the backup policy.

PreferredBackupDatestring

The backup cycle of a basic backup. The backup cycle is represented by a seven-digit string, which corresponds to the days of the week from Monday to Sunday. A value of 1 indicates that a basic backup is performed on that day, and a value of 0 indicates that no basic backup is performed on that day.

1010101
PreferredBackupWindowBeginstring

The start time of a basic backup.

23:00Z
PreferredBackupWindowstring

The time period during which a basic backup is performed.

23:00Z-24:00Z
BackupRetentionPeriodinteger

The retention period of basic backup files. If an advanced backup policy is enabled, the value indicates the retention period of the level-1 backup policy.

7
BackupRetentionPolicyOnClusterDeletionstring

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

  • NONE: No archived backup file is retained.
  • LATEST: Only the latest archived backup file is retained.
  • ALL: All archived backup files are retained.
LATEST
HighFrequencyBakIntervalinteger

The interval for high-frequency backups. Unit: minutes. For example, a value of 120 indicates that a backup is performed every two hours.

120
BackupPriorityinteger

Indicates whether the secondary database is preferentially backed up. Valid values:

  • 1: The secondary database is preferentially backed up.
  • 2: Only the primary database is backed up.
Note This parameter is returned only for ApsaraDB RDS for SQL Server instances. If the instance runs a different database engine, 0 is returned.
0
EnableLogBackupinteger

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

  • 1: The log backup feature is enabled.
  • 0: The log backup feature is disabled.
1
LogBackupRetentioninteger

The retention period of log backups.

7
LogBackupLocalRetentionNumberstring

The number of local binary log files that are retained.

10
EnableBackupinteger

Indicates whether the backup feature is enabled.

1
LocalLogRetentionSpaceinteger

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

30
HighSpaceUsageProtectionstring

Indicates whether logs are forcibly cleared if the storage usage of the instance is greater than 80% or the available storage space of the instance is smaller than 5 GB. Valid values:

  • Disable: Logs are not forcibly cleared.
  • Enable: Logs are forcibly cleared.
Enable
Categorystring

Indicates whether the second-granularity backup feature is enabled. Valid values:

  • Flash: The second-granularity backup feature is enabled.
  • Standard: The standard backup feature is enabled.
Note This parameter is returned only for MySQL instances.
Standard
IncBackupIntervalinteger

The interval for high-frequency incremental backups.

-1
EnableIncBackupinteger

Indicates whether the incremental backup feature is enabled.

0
BackupMethodstring

The method that is used to generate backup files. Valid values:

  • Physical: physical backup
  • Snapshot: snapshot backup
Physical
AdvanceLogPoliciesarray<object>

The details of log backup policies.

object
PolicyIdstring

The backup policy ID.

6s67c7i3y8f8p72808p******
SrcTypestring

The type of the data source of the backup policy. Valid values:

  • db: database
  • level1: level-1 backup
  • level2: level-2 backup
  • level2Cross: level-2 cross-region backup
level1
SrcRegionstring

The region in which the data source of the backup policy resides.

cn-beijing
DestTypestring

The storage method of backup files. Valid values:

  • db: database
  • level1: level-1 backup
  • level2: level-2 backup
  • level2Cross: level-2 cross-region backup
level1
DestRegionstring

The region in which the backup files are stored.

cn-shanghai
EnableLogBackupboolean

A reserved parameter.

1
LogRetentionTypestring

The retention type of log backups. Valid values:

  • never: Log backups never expire.
  • delay: Log backups are retained for a specific number of days.
delay
LogRetentionValuestring

The retention period of log backups.

3
AdvanceDataPoliciesarray<object>

The details of data backup policies.

object
PolicyIdstring

The ID of the advanced backup policy.

71930ac2e9f15e41615e10627c******
FilterTypestring

The scheduling mode of the advanced backup policy. Valid values:

  • crontab: periodic scheduling
  • event: event-based scheduling
crontab
FilterKeystring

The scheduling frequency. Valid values:

  • dayOfWeek: scheduling by week
  • dayOfMonth: scheduling by month
  • dayOfYear: scheduling by year
  • backupInterval: scheduling at a specific interval
Note This parameter is returned only if the value of FilterType is crontab.
dayOfWeek
FilterValuestring

The day of a week on which you want to back up data.

1,2,3,4,5,6,7
DumpActionstring

The information about the dump policy. Valid values:

  • copy: The backup data is copied from the data source to the destination.
  • move: The backup data is moved from the data source to the destination.
copy
RetentionTypestring

The retention type of backup sets. Valid values:

  • never: Backup sets never expire.
  • delay: Backup sets are retained for a specific number of days.
delay
RetentionValuestring

The validity period, in days.

7
SrcTypestring

The type of the data source of the backup policy. Valid values:

  • db: database
  • level1: level-1 backup
  • level2: level-2 backup
  • level2Cross: level-2 cross-region backup
db
SrcRegionstring

The region in which the data source of the backup policy resides.

cn-beijing
DestTypestring

The storage method of backup files. Valid values:

  • db: database
  • level1: level-1 backup
  • level2: level-2 backup
  • level2Cross: level-2 cross-region backup
level1
DestRegionstring

The region in which the backup files are stored.

cn-beijing
BakTypestring

The backup type. Valid values:

  • F: full backup
  • L: log backup
F
AutoCreatedboolean

Indicates whether the backup policy is generated by the system. Valid values:

  • true: The backup policy is generated by the system.
  • false: The backup policy is a custom one.
true
ErrMessagestring

The error message.

The specified parameter %s value is not valid.
Codestring

The status code.

Success
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
true
ErrCodestring

The error code.

Success

Examples

Sample success responses

JSONformat

{
  "RequestId": "54A63B3B-AA10-1CC3-A6BB-6CCE98D19628",
  "Message": "instanceName can not be empty.",
  "Data": {
    "PreferredBackupDate": "1010101",
    "PreferredBackupWindowBegin": "23:00Z",
    "PreferredBackupWindow": "23:00Z-24:00Z",
    "BackupRetentionPeriod": 7,
    "BackupRetentionPolicyOnClusterDeletion": "LATEST",
    "HighFrequencyBakInterval": 120,
    "BackupPriority": 0,
    "EnableLogBackup": 1,
    "LogBackupRetention": 7,
    "LogBackupLocalRetentionNumber": "10",
    "EnableBackup": 1,
    "LocalLogRetentionSpace": 30,
    "HighSpaceUsageProtection": "Enable",
    "Category": "Standard",
    "IncBackupInterval": -1,
    "EnableIncBackup": 0,
    "BackupMethod": "Physical",
    "AdvanceLogPolicies": [
      {
        "PolicyId": "6s67c7i3y8f8p72808p******",
        "SrcType": "level1",
        "SrcRegion": "cn-beijing",
        "DestType": "level1",
        "DestRegion": "cn-shanghai",
        "EnableLogBackup": true,
        "LogRetentionType": "delay",
        "LogRetentionValue": "3"
      }
    ],
    "AdvanceDataPolicies": [
      {
        "PolicyId": "71930ac2e9f15e41615e10627c******",
        "FilterType": "crontab",
        "FilterKey": "dayOfWeek",
        "FilterValue": "1,2,3,4,5,6,7",
        "DumpAction": "copy",
        "RetentionType": "delay",
        "RetentionValue": "7",
        "SrcType": "db",
        "SrcRegion": "cn-beijing",
        "DestType": "level1",
        "DestRegion": "cn-beijing",
        "BakType": "F",
        "AutoCreated": true
      }
    ]
  },
  "ErrMessage": "The specified parameter %s value is not valid.     ",
  "Code": "Success",
  "Success": "true",
  "ErrCode": "Success"
}

Error codes

HTTP status codeError codeError message
403Request.ForbiddenHave no Permissions

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-28The response structure of the API has changedView Change Details
2024-05-17The response structure of the API has changedView Change Details