Setting a Cross-Region Backup Policy

Function

This API is used to set a cross-region backup policy in the source backup region.

Constraints

  • Only MySQL supports cross-region backup policies.
  • The retention period of automated full backup files must be the same as that of automated incremental backup files.
  • Automated incremental backup can be enabled only after automated full backup is enabled.
  • If automated full backup and automated incremental backup are both enabled and you want to disable them, disable automated incremental backup first and then automated full backup.

URI

  • URI format

    PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/offsite-policy

  • Example

    https://rds.cn-north-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/offsite-policy

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    instance_id

    Yes

    Specifies the DB instance ID.

Request

  • Parameter description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    policy_para

    Yes

    Object

    Specifies the backup policy object, including the backup type, backup retention days, target region ID, and target project ID.

    For details, see Table 3.

    Table 3 policy_para field data structure description

    Name

    Mandatory

    Type

    Description

    backup_type

    Yes

    String

    Specifies the backup type. Its value can be any of the following:

    • auto: automated full backup
    • incremental: automated incremental backup
    • all: automated full backup and automated incremental backup

    keep_days

    Yes

    Integer

    Specifies the number of days to retain the generated backup files.

    Value range: 0-732

    The value 0 indicates that the automated backup policy is disabled. To extend the retention period, contact customer service. Automated backups can be retained for up to 2,562 days.

    NOTICE:

    Once the automated backup policy is disabled, automated backups are no longer created and all incremental backups are deleted immediately. Operations related to the incremental backups, including downloads, replications, restorations, and rebuilds, may fail.

    destination_region

    Yes

    String

    Specifies the target region ID for the cross-region backup policy.

    destination_project_id

    Yes

    String

    Specifies the target project ID for the cross-region backup policy.

  • Request example
    Updating the cross-region automated full backup policy:
    {
    	"policy_para": {
                    "backup_type": "auto",
    		"keep_days": 7,
    		"destination_region": "eu-de",
    		"destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c"
    	}
    }

    Disabling the automated backup policy:

    {
    	"policy_para": {
                    "backup_type": "auto",
    		"keep_days": 0,
    		"destination_region": "eu-de",
    		"destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c"
    	}
    }

Response

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.