You can call the ModifyInstanceCrossBackupPolicy operation to modify the cross-region backup settings of an ApsaraDB RDS instance.

Before you call this operation, make sure that the source instance runs one of the following database engines:

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyInstanceCrossBackupPolicy

The operation that you want to perform. Set the value to ModifyInstanceCrossBackupPolicy.

DBInstanceId String Yes rm-uf6wjk5xxxxxxxxxx

The ID of the instance.

RegionId String Yes cn-hangzhou

The ID of the region to which the source instance belongs. You can call the DescribeRegions operation to query the most recent region list.

CrossBackupType String No 1

The policy that is used to save the cross-region backup files of the instance. Set the value to 1. The value 1 specifies that all cross-region backup files are saved.

LogBackupEnabled String No 1

The status of the cross-region log backup feature on the instance. Valid values:

  • 0: disables the feature.
  • 1: enables the feature.
Note You can enable the cross-region log backup feature only when the cross-region backup feature is enabled.
BackupEnabled String No 1

The status of the cross-region backup feature on the instance. This parameter specifies whether you can back up data and logs. Valid values:

  • 0: disables the feature.
  • 1: enables the feature.
Note Before you enable the cross-region backup feature, you must configure the CrossBackupRegion parameter.
CrossBackupRegion String No cn-shanghai

The ID of the destination region where the cross-region backup files of the instance are stored.

RetentType Integer No 1

The policy that is used to retain the cross-region backup files of the instance. Set the value to 1. The value 1 specifies that the cross-region backup files of the instance are retained based on the specified retention period.

Retention Integer No 7

The number of days for which the cross-region backup files of the instance are retained. Valid values: 7 to 1825.

Response parameters

Parameter Type Example Description
BackupEnabled String Enable

The status of the cross-region backup feature on the instance. Valid values:

  • Disable
  • Enable
RegionId String cn-hangzhou

The ID of the region to which the source instance belongs. You can call the DescribeRegions operation to query the most recent region list.

LogBackupEnabled String Enable

The status of the cross-region log backup feature on the instance. Valid values:

  • Disable
  • Enable
RequestId String 50A6059D-6DBB-46C6-A851-1EE93C9013CF

The ID of the request.

RetentType Integer 1

The policy that is used to retain the cross-region backup files of the instance. Default value: 1. The value 1 indicates that the cross-region backup files of the instance are retained based on the specified retention period.

CrossBackupRegion String cn-shanghai

The ID of the destination region where the cross-region backup files of the instance are stored.

CrossBackupType String 1

The policy that is used to save the cross-region backup files of the instance. Default value: 1. The value 1 indicates that all cross-region backup files are saved.

Retention Integer 15

The number of days for which the cross-region backup files of the instance are retained. Valid values: 7 to 1825.

DBInstanceId String rm-uf6wjk5xxxxxxxxxx

The ID of the instance.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=ModifyInstanceCrossBackupPolicy
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyInstanceCrossBackupPolicyResponse>
<CrossBackupType>1</CrossBackupType>
    <LogBackupEnabled>Enable</LogBackupEnabled>
    <BackupEnabled>Enable</BackupEnabled>
    <CrossBackupRegion>cn-shanghai</CrossBackupRegion>
    <RetentType>1</RetentType>
    <RequestId>50A6059D-6DBB-46C6-A851-1EE93C9013CF</RequestId>
    <DBInstanceId>rm-bpxxxxx</DBInstanceId>
    <RegionId>cn-hangzhou</RegionId>
    <StorageType>oss</StorageType>
    <Endpoint></Endpoint>
    <Retention>15</Retention>
</ModifyInstanceCrossBackupPolicyResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "CrossBackupType" : "1",
  "LogBackupEnabled" : "Enable",
  "BackupEnabled" : "Enable",
  "CrossBackupRegion" : "cn-shanghai",
  "RetentType" : 1,
  "RequestId" : "50A6059D-6DBB-46C6-A851-1EE93C9013CF",
  "DBInstanceId" : "rm-bpxxxxx",
  "RegionId" : "cn-hangzhou",
  "StorageType" : "oss",
  "Endpoint" : "",
  "Retention" : 15
}

Error codes

HTTP status code Error code Error message Description
400 ParameterLeastAssociate Must input at least one optional parameter. The error message returned because the restoreTime parameter and the BackupId parameter of the instance cannot be empty at the same time. You must configure at least one of the parameters and try again.
400 InvalidRegion.Format Specified Region is not valid. The error message returned because the specified region is invalid.
400 OperationDenied.SwitchToCrossRegionBackup Snapshot backup does not support cross region backup storage at present. The error message returned because cross-region backups and storage are not supported for snapshot backups.
400 OperationDenied.SwitchToSnapshot Snapshot backup does not support cross region storage at present. Please turn off cross region backup before switching to snapshot backup mode. The error message returned because snapshot backup files cannot be stored in a region that is different from the region where the instance resides. Before you enable the snapshot backup feature, you must disable the cross-region backup feature.
400 OperationDenied.SwitchSnapshotToPhysical Only physical backup to snapshot backup is supported. The error message returned because the operation supports only the change from the physical backup method to the snapshot backup method.
403 IncorrectEngineVersion Current engine version does not support operations. The error message returned because this operation is not supported for the database engine version that is run on the instance.
403 IncorrectDBInstanceType Current DB instance type does not support this operation. The error message returned because this operation is not supported when the instance is in the current state.
403 IncorrectDBInstanceEngine Current DB Instance engine does not support this operation. The error message returned because the database engine of the instance does not support this operation.
403 IncorrectDBInstanceLockMode Current DB instance lock mode does not support this operation. The error message returned because the instance is locked.
403 IncorrectDBInstanceState Current DB instance state does not support this operation. The error message returned because this operation is not supported when the instance is in the current state.
404 InvalidDBInstance.NotFound Specified instance does not exist or not support. The error message returned because the instance cannot be found, is deleted, or does not support the operation.

For a list of error codes, visit the API Error Center.