ModifyAdvancedBackupPolicy

Updated at:

Modifies the advanced backup policy.

Operation description

Geo-redundancy applies only to cloud disk replica set and cloud disk sharded instances.

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

dds:ModifyAdvancedBackupPolicy

update

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

dds-2zeb2d64cb46xxxx

PreferredBackupTime

string

No

The time period during which the backup is performed. The format is HH:mmZ-HH:mmZ (UTC).

Note

The time range is limited to 1 hour.

09:00Z-10:00Z

SnapshotBackupType

string

No

The snapshot backup type. Valid values:

  • Flash: backup within seconds.

  • Standard: standard backup. This is the default value.

Valid values:

  • Standard :

    Standard backup. This is the default value.

  • Flash :

    Backup within seconds.

Standard

BackupRetentionPolicyOnClusterDeletion

integer

Yes

The backup retention policy. Valid values:

  • 0: All backup sets of the instance are deleted immediately when the instance is released.

  • 1: The last backup set is retained for long-term retention (LTR) when the instance is released.

  • 2: All backup sets are retained for long-term retention (LTR) when the instance is released.

Valid values:

  • 0 :

    All backup sets are deleted immediately.

  • 1 :

    The last backup set is retained for long-term retention (LTR).

  • 2 :

    All backup sets are retained for long-term retention (LTR).

0

AdvancedBackupDataPolicies

array<object>

No

The list of backup policies.

object

No

PolicyId

string

No

The ID of the backup policy.

Important Required when ActionType is not CREATE.

xxxxxx

ActionType

string

Yes

The action. Valid values:

  • CREATE: Creates a policy.

  • UPDATE: Updates a policy.

  • DELETE: Deletes a policy. If this value is specified, only the PolicyId parameter is required.

Valid values:

  • DELETE :

    Deletes a policy.

  • CREATE :

    Creates a policy.

  • UPDATE :

    Updates a policy.

CREATE

RetentionType

string

No

The retention cycle type of the backup set. Valid values:

  • never: long-term retention (LTR).

  • delay: retention for a fixed number of days.

Important Required when ActionType is not DELETE.

Valid values:

  • never :

    Long-term retention (LTR).

  • delay :

    Retention for a fixed number of days.

delay

RetentionPeriod

integer

No

The retention period of the backup plan in days. Valid values:

  • Same-region backup: 7 to 7300 days.

  • Geo-redundancy: 3 to 1825 days.

Important Required when RetentionType is set to delay.

7

BackupPolicy

string

No

The scheduling type of the advanced policy. Valid values:

  • dayOfWeek: scheduled by week.

  • dayOfMonth: scheduled by month.

  • dayOfYear: scheduled by year.

  • backupInterval: scheduled at a fixed interval (high-frequency backup).

Note
  • Multiple high-frequency backup policies are not supported.

  • Multiple geo-redundancy backups are not supported, and geo-redundancy policies only support dayOfWeek.

Important Required when ActionType is not DELETE.

Valid values:

  • dayOfWeek :

    Scheduled by week.

  • dayOfMonth :

    Scheduled by month.

  • dayOfYear :

    Scheduled by year.

  • backupInterval :

    Scheduled at a fixed interval (high-frequency backup).

dayOfWeek

PreferredBackupPeriod

string

No

The backup cycle. Valid values:

  • When BackupPolicy is set to dayOfWeek: 1, 2, 3, 4, 5, 6, and 7 represent Monday to Sunday. At least two backups must be performed per week.

  • When BackupPolicy is set to dayOfMonth: 1, 3, and -1 represent the 1st, 3rd, and last day of each month. -1 represents the last day of the month.

  • When BackupPolicy is set to dayOfYear: 01-07 represents January 7. Only one day can be selected.

  • When BackupPolicy is set to backupInterval: specify one of the following numbers in minutes. For sharded clusters, the valid values are 30, 60, 120, 180, 240, 360, 480, and 720. For replica sets, the valid values are 15, 30, 60, 120, 180, 240, 360, 480, and 720.

Note:

Important Required when ActionType is not DELETE. Geo-redundancy policies only support dayOfWeek.

1,4,6

SrcRegion

string

No

The region where the instance resides.

Important Required when ActionType is not DELETE.

cn-guangzhou

SrcType

string

No

The source type of the backup policy. Valid values:

  • db: same-region backup.

  • level1: cross-region backup.

Important Required when ActionType is not DELETE.

Valid values:

  • level1 :

    Cross-region backup.

  • db :

    Same-region backup.

db

DestRegion

string

No

The destination region of the backup policy.

Important Required when ActionType is not DELETE.

cn-guangzhou

DestType

string

No

The destination type of the backup policy. Valid values:

  • level1: same-region backup.

  • level2Cross: cross-region backup.

Important Required when ActionType is not DELETE.

Valid values:

  • level1 :

    Same-region backup.

  • level2Cross :

    Cross-region backup.

level1

PreserveOneEachHour

boolean

No

Specifies whether to enable hourly sparse backup. Valid values:

  • true: When the backup frequency is in minutes, all snapshots taken within 1 hour from the current time are retained. For snapshots taken more than 1 hour but within 24 hours from the current time, only the first snapshot after the hour is retained.

  • false: All snapshots within the retention period of high-frequency backups are retained.

False

AdvancedBackupLogPolicies

array<object>

No

The list of log backup policies.

object

No

EnableLogBackup

integer

Yes

Specifies whether to enable log backup. Valid values:

  • 1: enabled.

  • 0: disabled.

Note
  • Log backup must be enabled for sharded instances.

  • You must enable same-region log backup before you can enable cross-region log backup.

Valid values:

  • 0 :

    Disabled.

  • 1 :

    Enabled.

1

RetentionType

string

No

The retention cycle type of the log backup. Valid values:

  • never: long-term retention (LTR).

  • delay: retention for a fixed number of days.

Valid values:

  • never :

    Long-term retention (LTR).

  • delay :

    Retention for a fixed number of days.

delay

RetentionPeriod

integer

No

The retention period of the log backup in days. This parameter takes effect when RetentionType is set to delay. Valid values:

  • Same-region backup: 7 to 7300 days.

  • Geo-redundancy: 3 to 1825 days. The value must be less than the backup retention period of the geo-redundancy policy.

7

SrcRegion

string

No

The region where the source instance resides.

cn-hangzhou

SrcType

string

No

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

  • db: same-region backup.

  • level1: cross-region backup.

Valid values:

  • level1 :

    Cross-region backup.

  • db :

    Same-region backup.

db

DestRegion

string

No

The region where the geo-redundancy log backup is stored.

Note

Required for geo-redundancy.

cn-huhehaote

DestType

string

No

The destination type of the log backup policy. Valid values:

  • level1: same-region backup.

  • level2Cross: cross-region backup.

Valid values:

  • level1 :

    Same-region backup.

  • level2Cross :

    Cross-region backup.

level1

PolicyId

string

No

The ID of the log backup policy. This parameter is required only for cross-region log backup policies.

xxxx

ActionType

string

Yes

The operation type. Valid values:

  • CREATE: Creates a policy.

  • UPDATE: Updates a policy.

Important This parameter takes effect only for geo-redundancy. To delete geo-redundancy, set EnableLogBackup to 0 and set ActionType to UPDATE.

Valid values:

  • CREATE :

    Creates a policy.

  • UPDATE :

    Updates a policy.

CREATE

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

2F42BB4E-461F-5B55-A37C-53B1141C****

Examples

Success response

JSON format

{
  "RequestId": "2F42BB4E-461F-5B55-A37C-53B1141C****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidPreferredBackupPeriod.Malformed Specified parameter PreferredBackupPeriod is not valid.
400 InvalidPreferredBackupTime.Malformed Specified parameter PreferredBackupTime is not valid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.