All Products
Search
Document Center

ApsaraDB for MongoDB:ModifyBackupPolicy

更新時間:Nov 19, 2024

Modifies a backup policy for an ApsaraDB for MongoDB instance.

Operation description

The cross-region backup feature is suitable only for replica set or sharded cluster instances that use cloud disks.

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
dds:ModifyBackupPolicyupdate
*Instance
acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID.

dds-bp16cb162771****
PreferredBackupTimestringNo

The start time of the backup. Specify the time in the ISO 8601 standard in the HH:mmZ-HH:mmZ format. The time must be in UTC.

Note The time range is 1 hour.
03:00Z-04:00Z
PreferredBackupPeriodstringNo

The day of a week when the system regularly backs up data. Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

**

Notice: To ensure data security, make sure that the system backs up data at least twice a week.

Note Separate multiple values with commas (,).
Monday,Wednesday,Friday,Sunday
BackupRetentionPeriodlongNo

The retention period of full backups.

Note
  • If your instance is created before September 10, 2021, backups are retained for seven days by default.

  • If your instance is created after September 10, 2021, backups are retained for 30 days by default.

30
EnableBackupLoglongNo

Specifies whether to enable the log backup feature. Valid values:

  • 0 (default): The log backup feature is disabled.
  • 1: The log backup feature is enabled.
0
LogBackupRetentionPeriodlongNo

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

Valid values: 7 to 730.

7
SnapshotBackupTypestringNo

The snapshot backup type. Valid values:

  • Flash: single-digit second backup
  • Standard (default): standard backup
Standard
BackupIntervalstringNo

The frequency at which high-frequency backups are generated. Valid values:

  • -1: High-frequency backup is disabled.
  • 30: High-frequency backups are generated every 30 minutes.
  • 60: High-frequency backups are generated every 1 hour.
  • 120: High-frequency backups are generated every 2 hours.
  • 180: High-frequency backups are generated every 3 hours.
  • 240: High-frequency backups are generated every 4 hours.
  • 360: High-frequency backups are generated every 6 hours.
  • 480: High-frequency backups are generated every 8 hours.
  • 720: High-frequency backups are generated every 12 hours.
Note
  • If you set the SnapshotBackupType parameter to Standard, you must fix the value of this parameter to -1.

  • High-frequency backup takes effect only when you set the SnapshotBackupType parameter to Flash and this parameter to a value greater than 0.

-1
HighFrequencyBackupRetentionlongNo

The number of days for which high-frequency backup files are retained. Before you use this parameter, make sure that you specify the BackupInterval parameter. By default, high-frequency backup files are retained for one day.

1
BackupRetentionPolicyOnClusterDeletionintegerNo

The backup retention policy configured for the instance. Valid values:

  • 0: All backup sets are immediately deleted when the instance is released.
  • 1: Automatic backup is performed when the instance is released and the backup set is retained for a long period of time.
  • 2: Automatic backup is performed when the instance is released and all backup sets are retained for a long period of time.

For more information, see Retain the backup files of an ApsaraDB for MongoDB instance for a long period of time.

2
CrossBackupTypestringNo

The action performed for the cross-region backup policy. Valid values:

  • update: modifies the cross-region backup policy.
  • delete: deletes the cross-region backup policy.
Note This parameter is required for a cross-region backup operation.
update
SrcRegionstringNo

The region ID of the instance.

Note
  • This parameter is required for the data restoration of a deleted instance.

  • This parameter is required for a cross-region backup operation.

cn-beijing
DestRegionstringNo

The region in which the backup files are retained.

Note This parameter is required for a cross-region backup operation.
cn-hangzhou
CrossRetentionTypestringNo

The retention type of the cross-region backup files. Valid values:

  • delay: retains the cross-region backup files for a period of time.
  • never: permanently retains the cross-region backup files.
Note This parameter is required for a cross-region backup operation.
delay
CrossRetentionValueintegerNo

The retention period of the cross-region backup files. Valid values: 3 to 1825. Unit: day.

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

  • This parameter is required when you set the CrossRetentionType parameter to delay.

7
CrossBackupPeriodstringNo

The day of the week on which the cross-region backup files are retained. Valid values:

  1. Monday
  2. Tuesday
  3. Wednesday
  4. Thursday
  5. Friday
  6. Saturday
  7. Sunday
Note This parameter is required for a cross-region backup operation.
  • Separate multiple values with commas (,).

  • If you set the SnapshotBackupType parameter to Standard, the parameter value must fall within the value of the PreferredBackupPeriod parameter that specifies the standard backup period.

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

Specifies whether to enable the cross-region log backup feature.

Note This parameter is required for a cross-region backup operation.
  • Valid values:1: enables the feature. The parameter value must be 1 for sharded cluster instances.

  • 0: disables the feature. The parameter value must be 0 for replica set instances.

1
CrossLogRetentionTypestringNo

The retention type of the cross-region log backup files. Valid values:

  • delay: retains the cross-region backup files for a period of time.
  • never: permanently retains the cross-region backup files.
Note This parameter is required for a cross-region backup operation.
delay
CrossLogRetentionValueintegerNo

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

Note This parameter is required for a cross-region backup operation.
3
InstanceTypestringNo

The instance architecture. Valid values:

  • replicate
  • sharding
Note
  • This parameter is required when you set the RestoreType parameter to 2.

  • This parameter is required when you set the RestoreType parameter to 3.

replicate

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400InvalidPreferredBackupPeriod.MalformedSpecified parameter PreferredBackupPeriod is not valid.
400InvalidPreferredBackupTime.MalformedSpecified parameter PreferredBackupTime is not valid.

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

Change history

Change timeSummary of changesOperation
2024-02-22The Error code has changed. The request parameters of the API has changedView Change Details