All Products
Search
Document Center

Data Management:ModifyBackupPolicy

Last Updated:Sep 15, 2025

Modifies the backup policy for a PolarDB instance.

Operation description

Applicable engines

PolarDB for MySQL

Note

This API is available only to specific customers. To request access, you can join the DBS customer DingTalk group (ID: 35585947).

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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.

PreferredBackupWindowBegin

string

No

The start time of the backup window.

InstanceName

string

No

The ID of the PolarDB instance.

Category

string

No

The backup type.

  • Flash: second-level backup

  • Standard: standard backup

AdvanceLogPolicies

array<object>

No

object

No

LogRetentionType

string

No

DestType

string

No

FilterType

string

No

ActionType

string

No

SrcRegion

string

No

EnableLogBackup

integer

No

SrcType

string

No

LogRetentionValue

string

No

PolicyId

string

No

FilterKey

string

No

DestRegion

string

No

FilterValue

string

No

AdvanceDataPolicies

array<object>

No

The details of the data backup policy.

object

No

The details of the policy.

DestType

string

No

The destination type of the backup policy. Valid values:

  • db: database

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: level-2 cross-region backup

FilterType

string

No

The filter type for the advanced policy. Valid values:

  • crontab: recurring schedule

  • event: event-based schedule

ActionType

string

No

The operation type. Valid values:

  • CREATE: adds a policy

  • UPDATE: modifies a policy

  • DELETE: deletes a policy

SrcRegion

string

No

The source region of the backup policy.

SrcType

string

No

The source type of the backup policy. Valid values:

  • db: database

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: level-2 cross-region backup

OnlyPreserveOneEachDay

boolean

No

Specifies whether to retain only one backup set per day for high-frequency backups that are more than one day old.

RetentionValue

string

No

The retention period in days.

PolicyId

string

No

The ID of the advanced policy. For more information, see DescribeBackupPolicy.

FilterKey

string

No

The scheduling type. Valid values:

  • dayOfWeek: weekly schedule

  • dayOfMonth: monthly schedule

  • dayOfYear: yearly schedule

  • backupInterval: fixed interval schedule

Note

This parameter is returned only when FilterType is set to crontab.

DestRegion

string

No

The destination region of the backup policy.

FilterValue

string

No

The backup cycle.

RetentionType

string

No

The retention period type for the backup set. Valid values:

  • never: never expires

  • delay: expires after a fixed number of days

StorageClass

string

No

AdvanceIncPolicies

array<object>

No

object

No

DestType

string

No

FilterType

string

No

ActionType

string

No

SrcRegion

string

No

SrcType

string

No

OnlyPreserveOneEachDay

boolean

No

RetentionValue

string

No

PolicyId

string

No

FilterKey

string

No

DestRegion

string

No

FilterValue

string

No

RetentionType

string

No

BackupRetentionPolicyOnClusterDeletion

string

No

BackupMethod

string

No

BackupPriority

integer

No

EnableIncBackup

boolean

No

Response elements

Element

Type

Description

Example

object

The details of the returned parameters.

RequestId

string

The request ID.

Message

string

The returned message.

Data

object

The details of the backup policy.

PreferredBackupWindowBegin

string

The start time of the backup window.

PreferredBackupWindow

string

The backup window.

Category

string

Indicates whether second-level backup is enabled. Returned values:

  • Flash: Second-level backup is enabled.

  • Standard: Standard backup is used.

Note

This parameter is valid only for MySQL.

AdvanceLogPolicies

array<object>

object

LogRetentionType

string

DestType

string

FilterType

string

SrcRegion

string

EnableLogBackup

integer

SrcType

string

PolicyId

string

DestRegion

string

LogRetentionValue

string

FilterKey

string

FilterValue

string

AdvanceDataPolicies

array<object>

The details of the data backup policy.

object

The details of the policy.

RetentionValue

string

The retention period in days.

BakType

string

The backup type. Returned values:

  • F: full backup

  • L: log backup

FilterKey

string

The scheduling type. Returned values:

  • dayOfWeek: weekly schedule

  • dayOfMonth: monthly schedule

  • dayOfYear: yearly schedule

  • backupInterval: fixed interval schedule

Note

This parameter is returned only when FilterType is set to crontab.

FilterValue

string

The backup cycle.

DestType

string

The destination type of the backup policy. Returned values:

  • db: database

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: level-2 cross-region backup

FilterType

string

The filter type for the advanced policy. Returned values:

  • crontab: recurring schedule

  • event: event-based schedule

SrcRegion

string

The source region of the backup policy.

AutoCreated

boolean

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

  • true: The policy is generated by the system.

  • false: The policy is a custom policy.

SrcType

string

The source type of the backup policy. Returned values:

  • db: database

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: level-2 cross-region backup

OnlyPreserveOneEachDay

boolean

Indicates whether to retain only one backup per day.

  • true: Only one backup is retained per day.

  • false: All backups are retained.

DumpAction

string

The details of the dump policy. Returned values:

  • copy: copy

  • move: dump

PolicyId

string

The ID of the advanced policy.

DestRegion

string

The destination region of the backup policy.

RetentionType

string

The retention period type for the backup set. Returned values:

  • never: never expires

  • delay: expires after a fixed number of days

StorageClass

string

AdvanceIncPolicies

array<object>

object

RetentionValue

string

BakType

string

FilterKey

string

FilterValue

string

DestType

string

FilterType

string

SrcRegion

string

AutoCreated

boolean

SrcType

string

OnlyPreserveOneEachDay

boolean

DumpAction

string

PolicyId

string

DestRegion

string

RetentionType

string

BackupRetentionPolicyOnClusterDeletion

string

BackupMethod

string

BackupPriority

integer

EnableIncBackup

boolean

ErrMessage

string

The error message.

Code

string

The status code.

Success

string

Indicates whether the request was successful. Returned values:

  • true: The request was successful.

  • false: The request failed.

ErrCode

string

The error code.

Examples

Success response

JSON format

{
  "RequestId": "",
  "Message": "",
  "Data": {
    "PreferredBackupWindowBegin": "",
    "PreferredBackupWindow": "",
    "Category": "",
    "AdvanceLogPolicies": [
      {
        "LogRetentionType": "",
        "DestType": "",
        "FilterType": "",
        "SrcRegion": "",
        "EnableLogBackup": 0,
        "SrcType": "",
        "PolicyId": "",
        "DestRegion": "",
        "LogRetentionValue": "",
        "FilterKey": "",
        "FilterValue": ""
      }
    ],
    "AdvanceDataPolicies": [
      {
        "RetentionValue": "",
        "BakType": "",
        "FilterKey": "",
        "FilterValue": "",
        "DestType": "",
        "FilterType": "",
        "SrcRegion": "",
        "AutoCreated": true,
        "SrcType": "",
        "OnlyPreserveOneEachDay": true,
        "DumpAction": "",
        "PolicyId": "",
        "DestRegion": "",
        "RetentionType": "",
        "StorageClass": ""
      }
    ],
    "AdvanceIncPolicies": [
      {
        "RetentionValue": "",
        "BakType": "",
        "FilterKey": "",
        "FilterValue": "",
        "DestType": "",
        "FilterType": "",
        "SrcRegion": "",
        "AutoCreated": true,
        "SrcType": "",
        "OnlyPreserveOneEachDay": true,
        "DumpAction": "",
        "PolicyId": "",
        "DestRegion": "",
        "RetentionType": ""
      }
    ],
    "BackupRetentionPolicyOnClusterDeletion": "",
    "BackupMethod": "",
    "BackupPriority": 0,
    "EnableIncBackup": true
  },
  "ErrMessage": "",
  "Code": "",
  "Success": "",
  "ErrCode": ""
}

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.