All Products
Search
Document Center

Database Backup:ModifyBackupPolicy

Last Updated:Dec 10, 2024

Modifies the backup policy of a PolarDB instance.

Operation description

Supported database engines

PolarDB for MySQL

Note This API operation is available only to specific customers. If you want to call this API operation, join the Database Backup (DBS) DingTalk group (ID 35585947) for customer consultation to request permissions.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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
dbs:ModifyBackupPolicyupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionCodestringNo

The region in which backup sets reside.

cn-shanghai
PreferredBackupWindowBeginstringNo

The start time of a basic backup.

17:00Z
InstanceNamestringNo

The ID of the PolarDB instance.

pc-2ze3nrr64c5****
AdvanceDataPoliciesarray<object>No

The information about the data backup policy.

objectNo
ActionTypestringNo

The type of the operation. Valid values:

  • CREATE
  • UPDATE
  • DELETE
UPDATE
PolicyIdstringNo

The ID of the advanced backup policy. You can call the DescribeBackupPolicy operation to query the ID.

6s67c7i3y8f8p72808p******
FilterTypestringNo

The scheduling mode of the advanced backup policy. Valid values:

  • crontab: periodic scheduling.
  • event: event-based scheduling.
crontab
FilterKeystringNo

The scheduling cycle. Valid values:

  • dayOfWeek: scheduling by week.
  • dayOfMonth: scheduling by month.
  • dayOfYear: scheduling by year.
  • backupInterval: scheduling at a specific interval.
Note This parameter takes effect only when FilterType is set to crontab.
backupInterval
FilterValuestringNo

The backup cycle.

180
RetentionTypestringNo

The retention type of backup sets. Valid values:

  • never: Backup sets never expire.
  • delay: Backup sets are retained for a specific number of days.
delay
RetentionValuestringNo

The retention period. Unit: day.

4
SrcTypestringNo

The type of the data source of the backup policy. Valid values:

  • db: database.
  • level1: level-1 backup.
  • level2: level-2 backup.
  • level2Cross: level-2 cross-region backup.
db
SrcRegionstringNo

The region in which the data source of the backup policy resides.

cn-shanghai
DestTypestringNo

The storage method of backup files. Valid values:

  • db: database.
  • level1: level-1 backup.
  • level2: level-2 backup.
  • level2Cross: level-2 cross-region backup.
level1
DestRegionstringNo

The region in which backup files are stored.

cn-shanghai

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

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

The returned message.

instanceName can not be empty.
Dataobject

The details of the backup policy.

PreferredBackupWindowBeginstring

The start time of a basic backup.

17:00Z
PreferredBackupWindowstring

The time period during which a basic backup is performed.

17:00Z-18:00Z
AdvanceDataPoliciesarray<object>

The information about the data backup policy.

AdvanceDataPolicieobject
PolicyIdstring

The ID of the advanced backup policy.

dc13b153acc91141789122c23835****
FilterTypestring

The scheduling mode of the advanced backup policy. Valid values:

  • crontab: periodic scheduling.
  • event: event-based scheduling.
crontab
FilterKeystring

The scheduling cycle. Valid values:

  • dayOfWeek: scheduling by week.
  • dayOfMonth: scheduling by month.
  • dayOfYear: scheduling by year.
  • backupInterval: scheduling at a specific interval.
Note This parameter is returned only when FilterType is set to crontab.
backupInterval
FilterValuestring

The backup cycle.

180
DumpActionstring

The information about the dump policy. Valid values:

  • copy: The backup data is copied from the data source to the destination.
  • move: The backup data is moved from the data source to the destination.
copy
RetentionTypestring

The retention type of backup sets. Valid values:

  • never: Backup sets never expire.
  • delay: Backup sets are retained for a specific number of days.
delay
RetentionValuestring

The retention period. Unit: day.

4
SrcTypestring

The type of the data source of the backup policy. Valid values:

  • db: database.
  • level1: level-1 backup.
  • level2: level-2 backup.
  • level2Cross: level-2 cross-region backup.
db
SrcRegionstring

The region in which the data source of the backup policy resides.

cn-shanghai
DestTypestring

The storage method of backup files. Valid values:

  • db: database.
  • level1: level-1 backup.
  • level2: level-2 backup.
  • level2Cross: level-2 cross-region backup.
level1
DestRegionstring

The region in which backup files are stored.

cn-shanghai
BakTypestring

The backup type. Valid values:

  • F: full backup.
  • L: log backup.
F
AutoCreatedboolean

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

  • true: The backup policy is generated by the system.
  • false: The backup policy is a custom one.
false
ErrMessagestring

The error message returned if the request failed.

The specified parameter %s value is not valid.
Codestring

The response code.

Success
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
true
ErrCodestring

The error code returned if the request failed.

Success

Examples

Sample success responses

JSONformat

{
  "RequestId": "D570F209-A166-50C6-98A3-155A20B218B7",
  "Message": "instanceName can not be empty.",
  "Data": {
    "PreferredBackupWindowBegin": "17:00Z",
    "PreferredBackupWindow": "17:00Z-18:00Z",
    "AdvanceDataPolicies": [
      {
        "PolicyId": "dc13b153acc91141789122c23835****",
        "FilterType": "crontab",
        "FilterKey": "backupInterval",
        "FilterValue": "180",
        "DumpAction": "copy",
        "RetentionType": "delay",
        "RetentionValue": "4",
        "SrcType": "db",
        "SrcRegion": "cn-shanghai",
        "DestType": "level1",
        "DestRegion": "cn-shanghai",
        "BakType": "F",
        "AutoCreated": false
      }
    ]
  },
  "ErrMessage": "The specified parameter %s value is not valid.",
  "Code": "Success",
  "Success": "true",
  "ErrCode": "Success"
}

Error codes

HTTP status codeError codeError message
403Request.ForbiddenHave no Permissions

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

Change history

Change timeSummary of changesOperation
2024-09-24The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-05-28The internal configuration of the API is changed, but the call is not affectedView Change Details