All Products
Search
Document Center

PolarDB:ModifyBackupPolicy

Last Updated:Oct 10, 2024

Modifies the automatic backup policy of a PolarDB cluster.

Operation description

Note You can also modify the automatic backup policy of a PolarDB cluster in the console. For more information, see Backup settings.

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
polardb:ModifyBackupPolicyupdate
  • dbcluster
    acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query information about all clusters that are deployed in a specified region, such as the cluster ID.
pc-bp13wz9586voc****
PreferredBackupTimestringNo

The time period during which automatic backup for level-1 backup is performed. The format is hh:mmZ-hh:mmZ format. The time is displayed in UTC. The start time and end time are on the hour and with an interval of one hour. Example: 14:00Z-15:00Z.

15:00Z-16:00Z
PreferredBackupPeriodstringNo

The backup cycle. Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
Note
  • You need to specify at least two values. Separate multiple values with commas (,).
  • This parameter is invalid if the region where your PolarDB for MySQL cluster is deployed supports the cross-region backup feature. For information about the regions that support the cross-region backup feature, see Overview .
  • Monday,Tuesday
    DataLevel1BackupRetentionPeriodstringNo

    The retention period of level-1 backups. Valid values: 3 to 14. Unit: days.

    3
    DataLevel2BackupRetentionPeriodstringNo

    The retention period of level-2 backups. Valid values:

    • 0: The level-2 backup feature is disabled.
    • 30 to 7300: Level-2 backups are retained for 30 to 7,300 days.
    • 1: Level-2 backups are permanently retained.
    Note The default value of this parameter is 0.
    0
    BackupRetentionPolicyOnClusterDeletionstringNo

    Specifies whether to retain backups when a cluster is deleted. Valid values:

    • ALL: permanently retains all backups.
    • LATEST: permanently retains the most recent backup.
    • NONE: does not retain backups.
    Note The default value of the parameter is NONE.
    NONE
    BackupFrequencystringNo

    The backup frequency. Default value: Normal. Valid values:

    • Normal: standard backup. The system backs up data once a day.
    • 2/24H: enhanced backup. The system backs up data every 2 hours.
    • 3/24H: enhanced backup. The system backs up data every 3 hours.
    • 4/24H: enhanced backup. The system backs up data every 4 hours.
    Note
  • If you enable enhanced backup, all backups are retained for 24 hours. For backup files that are created earlier than the previous 24 hours, the system permanently retains only the first backup that is created after 00:00 every day and deletes the rest.
  • If you enable enhanced backup, PreferredBackupPeriod is automatically set to all days in a week (from Monday to Sunday).
  • This parameter is invalid if the region where your PolarDB for MySQL cluster is deployed supports the cross-region backup feature. For information about the regions that support the cross-region backup feature, see Overview .
  • Normal
    DataLevel1BackupFrequencystringNo

    The frequency of level-1 backups. Default value: Normal. Valid values:

    • Normal: standard backup. The system backs up data once a day.
    • 2/24H: enhanced backup. The system backs up data every 2 hours.
    • 3/24H: enhanced backup. The system backs up data every 3 hours.
    • 4/24H: enhanced backup. The system backs up data every 4 hours.
    Note
  • This parameter is invalid for PolarDB for Oracle clusters or PolarDB for PostgreSQL clusters.
  • This parameter is invalid if the region where your PolarDB for MySQL cluster is deployed does not support the cross-region backup feature. For information about the regions that support the cross-region backup feature, see Overview .
  • Normal
    DataLevel1BackupTimestringNo

    The time period during which automatic backup for level-1 backup is performed. The time period is in the hh:mmZ-hh:mmZ format and is displayed in UTC. The start time and end time are on the hour and have an interval of 1 hour. Example: 14:00Z-15:00Z.

    Note
  • This parameter is invalid for PolarDB for Oracle clusters or PolarDB for PostgreSQL clusters.
  • This parameter is invalid if the region where your PolarDB for MySQL cluster is deployed does not support the cross-region backup feature. For information about the regions that support the cross-region backup feature, see Overview .
  • 15:00Z-16:00Z
    DataLevel1BackupPeriodstringNo

    The backup cycle of level-1 backups. Valid values:

    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday
    • Sunday
    Note
  • You need to specify at least two values. Separate multiple values with commas (,).
  • This parameter is invalid for PolarDB for Oracle clusters or PolarDB for PostgreSQL clusters.
  • This parameter is invalid if the region where your PolarDB for MySQL cluster is deployed does not support the cross-region backup feature. For information about the regions that support the cross-region backup feature, see Overview .
  • Monday,Tuesday
    DataLevel2BackupPeriodstringNo

    The backup cycle of level-2 backups. Valid values:

    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday
    • Sunday
    Note
  • You need to specify at least two values. Separate multiple values with commas (,).
  • This parameter is invalid for PolarDB for Oracle clusters or PolarDB for PostgreSQL clusters.
  • This parameter is invalid if the region where your PolarDB for MySQL cluster is deployed does not support the cross-region backup feature. For information about the regions that support the cross-region backup feature, see Overview .
  • Monday,Tuesday
    DataLevel2BackupAnotherRegionRegionstringNo

    The region where the cross-region level-2 backup is stored. For information about regions that support the cross-region backup feature, see Overview .

    cn-hangzhou
    DataLevel2BackupAnotherRegionRetentionPeriodstringNo

    The retention period of cross-region level-2 backups. Valid values:

    • 0: The cross-region level-2 backup feature is disabled.
    • 30 to 7300: Cross-region level-2 backups are retained for 30 to 7,300 days.
    • 1: Cross-region level-2 backups are permanently retained.
    Note The default value of the parameter is 0.
    30

    Response parameters

    ParameterTypeDescriptionExample
    object
    RequestIdstring

    The ID of the request.

    C5A5DF0E-5968-4DC1-882E-AC2FE7******

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "C5A5DF0E-5968-4DC1-882E-AC2FE7******"
    }

    Error codes

    HTTP status codeError codeError messageDescription
    400InvalidDataLevel1BackupRetentionPeriod.MalformedThe specified parameter DataLevel1BackupRetentionPeriod is not valid.The specified DataLevel1BackupRetentionPeriod parameter is invalid.
    400InvalidDataLevel2BackupRetentionPeriod.MalformedThe specified parameter DataLevel2BackupRetentionPeriod is not valid.The specified DataLevel2BackupRetentionPeriod parameter is invalid.
    400InvalidBackupRetentionPeriod.MalformedThe specified parameter BackupRetentionPeriod is not valid.The specified BackupRetentionPeriod parameter is invalid.
    400InvalidBackupFrequency.MalformedThe specified parameter BackupFrequency is not valid.The specified BackupFrequency parameter is invalid.
    400InvalidPreferredBackupPeriod.MalformedThe specified parameter PreferredBackupPeriod is not valid.The specified PreferredBackupPeriod parameter is invalid.
    400InvalidDataLevel2BackupPeriod.MalformedThe specified parameter DataLevel2BackupPeriod is not valid.The specified DataLevel2BackupPeriod parameter is invalid.
    400InvalidDataLevel1BackupPeriod.MalformedThe specified parameter DataLevel1BackupPeriod is not valid.The specified DataLevel1BackupPeriod parameter is invalid.
    400InvalidPreferredBackupTime.MalformedThe specified parameter PreferredBackupTime is not valid.The specified PreferredBackupTime parameter is invalid.
    400InvalidDataLevel1BackupTime.MalformedThe specified parameter DataLevel1BackupTime is not valid.The specified DataLevel1BackupTime parameter is invalid.
    400InvalidDataLevel1BackupFrequency.MalformedThe specified parameter DataLevel1BackupFrequency is not valid.The specified DataLevel1BackupFrequency parameter is invalid.
    400InvalidDataLevel2AnotherRegionRegion.NotFoundThe specified parameter DataLevel2BackupAnotherRegionRegion does not found.The specified DataLevel2BackupAnotherRegionRegion parameter cannot be found.
    400InvalidDataLevel2AnotherRegionBackupRetentionPeriod.MalformedThe specified parameter DataLevel2BackupAnotherRegionRetentionPeriod is not valid.The specified DataLevel2BackupAnotherRegionRetentionPeriod parameter is invalid.
    403IncorrectBackupPolicyCurrent DB type does not support low frequency backupPolicy operation.Infrequent access backup operations are not supported by the current database type.
    404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
    404InvalidDBClusterId.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
    404InvalidParamnew archiveBackup policy already exists. dumpretention parameter cannot used aloneAn archive backup policy has been created. The dumpretation parameter cannot be used alone.
    404InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The specified DBClusterId parameter is invalid.

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

    Change history

    Change timeSummary of changesOperation
    2023-09-12The Error code has changedView Change Details
    2022-07-13The Error code has changedView Change Details
    2022-06-01The Error code has changed. The request parameters of the API has changedView Change Details
    2021-03-02The Error code has changed. The request parameters of the API has changedView Change Details