You can call the ModifyInstanceCrossBackupPolicy operation to modify the cross-region backup settings of an ApsaraDB for RDS instance.
Before you call this operation, make sure that the instance runs one of the following database engine versions and RDS editions:
- MySQL 8.0 on RDS High-availability Edition (with local SSDs)
- MySQL 5.7 on RDS High-availability Edition (with local SSDs)
- MySQL 5.6
Debugging
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 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. Default value: 1. The default value 1 specifies to save all cross-region backup files. |
LogBackupEnabled | String | No | 1 |
The status of the cross-region log backup function on the instance. Valid values:
Note You can enable the cross-region log backup function only when the cross-region backup
function is enabled.
|
BackupEnabled | String | No | 1 |
The status of the cross-region backup function on the instance. This parameter specifies whether you can back up data and logs. Valid values:
Note Before you enable the cross-region backup function, you must specify the DBInstanceId
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 to retain the cross-region backup files of the instance 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 | 1 |
The status of the cross-region backup function on the instance. Valid values:
|
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 default value 1 indicates that all cross-region backup files are saved. |
DBInstanceId | String | rm-uf6wjk5xxxxxxxxxx |
The ID of the instance. |
LogBackupEnabled | String | 1 |
The status of the cross-region log backup function on the instance. Valid values:
|
RegionId | String | cn-hangzhou |
The ID of the region to which the instance belongs. You can call the DescribeRegions operation to query the most recent region list. |
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. Set the value to 1. The value 1 indicates that the cross-region backup files of the instance are retained based on the specified retention period. |
Retention | Integer | 15 |
The number of days for which the cross-region backup files of the instance are retained. Valid values: 7 to 1825. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=ModifyInstanceCrossBackupPolicy
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
<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
{
"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
HPPT status code | Error code | Error message | Description |
---|---|---|---|
400 | ParameterLeastAssociate | Must input at least one optional parameter. | The error message returned because none of the optional parameters is specified. When you clone an RDS instance, you must specify either the cloning time or the used backup set. |
403 | IncorrectDBInstanceEngine | Current DB Instance engine does not support this operation. | The error message returned because the lock mode 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 lock mode of the instance does not support this operation. |
For a list of error codes, visit the API Error Center.