Setting a Cross-Region Backup Policy
Function
This API is used to set a cross-region backup policy in the source backup region.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about the request header parameters.
Authorization Information
- If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
rds:instance:modifyBackupPolicy |
permission_management |
instance |
g:EnterpriseProjectId rds:BackupEnabled g:ResourceTag/<tag-key> |
- |
- |
Constraints
- If the cross-region backup policy has been enabled, call the API to set the cross-region backup policy. Only the retention period can be changed.
- For RDS for PostgreSQL DB instances, the retention period of automated full backups must be the same as that for automated incremental backups.
- For RDS for PostgreSQL DB instances, automated incremental backup cannot be enabled unless automated full backup is enabled first.
- For RDS for PostgreSQL DB instances, if you want to disable automated full backup and automated incremental backup, disable automated incremental backup first.
- Cross-region backup is not supported for RDS for PostgreSQL instances with volume snapshot backup enabled.
URI
- URI format
PUT /v3/{project_id}/instances/{instance_id}/backups/offsite-policy
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
Constraints
The value cannot be empty.
Range
To obtain the value, see Obtaining a Project ID.
Default Value
N/A
instance_id
Yes
Definition
Instance ID.
Constraints
The value cannot be empty.
Range
You can obtain the value of this parameter from id in Table 4 by calling the API for querying DB instances.
Default Value
N/A
Request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
policy_para |
Yes |
Object |
Definition Backup policy objects, including the backup type, backup retention days, target region ID, and target project ID For details, see Table 3. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
backup_type |
Yes |
String |
Definition Specifies the backup type. Constraints N/A Range For RDS for SQL Server, this parameter can only be set to all.
Default Value N/A |
|
keep_days |
Yes |
Integer |
Definition Specifies the number of days to retain the generated backup files. Constraints Once the backup policy is disabled, backup tasks stop and all incremental backups, if any, are deleted immediately. Operations related to the incremental backups, including downloads, replications, restorations, and rebuilds, may fail. Range 0–1825 The value 0 indicates that the cross-region backup policy is disabled. Default Value N/A |
|
destination_region |
Yes |
String |
Definition Specifies the target region ID for the cross-region backup policy. Constraints N/A Range The value cannot be empty. To obtain this value, see Regions and Endpoints. Default Value N/A |
|
destination_project_id |
Yes |
String |
Definition Specifies the target project ID for the cross-region backup policy. Constraints N/A Range To obtain the value, see Obtaining a Project ID. Default Value N/A |
Example Request
- Configure a cross-region automated full backup policy for an RDS for MySQL or RDS for PostgreSQL DB instance.
PUT https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/offsite-policy { "policy_para": { "backup_type": "auto", "keep_days": 7, "destination_region": "aaa", "destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c" } } - Disable the cross-region automated full backup policy for an RDS for MySQL or RDS for PostgreSQL DB instance.
{ "policy_para": { "backup_type": "auto", "keep_days": 0, "destination_region": "aaa", "destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c" } } - Configure a cross-region backup policy for an RDS for SQL Server DB instance.
{ "policy_para": { "backup_type": "all", "keep_days": 7, "destination_region": "aaa", "destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c" } } - Disable the cross-region backup policy for an RDS for SQL Server DB instance.
{ "policy_para": { "backup_type": "all", "keep_days": 0, "destination_region": "aaa", "destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c" } }
Response
- Normal response
Table 4 Parameters Parameter
Type
Description
resp
String
Definition
Calling result.
Range
Returns successful if the calling is successful.
- Example normal response
{ "resp": "successful" }
- Abnormal Response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot