ModifyBackupPolicy

更新时间:
复制 MD 格式

Modifies the backup policy of a PolarDB instance.

Operation description

Applicable engine

PolarDB for MySQL

Note

This operation is currently available only to specific customers. To use this operation, submit a request in the DBS customer consultation group (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 resides.

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: backup within seconds

  • Standard: basic backup.

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: never expires

  • Delay: expires after a fixed number of days.

Never

DestType

string

No

The destination type of the backup policy. Valid values:

  • db: database

  • level1: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

level1

FilterType

string

No

The advanced policy filter type. Valid values:

  • Crontab: periodic scheduling

  • Event: event-based scheduling.

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: Enabled.

  • 0: Disabled.

1

SrcType

string

No

The source type of the backup policy. Valid values:

  • db: database

  • level1: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

db

LogRetentionValue

string

No

The number of days before expiration.

30

PolicyId

string

No

The advanced policy ID.

31289676-bb8d-4dee-b83e-******

FilterKey

string

No

The scheduling type. This parameter is valid only when FilterType is set to crontab. Valid values:

  • dayOfWeek: weekly scheduling

  • dayOfMonth: monthly scheduling

  • dayOfYear: yearly scheduling

  • backupInterval: fixed interval scheduling.

dayOfMonth

DestRegion

string

No

The destination region of the backup policy.

cn-hangzhou

FilterValue

string

No

The specific filter value.

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:

  • db: database

  • level1: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

level1

FilterType

string

No

The advanced policy filter type. Valid values:

  • crontab: periodic scheduling

  • event: event-based scheduling.

crontab

ActionType

string

No

The operation type. Valid values:

  • CREATE: Create.

  • UPDATE: Update.

  • DELETE: Delete.

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: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

db

OnlyPreserveOneEachDay

boolean

No

Specifies whether to retain only one high-frequency backup set per day for backups older than one day.

true

RetentionValue

string

No

The number of days before expiration.

4

PolicyId

string

No

The advanced policy ID. You can call DescribeBackupPolicy to query this value.

6s67c7i3y8f8p72808p******

FilterKey

string

No

The scheduling type. Valid values:

  • dayOfWeek: weekly scheduling

  • dayOfMonth: monthly scheduling

  • dayOfYear: yearly scheduling

  • backupInterval: fixed interval scheduling

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:

  • never: Never expires.

  • delay: Expires after a fixed number of days.

delay

StorageClass

string

No

The storage class of the bucket. Valid values:

  • Standard (default): Standard storage.

  • IA: Infrequent Access storage.

  • Archive: Archive storage.

  • ColdArchive: Cold Archive storage.

  • DeepColdArchive: Deep Cold Archive storage.

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:

  • db: database

  • level1: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

level1

FilterType

string

No

The advanced policy filter type. Valid values:

  • Crontab: periodic scheduling

  • Event: event-based scheduling.

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

  • level1: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

db

OnlyPreserveOneEachDay

boolean

No

Specifies whether to retain only one high-frequency backup set per day for backups older than one day.

true

RetentionValue

string

No

The number of days before expiration.

365

PolicyId

string

No

The advanced policy ID.

1

FilterKey

string

No

The scheduling type. This parameter is valid only when FilterType is set to crontab. Valid values:

  • dayOfWeek: weekly scheduling

  • dayOfMonth: monthly scheduling

  • dayOfYear: yearly scheduling

  • backupInterval: fixed interval scheduling.

dayOfMonth

DestRegion

string

No

The destination region of the backup policy.

cn-hangzhou

FilterValue

string

No

The specific filter value.

1

RetentionType

string

No

The retention period type. Valid values:

  • Never: never expires

  • Delay: expires after a fixed number of days.

delay

BackupRetentionPolicyOnClusterDeletion

string

No

The archive backup data retention policy for deleted instances. Valid values:

  • NONE: Not retained.

  • LATEST: Only the last backup is retained.

  • ALL: All backups are retained.

0

BackupMethod

string

No

The backup method. Valid values:

  • logical: logical backup

  • physical: physical backup.

logical

BackupPriority

integer

No

The backup policy for the secondary instance. Valid values:

  • 1: Secondary instance preferred.

  • 2: Primary instance forced.

Note

This parameter applies only to ApsaraDB RDS for SQL Server instances. For other engines, the value 0 is returned.

2

EnableIncBackup

boolean

No

Specifies whether to enable incremental backup.

true

Response elements

Element

Type

Description

Example

object

The response parameters.

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:

  • Flash: Backup within seconds is enabled.

  • Standard: Basic backup.

Note

This parameter applies only to MySQL.

Standard

AdvanceLogPolicies

array<object>

The policy details.

object

The policy details.

LogRetentionType

string

The retention type for log backups. Valid values:

delay

DestType

string

The destination type of the backup policy. Valid values:

level1

FilterType

string

The filter type for the advanced policy. Valid values:

  • crontab: Recurring schedule.

  • event: Event-based schedule.

crontab

SrcRegion

string

The source region of the backup policy.

cn-beijing

EnableLogBackup

integer

This parameter is reserved.

1

SrcType

string

The source type of the backup policy. Valid values:

level1

PolicyId

string

The ID of the backup policy.

dc13b153acc91141789122c23835****

DestRegion

string

The destination region of the backup policy.

cn-shanghai

LogRetentionValue

string

The retention period for log backups, in days.

3

FilterKey

string

The scheduling type. This parameter applies only when FilterType is set to crontab. Valid values:

dayOfMonth

FilterValue

string

The value of the filter.

1

AdvanceDataPolicies

array<object>

The details of the data backup policy.

object

The policy details.

RetentionValue

string

The retention period in days.

4

BakType

string

The backup type. Valid values:

  • F: Full backup.

  • L: Log backup.

F

FilterKey

string

The scheduling type. Valid values:

  • dayOfWeek: Weekly schedule.

  • dayOfMonth: Monthly schedule.

  • dayOfYear: Yearly schedule.

  • backupInterval: Fixed interval schedule.

Note

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

backupInterval

FilterValue

string

The value of the filter.

180

DestType

string

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

The filter type for the advanced policy. Valid values:

  • crontab: Recurring schedule.

  • event: Event-based schedule.

crontab

SrcRegion

string

The source region of the backup policy.

cn-shanghai

AutoCreated

boolean

Specifies whether the policy is automatically generated by the system. Valid 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. Valid values:

  • db: Database

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: level-2 cross-region backup

db

OnlyPreserveOneEachDay

boolean

Specifies whether to retain only one backup set per day. Valid values:

  • true: Only one backup set is retained per day.

  • false: All backup sets are retained.

true

DumpAction

string

The dump operation. Valid values:

  • copy: Copy

  • move: Move

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

  • Never: The backup set never expires.

  • Delay: The backup set expires after a specified number of days.

delay

StorageClass

string

The storage class.

ARCHIVE

AdvanceIncPolicies

array<object>

The retention period type. Valid values:

  • Never: never expires

  • Delay: expires after a fixed number of days.

object

The destination type of the backup policy. Valid values:

  • db: database

  • level1: primary backup

  • level2: secondary backup

  • level2Cross: secondary cross-region backup.

RetentionValue

string

The retention period in days.

365

BakType

string

The backup type. Valid values:

F

FilterKey

string

The scheduling type. This parameter applies only when FilterType is set to crontab. Valid values:

dayOfMonth

FilterValue

string

The value of the filter.

1

DestType

string

The destination type of the backup policy. Valid values:

level1

FilterType

string

The filter type for the advanced policy. 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. Valid values:

true

SrcType

string

The source type of the backup policy. Valid values:

db

OnlyPreserveOneEachDay

boolean

Specifies whether to retain only one backup set per day. Valid values:

  • true: Only one backup set is retained per day.

  • false: All backup sets are retained.

true

DumpAction

string

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

Delay

BackupRetentionPolicyOnClusterDeletion

string

The archive backup data retention policy for deleted instances. Valid values:

  • NONE: Not retained.

  • LATEST: Only the last backup is retained.

  • ALL: All backups are retained.

LATEST

BackupMethod

string

The backup method. Valid values:

  • Physical: physical backup

  • Snapshot: snapshot backup.

Physical

BackupPriority

integer

The backup policy for the secondary instance. Valid values:

  • 1: Secondary instance preferred.

  • 2: Primary instance forced.

Note

This parameter applies only to ApsaraDB RDS for SQL Server instances. For other engines, the value 0 is returned.

1

EnableIncBackup

boolean

Specifies whether to enable incremental backup.

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 was successful. Valid 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": "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.