Modifies the backup policy of a PolarDB instance.
Operation description
Supported engines
PolarDB for MySQL
This operation is currently available only to specific customers. To request access, join the DBS customer consultation DingTalk group (group ID: 35585947).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dbs:ModifyBackupPolicy |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionCode |
string |
No |
The region where the backup set is located. |
cn-shanghai |
| PreferredBackupWindowBegin |
string |
No |
The start time of the basic backup window. |
17:00Z |
| InstanceName |
string |
No |
The PolarDB instance ID. |
pc-2ze3nrr64c5**** |
| Category |
string |
No |
The backup type. Valid values:
|
Flash |
| AdvanceLogPolicies |
array<object> |
No |
The destination region of the backup policy. |
|
|
object |
No |
The source region of the backup policy. |
||
| LogRetentionType |
string |
No |
The retention period type. Valid values:
|
Never |
| DestType |
string |
No |
The destination type of the backup policy. Valid values:
|
level1 |
| FilterType |
string |
No |
The advanced policy filter type. Valid values:
|
crontab |
| ActionType |
string |
No |
The operation type. Valid values: CREATE, UPDATE, and DELETE. |
CREATE |
| SrcRegion |
string |
No |
The source region of the backup policy. |
cn-hangzhou |
| EnableLogBackup |
integer |
No |
Specifies whether log backup is enabled. Valid values:
|
1 |
| SrcType |
string |
No |
The source type of the backup policy. Valid values:
|
db |
| LogRetentionValue |
string |
No |
The number of days before expiration. |
30 |
| PolicyId |
string |
No |
The ID of the advanced policy. |
31289676-bb8d-4dee-b83e-****** |
| FilterKey |
string |
No |
The scheduling type. This parameter is valid only when FilterType is set to crontab. Valid values:
|
dayOfMonth |
| DestRegion |
string |
No |
The destination region of the backup policy. |
cn-hangzhou |
| FilterValue |
string |
No |
The specific value of the filter. |
1 |
| AdvanceDataPolicies |
array<object> |
No |
The details of the data backup policy. |
|
|
object |
No |
The policy details. |
||
| DestType |
string |
No |
The destination type of the backup policy. Valid values:
|
level1 |
| FilterType |
string |
No |
The advanced policy filter type. Valid values:
|
crontab |
| ActionType |
string |
No |
The operation type. Valid values:
|
UPDATE |
| SrcRegion |
string |
No |
The source region of the backup policy. |
cn-shanghai |
| SrcType |
string |
No |
The source type of the backup policy. Valid values:
|
db |
| OnlyPreserveOneEachDay |
boolean |
No |
Specifies whether to retain only one high-frequency backup set per day for backup sets created more than one day ago. |
true |
| RetentionValue |
string |
No |
The number of days before expiration. |
4 |
| PolicyId |
string |
No |
The ID of the advanced policy. You can call the DescribeBackupPolicy operation to query the ID. |
6s67c7i3y8f8p72808p****** |
| FilterKey |
string |
No |
The scheduling type. Valid values:
Note
This parameter is returned only when FilterType is set to crontab. |
backupInterval |
| DestRegion |
string |
No |
The destination region of the backup policy. |
cn-shanghai |
| FilterValue |
string |
No |
The backup cycle. |
180 |
| RetentionType |
string |
No |
The retention period type of the backup set. Valid values:
|
delay |
| StorageClass |
string |
No |
The storage class of the bucket. Valid values:
|
Standard |
| AdvanceIncPolicies |
array<object> |
No |
The destination region of the backup policy. |
|
|
object |
No |
The source region of the backup policy. |
||
| DestType |
string |
No |
The destination type of the backup policy. Valid values:
|
level1 |
| FilterType |
string |
No |
The advanced policy filter type. Valid values:
|
crontab |
| ActionType |
string |
No |
The operation type. Valid values: CREATE, UPDATE, and DELETE. |
CREATE |
| SrcRegion |
string |
No |
The source region of the backup policy. |
cn-hangzhou |
| SrcType |
string |
No |
The source type of the backup policy. Valid values:
|
db |
| OnlyPreserveOneEachDay |
boolean |
No |
Specifies whether to retain only one high-frequency backup set per day for backup sets created more than one day ago. |
true |
| RetentionValue |
string |
No |
The number of days before expiration. |
365 |
| PolicyId |
string |
No |
The ID of the advanced policy. |
1 |
| FilterKey |
string |
No |
The scheduling type. This parameter is valid only when FilterType is set to crontab. Valid values:
|
dayOfMonth |
| DestRegion |
string |
No |
The destination region of the backup policy. |
cn-hangzhou |
| FilterValue |
string |
No |
The specific value of the filter. |
1 |
| RetentionType |
string |
No |
The retention period type. Valid values:
|
delay |
| BackupRetentionPolicyOnClusterDeletion |
string |
No |
The data retention policy for archived backups of deleted instances. Valid values:
|
0 |
| BackupMethod |
string |
No |
The backup method. Valid values:
|
logical |
| BackupPriority |
integer |
No |
The backup policy for secondary instances. Valid values:
Note
This parameter applies only to ApsaraDB RDS for SQL Server instances. For other database engines, the value 0 is returned. |
2 |
| EnableIncBackup |
boolean |
No |
Specifies whether incremental backup is enabled. |
true |
| BackupRetentionPeriod |
integer |
No |
The retention period for basic backups in days. If the advanced backup policy is enabled, this parameter indicates the maximum retention period in the level-1 backup policy. |
7 |
| HighFrequencyBakInterval |
integer |
No |
The interval for high-frequency backups in minutes. For example, a value of 120 indicates that a backup is performed every two hours. |
120 |
| EnableLogBackup |
integer |
No |
Specifies whether log backup is enabled. Valid values:
|
1 |
| LogBackupRetention |
integer |
No |
The retention period for log backups in days. |
7 |
| LogBackupLocalRetentionNumber |
integer |
No |
The number of binary log files to retain. |
10 |
| LocalLogRetentionSpace |
integer |
No |
The maximum space usage for binary logs. |
30 |
| HighSpaceUsageProtection |
string |
No |
Specifies whether to force log cleanup when the instance space usage exceeds 80% or the remaining space is less than 5 GB. Valid values:
Valid values:
|
enable |
| IncBackupInterval |
integer |
No |
The interval for high-frequency incremental backups in minutes. |
120 |
| EnablePitrProtection |
boolean |
No |
Specifies whether point-in-time protection is enabled. |
|
| PreferredBackupDate |
string |
No |
The backup epoch for basic backups. The value is a 7-digit string where each digit from left to right corresponds to a day of the week from Monday to Sunday. A value of 1 indicates that a backup is executed on that day, and 0 indicates that no backup is executed. |
1111111 |
| LogBackupLocalRetention |
integer |
No |
The retention period for binary logs in seconds. |
7 |
| ColdRetention |
integer |
No |
The retention period for cold archives in days. |
10 |
| ColdKeepCount |
integer |
No |
The number of cold archives to retain. |
1 |
| ColdKeepPolicy |
integer |
No |
The data retention policy for cold archives. |
0 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameter details. |
||
| RequestId |
string |
The request ID. |
D570F209-A166-50C6-98A3-155A20B218B7 |
| Message |
string |
The returned message. |
instanceName can not be empty. |
| Data |
object |
The backup policy details. |
|
| PreferredBackupWindowBegin |
string |
The start time of the basic backup window. |
17:00Z |
| PreferredBackupWindow |
string |
The basic backup window. |
17:00Z-18:00Z |
| Category |
string |
Indicates whether backup within seconds is enabled. Valid values:
Note
This parameter takes effect only for MySQL. |
Standard |
| AdvanceLogPolicies |
array<object> |
The policy details. |
|
|
object |
The policy details. |
||
| LogRetentionType |
string |
The log backup retention type. Valid values:
|
delay |
| DestType |
string |
The destination type of the backup policy. Valid values:
|
level1 |
| FilterType |
string |
The filter type of the advanced policy. Valid values:
|
crontab |
| SrcRegion |
string |
The source region of the backup policy. |
cn-beijing |
| EnableLogBackup |
integer |
A reserved parameter. Ignore this parameter. |
1 |
| SrcType |
string |
The source type of the backup policy. Valid values:
|
level1 |
| PolicyId |
string |
The backup policy ID. |
dc13b153acc91141789122c23835**** |
| DestRegion |
string |
The destination region of the backup policy. |
cn-shanghai |
| LogRetentionValue |
string |
The log backup retention period. |
3 |
| FilterKey |
string |
The scheduling type. This parameter is valid only when FilterType is set to crontab. Valid values:
|
dayOfMonth |
| FilterValue |
string |
The backup cycle. |
1 |
| AdvanceDataPolicies |
array<object> |
The details of the data backup policy. |
|
|
object |
The policy details. |
||
| RetentionValue |
string |
The number of days before expiration. |
4 |
| BakType |
string |
The backup type. Valid values:
|
F |
| FilterKey |
string |
The scheduling type. Valid values:
Note
This parameter is returned only when FilterType is set to crontab. |
backupInterval |
| FilterValue |
string |
The backup cycle. |
180 |
| DestType |
string |
The destination type of the backup policy. Valid values:
|
level1 |
| FilterType |
string |
The filter type of the advanced policy. Valid values:
|
crontab |
| SrcRegion |
string |
The source region of the backup policy. |
cn-shanghai |
| AutoCreated |
boolean |
Indicates whether the backup policy is automatically generated by the system. Valid values:
|
false |
| SrcType |
string |
The source type of the backup policy. Valid values:
|
db |
| OnlyPreserveOneEachDay |
boolean |
Indicates whether to retain only one backup per day. Valid values:
|
true |
| DumpAction |
string |
The dump policy details. Valid values:
|
copy |
| PolicyId |
string |
The advanced policy ID. |
dc13b153acc91141789122c23835**** |
| DestRegion |
string |
The destination region of the backup policy. |
cn-shanghai |
| RetentionType |
string |
The retention period type of the backup set. Valid values:
|
delay |
| StorageClass |
string |
The data storage class. |
ARCHIVE |
| AdvanceIncPolicies |
array<object> |
The retention period type. Valid values:
|
|
|
object |
The destination type of the backup policy. Valid values:
|
||
| RetentionValue |
string |
The number of days before expiration. |
365 |
| BakType |
string |
The backup type. F indicates full backup, and L indicates log backup. |
F |
| FilterKey |
string |
The scheduling type. This parameter is valid only when FilterType is set to crontab. Valid values:
|
dayOfMonth |
| FilterValue |
string |
The specific value of the filter. |
1 |
| DestType |
string |
The destination type of the backup policy. Valid values:
|
level1 |
| FilterType |
string |
The advanced policy filter type. Valid values:
|
Crontab |
| SrcRegion |
string |
The source region of the backup policy. |
cn-hangzhou |
| AutoCreated |
boolean |
Indicates whether the policy is automatically generated by the system. |
true |
| SrcType |
string |
The source type of the backup policy. Valid values:
|
db |
| OnlyPreserveOneEachDay |
boolean |
The 24-hour backup data retention policy. Valid values:
|
true |
| DumpAction |
string |
The dump action. Valid values:
|
Copy |
| PolicyId |
string |
The ID of the advanced policy. |
smp-8sv763r9boydzb*** |
| DestRegion |
string |
The destination region of the backup policy. |
cn-hangzhou |
| RetentionType |
string |
The retention period type. Valid values:
|
Delay |
| BackupRetentionPolicyOnClusterDeletion |
string |
The data retention policy for archived backups after an instance is deleted. Valid values:
|
LATEST |
| BackupMethod |
string |
The backup method. Valid values:
|
Physical |
| BackupPriority |
integer |
The backup policy for secondary instances. Valid values:
Note
This parameter applies only to ApsaraDB RDS for SQL Server instances. For other database engines, the value 0 is returned. |
1 |
| EnableIncBackup |
boolean |
Specifies whether incremental backup is enabled. |
true |
| ErrMessage |
string |
The error message. |
The specified parameter %s value is not valid. |
| Code |
string |
The status code. |
Success |
| Success |
string |
Indicates whether the request is successful. Valid values:
|
true |
| ErrCode |
string |
The error code. |
Success |
Examples
Success response
JSON format
{
"RequestId": "D570F209-A166-50C6-98A3-155A20B218B7",
"Message": "instanceName can not be empty.",
"Data": {
"PreferredBackupWindowBegin": "17:00Z",
"PreferredBackupWindow": "17:00Z-18:00Z",
"Category": "Standard",
"AdvanceLogPolicies": [
{
"LogRetentionType": "delay",
"DestType": "level1",
"FilterType": "crontab",
"SrcRegion": "cn-beijing",
"EnableLogBackup": 1,
"SrcType": "level1",
"PolicyId": "dc13b153acc91141789122c23835****",
"DestRegion": "cn-shanghai",
"LogRetentionValue": "3",
"FilterKey": "dayOfMonth",
"FilterValue": "1"
}
],
"AdvanceDataPolicies": [
{
"RetentionValue": "4",
"BakType": "F",
"FilterKey": "backupInterval",
"FilterValue": "180",
"DestType": "level1",
"FilterType": "crontab",
"SrcRegion": "cn-shanghai",
"AutoCreated": false,
"SrcType": "db",
"OnlyPreserveOneEachDay": true,
"DumpAction": "copy",
"PolicyId": "dc13b153acc91141789122c23835****",
"DestRegion": "cn-shanghai",
"RetentionType": "delay",
"StorageClass": "ARCHIVE"
}
],
"AdvanceIncPolicies": [
{
"RetentionValue": "365",
"BakType": "F",
"FilterKey": "dayOfMonth",
"FilterValue": "1",
"DestType": "level1",
"FilterType": "Crontab",
"SrcRegion": "cn-hangzhou",
"AutoCreated": true,
"SrcType": "db",
"OnlyPreserveOneEachDay": true,
"DumpAction": "Copy",
"PolicyId": "smp-8sv763r9boydzb***",
"DestRegion": "cn-hangzhou",
"RetentionType": "Delay"
}
],
"BackupRetentionPolicyOnClusterDeletion": "LATEST",
"BackupMethod": "Physical",
"BackupPriority": 1,
"EnableIncBackup": true
},
"ErrMessage": "The specified parameter %s value is not valid.",
"Code": "Success",
"Success": "true",
"ErrCode": "Success"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | Request.Forbidden | Have no Permissions |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.