ModifyBackupPolicy

Updated at:

Modifies the backup policy of a MongoDB instance.

Operation description

Cross-region backup is applicable only to replica set and sharded cluster instances that use cloud disks.

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

update

*Instance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

dds-bp16cb162771****

PreferredBackupTime

string

No

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

Note

The time period is limited to 1 hour.

03:00Z-04:00Z

PreferredBackupPeriod

string

No

The backup cycle. Valid values:

  • Monday: Monday.

  • Tuesday: Tuesday.

  • Wednesday: Wednesday.

  • Thursday: Thursday.

  • Friday: Friday.

  • Saturday: Saturday.

  • Sunday: Sunday.

Important To ensure data security, back up your MongoDB data at least twice a week.
Note

If you specify multiple values, separate them with commas (,).

Monday,Wednesday,Friday,Sunday

BackupRetentionPeriod

integer

No

The number of days for which full backups are retained.

Note
  • For users who created instances before September 10, 2021, the default retention period is 7 days.

  • For new users who created instances on or after September 10, 2021, the default retention period is 30 days.

30

EnableBackupLog

integer

No

Specifies whether to enable log backup. Valid values:

  • 0: Disables log backup. This is the default value.

  • 1: Enables log backup.

    Important Sharded cluster instances do not support disabling log backup.

0

LogBackupRetentionPeriod

integer

No

The number of days for which log backups are retained. Default value: 7.

Valid values: 7 to 730.

7

SnapshotBackupType

string

No

The snapshot backup type. Valid values:

  • Flash: Backup within seconds.

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

Standard

BackupInterval

string

No

The high-frequency backup frequency. Valid values:

  • -1: Disables high-frequency backups.

  • 30: Every 30 minutes.

  • 60: Every 1 hour.

  • 120: Every 2 hours.

  • 180: Every 3 hours.

  • 240: Every 4 hours.

  • 360: Every 6 hours.

  • 480: Every 8 hours.

  • 720: Every 12 hours.

Note
  • If SnapshotBackupType is set to Standard, this parameter must be set to -1.

  • If SnapshotBackupType is set to Flash and this parameter is set to a value greater than 0, high-frequency backups take effect.

-1

HighFrequencyBackupRetention

integer

No

The number of days for which high-frequency backups are retained. Before you use this parameter, make sure that the BackupInterval parameter is specified. Default value: 1.

1

BackupRetentionPolicyOnClusterDeletion

integer

No

The backup data retention policy. Valid values:

  • 0: Deletes all backup sets of the instance immediately when the instance is released.

  • 1: An automatic backup is performed when the instance is released, and the backup set is retained for long-term retention (LTR).

  • 2: An automatic backup is performed when the instance is released, and all backup sets of the cluster are retained for long-term retention (LTR).

For more information, see Long-term retention backups.

2

CrossBackupType

string

No

The operation policy for cross-region backup. Valid values:

  • update: Modifies the cross-region backup policy.

  • delete: Deletes the cross-region backup policy.

Note

This parameter is required for cross-region backup.

update

SrcRegion

string

No

The region where the instance is deployed.

Note
  • This parameter is required to recover deleted instances.

  • This parameter is required for cross-region backup.

cn-beijing

DestRegion

string

No

The region where backups are stored.

Note

This parameter is required for cross-region backup.

cn-hangzhou

CrossRetentionType

string

No

The retention type for cross-region backup. Valid values:

  • delay: Retains backups for a specified period.

  • never: Never expires.

Note

This parameter is required for cross-region backup.

delay

CrossRetentionValue

integer

No

The retention period for cross-region backup. Valid values: 3 to 1825 days.

Note
  • This parameter is required for cross-region backup.

  • This parameter is required and must be specified when CrossRetentionType is set to delay.

7

CrossBackupPeriod

string

No

The days of the week when cross-region backup is performed. Valid values:

  1. Monday: Monday.

  2. Tuesday: Tuesday.

  3. Wednesday: Wednesday.

  4. Thursday: Thursday.

  5. Friday: Friday.

  6. Saturday: Saturday.

  7. Sunday: Sunday.

Note

This parameter is required for cross-region backup.

  • If you specify multiple values, separate them with commas (,).

  • When the backup settings are set to standard backup, the value must be a subset of the PreferredBackupPeriod backup epoch.

Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday

EnableCrossLogBackup

integer

No

Specifies whether to enable cross-region log backup.

Note

This parameter is required for cross-region backup.

  • 1: Enables cross-region log backup. This value is required for sharded cluster instances. For replica set instances, this value is required if you want to support cross-region point-in-time recovery.

  • 0: Disables cross-region log backup.

1

CrossLogRetentionType

string

No

The retention type for cross-region log backup. Valid values:

  • delay: Retains backups for a specified period.

  • never: Never expires.

Note

This parameter is required for cross-region backup.

delay

CrossLogRetentionValue

integer

No

The retention period for cross-region log backup. Valid values: 3 to 1825 days. The value must be less than or equal to the value of CrossRetentionValue.

Note

This parameter is required for cross-region backup.

3

InstanceType

string

No

The instance type. Valid values:

  • replicate

  • sharding

Note
  • This parameter is required when the backup recovery type is set to rebuilding a deleted instance.

  • This parameter is required when the backup recovery type is set to cloning an instance from cross-region backup.

replicate

PreserveOneEachHour

boolean

No

Specifies whether to enable hourly sparse backup. Valid values:

  • true: If the backup frequency is set to 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 taken after the hour is retained.

  • false: All snapshots taken within the high-frequency backup retention period are retained.

true

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

644A359C-B871-4DD3-97B5-ED91EF5809C2

Examples

Success response

JSON format

{
  "RequestId": "644A359C-B871-4DD3-97B5-ED91EF5809C2"
}

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.