Updated on 2023-10-18 GMT+08:00

Modifying the Backup Policy

Function

This API is used to modify the backup policy. Before calling this API:

URI

  • URI format

    PUT https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}/backups/policy/update

  • Example

    PUT https://{endpoint}/mysql/v3/97b026aa9cc4417888c14c84a1ad9860/instances/c3ec2c6148ad4d71b1a8411a62df0d3cin07/backups/policy/update

  • Parameter description
    Table 1 Parameter description

    Name

    Type

    Mandatory

    Description

    project_id

    String

    Yes

    Project ID of a tenant in a region.

    To obtain this value, see Obtaining a Project ID.

    instance_id

    String

    No

    DB instance ID.

Request

Table 2 Parameter description

Name

Type

Mandatory

Description

backup_policy

object

Yes

Backup policy information.

For details, see Table 3.

Table 3 backup_policy field data structure description

Name

Type

Mandatory

Description

keep_days

Integer

Yes

Backup retention days.

The value ranges from 1 to 732.

start_time

String

Yes

Backup time window. Automated backups will be triggered during the backup time window.

The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.

  • The HH value must be 1 greater than the hh value.
  • The values of mm and MM must be the same and must be set to 00.

Example value:

  • 21:00-22:00

period

String

Yes

Backup cycle configuration. Data will be automatically backed up on the selected days every week.

Value range: The value is a number separated by commas (,), indicating the days of the week.

For example, the value 1,2,3,4 indicates that the backup period is Monday, Tuesday, Wednesday, and Thursday.

retention_num_backup_level1

Integer

No

Number of retained level-1 backups. The default value is 0. This parameter is mandatory when the level-1 backup function is enabled. This parameter is unavailable when the level-1 backup function is disabled. Value:

  • 0
  • 1
  • Request example
    {
    	"backup_policy": {
    		"keep_days": 7,
    		"start_time": "19:00-20:00",
    		"period": "1,2,3,4,5"
    	}
    }

Response

  • Normal response
    Table 4 Parameter description

    Name

    Type

    Description

    status

    String

    Backup status. Value:

    • BUILDING: Modification in progress
    • COMPLETED: Modification completed
    • FAILED: Modification failed

    instance_id

    String

    DB instance ID.

    instance_name

    String

    DB instance name.

  • Example normal response
    {
    "status": "COMPLETED",
    "instance_id": "ef25188419f941309882d2986b2210b9in07",
    "instance_name": "gauss-fhc"
    }

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.