All Products
Search
Document Center

Data Management:ModifyBackupPolicy

Last Updated:Jan 26, 2026

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.

cn-shanghai

PreferredBackupWindowBegin

string

No

The start time of the backup window.

17:00Z

InstanceName

string

No

The ID of the PolarDB instance.

pc-2ze3nrr64c5****

Category

string

No

The backup type.

  • Flash: second-level backup

  • Standard: standard backup

Flash

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

level1

FilterType

string

No

The filter type for the advanced policy. Valid values:

  • crontab: recurring schedule

  • event: event-based schedule

crontab

ActionType

string

No

The operation type. Valid values:

  • CREATE: adds a policy

  • UPDATE: modifies a policy

  • DELETE: deletes a policy

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: database

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: level-2 cross-region backup

db

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.

4

PolicyId

string

No

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

6s67c7i3y8f8p72808p******

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.

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 for the backup set. Valid values:

  • never: never expires

  • delay: expires after a fixed number of days

delay

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.

D570F209-A166-50C6-98A3-155A20B218B7

Message

string

The returned message.

instanceName can not be empty.

Data

object

The details of the backup policy.

PreferredBackupWindowBegin

string

The start time of the backup window.

17:00Z

PreferredBackupWindow

string

The backup window.

17:00Z-18:00Z

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.

Standard

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.

4

BakType

string

The backup type. Returned values:

  • F: full backup

  • L: log backup

F

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.

backupInterval

FilterValue

string

The backup cycle.

180

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

level1

FilterType

string

The filter type for the advanced policy. Returned values:

  • crontab: recurring schedule

  • event: event-based schedule

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. Returned values:

  • true: The policy is generated by the system.

  • false: The policy is a custom policy.

false

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

db

OnlyPreserveOneEachDay

boolean

Indicates whether to retain only one backup per day.

  • true: Only one backup is retained per day.

  • false: All backups are retained.

true

DumpAction

string

The details of the dump policy. Returned values:

  • copy: copy

  • move: dump

copy

PolicyId

string

The ID of the advanced policy.

dc13b153acc91141789122c23835****

DestRegion

string

The destination region of the backup policy.

cn-shanghai

RetentionType

string

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

  • never: never expires

  • delay: expires after a fixed number of days

delay

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.

The specified parameter %s value is not valid.

Code

string

The status code.

Success

Success

string

Indicates whether the request was successful. Returned values:

  • true: The request was successful.

  • false: The request failed.

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": "",
        "DestType": "",
        "FilterType": "",
        "SrcRegion": "",
        "EnableLogBackup": 0,
        "SrcType": "",
        "PolicyId": "",
        "DestRegion": "",
        "LogRetentionValue": "",
        "FilterKey": "",
        "FilterValue": ""
      }
    ],
    "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": ""
      }
    ],
    "AdvanceIncPolicies": [
      {
        "RetentionValue": "",
        "BakType": "",
        "FilterKey": "",
        "FilterValue": "",
        "DestType": "",
        "FilterType": "",
        "SrcRegion": "",
        "AutoCreated": false,
        "SrcType": "",
        "OnlyPreserveOneEachDay": false,
        "DumpAction": "",
        "PolicyId": "",
        "DestRegion": "",
        "RetentionType": ""
      }
    ],
    "BackupRetentionPolicyOnClusterDeletion": "",
    "BackupMethod": "",
    "BackupPriority": 0,
    "EnableIncBackup": false
  },
  "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.