Modifies the automatic backup policy of a PolarDB cluster.
Operation description
You can also modify the automatic backup policy of a PolarDB cluster in the console. For more information, see Backup settings.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:ModifyBackupPolicy |
update |
*dbcluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The cluster ID. Note
You can call the DescribeDBClusters operation to query the information about all clusters in a specific region, including the cluster IDs. |
pc-bp13wz9586voc**** |
| PreferredBackupTime |
string |
No |
The time period during which automatic backups are performed. The time must be in the |
15:00Z-16:00Z |
| PreferredBackupPeriod |
string |
No |
The backup cycle. Valid values:
Note
|
Monday,Tuesday |
| DataLevel1BackupRetentionPeriod |
string |
No |
The retention period of level-1 backups. Valid values: 3 to 14. Unit: days. Note
|
3 |
| DataLevel2BackupRetentionPeriod |
string |
No |
The retention epoch of level-2 backups. Valid values:
Note
|
0 |
| BackupRetentionPolicyOnClusterDeletion |
string |
No |
Specifies whether to retain backups when a cluster is deleted. Valid values:
Note
Default value: NONE. |
NONE |
| BackupFrequency |
string |
No |
The backup frequency. Valid values:
Note
|
Normal |
| DataLevel1BackupFrequency |
string |
No |
The backup frequency. Valid values:
Note
|
Normal |
| DataLevel1BackupTime |
string |
No |
The time period during which automatic backups are performed. The time must be in the Note
|
15:00Z-16:00Z |
| DataLevel1BackupPeriod |
string |
No |
The level-1 backup cycle. Valid values:
Note
|
Monday,Tuesday |
| DataLevel2BackupPeriod |
string |
No |
The level-2 backup cycle. Valid values:
Note
|
Monday,Tuesday |
| DataLevel2BackupAnotherRegionRegion |
string |
No |
The destination region for cross-region level-2 backups. For more information about the regions that support cross-region backup, see Overview. Note
|
cn-hangzhou |
| DataLevel2BackupAnotherRegionRetentionPeriod |
string |
No |
The retention epoch of level-2 cross-region backups. Valid values:
Note
|
30 |
| BackupPolicyLevel |
string |
No |
The level of the backup policy. Valid values:
Note
|
Normal |
| AdvancedDataPolicies |
array<object> |
No |
The advanced backup policy. Note
|
|
|
object |
No |
|||
| PolicyId |
string |
No |
The ID of the backup policy. You can call the DescribeBackupPolicy operation to query the ID. |
71930ac2e9f15e41615e10627c****** |
| ActionType |
string |
No |
The operation type. Valid values:
|
CREATE |
| RetentionType |
string |
No |
The retention period type of the backup set. Valid values:
|
delay |
| RetentionValue |
string |
No |
The number of days for which backups are retained. |
7 |
| FilterType |
string |
No |
The filter type of the advanced policy. Valid values:
|
crontab |
| FilterKey |
string |
No |
The scheduling type. Valid values:
Note
This parameter is required only when FilterType is set to crontab. |
dayOfWeek |
| FilterValue |
string |
No |
The backup cycle. |
1,2,3,4,5,6,7 |
| SrcRegion |
string |
No |
The source region of the backup policy. |
cn-shanghai |
| SrcType |
string |
No |
The source type of the backup policy. Valid values:
|
level1 |
| DestRegion |
string |
No |
The destination region of the backup policy. |
cn-beijing |
| DestType |
string |
No |
The destination type of the backup policy. Valid values:
|
level2 |
| OnlyPreserveOneEachHour |
boolean |
No |
The hourly backup data retention policy. Valid values:
Note
This parameter cannot be modified and is fixed to true. |
true |
| AutoCreated |
boolean |
No |
Specifies whether the backup policy is automatically generated by the system. Note
This parameter is automatically generated. You do not need to specify it. |
false |
| OnlyPreserveOneEachDay |
boolean |
No |
The 24-hour backup data retention policy. Valid values:
|
true |
| DumpAction |
string |
No |
The method to convert level-1 backups to level-2 backups. Valid values:
|
copy |
| BakType |
string |
No |
The backup type. Valid values:
Note
This parameter cannot be modified and is fixed to F. |
F |
| StorageClass |
string |
No |
The storage class used by the advanced backup policy. |
STANDARD |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. The token is case-sensitive. |
123e4567-e89b-12d3-a456-426655440000 |
| DryRun |
boolean |
No |
Specifies whether to perform only a dry run. Valid values: true and false (default). If you set this parameter to true, the system checks your identity and permissions, and validates the request parameters, destination cluster, backup retention period, backup cycle, and specific backup commodity limits. If the dry run succeeds, the system returns the DryRunOperation error code and does not perform actual resource changes or tasks. If the dry run fails, the system returns a corresponding error code, such as InvalidBackupRetentionPeriod.Malformed. For example, if DryRun is set to true and the checks succeed, the returned Code is DryRunOperation. If the checks fail, the returned Code is InvalidBackupRetentionPeriod.Malformed. The dry run does not cover all quota, dependency, or conflict checks in the actual execution phase. A successful dry run does not guarantee that the subsequent actual execution will succeed. If you set this parameter to false, the system performs the actual execution. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
C5A5DF0E-5968-4DC1-882E-AC2FE7****** |
Examples
Success response
JSON format
{
"RequestId": "C5A5DF0E-5968-4DC1-882E-AC2FE7******"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | DryRunOperation | The dry run completed. No operation was performed. | |
| 400 | InvalidDataLevel1BackupRetentionPeriod.Malformed | The specified parameter DataLevel1BackupRetentionPeriod is not valid. | The specified DataLevel1BackupRetentionPeriod parameter is invalid. |
| 400 | InvalidDataLevel2BackupRetentionPeriod.Malformed | The specified parameter DataLevel2BackupRetentionPeriod is not valid. | The specified DataLevel2BackupRetentionPeriod parameter is invalid. |
| 400 | InvalidBackupRetentionPeriod.Malformed | The specified parameter BackupRetentionPeriod is not valid. | The specified BackupRetentionPeriod parameter is invalid. |
| 400 | InvalidBackupFrequency.Malformed | The specified parameter BackupFrequency is not valid. | The specified BackupFrequency parameter is invalid. |
| 400 | InvalidPreferredBackupPeriod.Malformed | The specified parameter PreferredBackupPeriod is not valid. | The specified PreferredBackupPeriod parameter is invalid. |
| 400 | InvalidDataLevel2BackupPeriod.Malformed | The specified parameter DataLevel2BackupPeriod is not valid. | The specified DataLevel2BackupPeriod parameter is invalid. |
| 400 | InvalidDataLevel1BackupPeriod.Malformed | The specified parameter DataLevel1BackupPeriod is not valid. | The specified DataLevel1BackupPeriod parameter is invalid. |
| 400 | InvalidPreferredBackupTime.Malformed | The specified parameter PreferredBackupTime is not valid. | The specified PreferredBackupTime parameter is invalid. |
| 400 | InvalidDataLevel1BackupTime.Malformed | The specified parameter DataLevel1BackupTime is not valid. | The specified DataLevel1BackupTime parameter is invalid. |
| 400 | InvalidDataLevel1BackupFrequency.Malformed | The specified parameter DataLevel1BackupFrequency is not valid. | The specified DataLevel1BackupFrequency parameter is invalid. |
| 400 | InvalidDataLevel2AnotherRegionRegion.NotFound | The specified parameter DataLevel2BackupAnotherRegionRegion does not found. | The specified DataLevel2BackupAnotherRegionRegion parameter cannot be found. |
| 400 | InvalidDataLevel2AnotherRegionBackupRetentionPeriod.Malformed | The specified parameter DataLevel2BackupAnotherRegionRetentionPeriod is not valid. | The specified DataLevel2BackupAnotherRegionRetentionPeriod parameter is invalid. |
| 403 | IncorrectBackupPolicy | Current DB type does not support low frequency backupPolicy operation. | Infrequent access backup operations are not supported by the current database type. |
| 404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
| 404 | InvalidDBClusterId.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
| 404 | InvalidParam | new archiveBackup policy already exists. dumpretention parameter cannot used alone | An archive backup policy has been created. The dumpretation parameter cannot be used alone. |
| 404 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The specified DBClusterId parameter is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.