Help Center/ TaurusDB/ API Reference/ APIs/ Backup Management/ Configuring Same-Region Backup Policies
Updated on 2026-08-31 GMT+08:00

Configuring Same-Region Backup Policies

Function

This API is used to modify same-region backup policies. You can customize standard backup policies and sparse backup policies. Before calling this API:

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned 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

    Dependency

    gaussdbformysql:backup:modifyPolicy

    Permission_management

    -

    gaussdbformysql:ReplicationTargetRegion

    gaussdb:instance:modifyBackupPolicy

    -

URI

PUT /v3/{project_id}/instances/{instance_id}/backups/advanced-policy

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints

N/A

Range

The value contains 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

To obtain this value, see Querying DB Instances.

Constraints

N/A

Range

The value contains 36 characters with a suffix of in07. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. To obtain this value, call the IAM API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Content type.

Constraints

N/A

Range

application/json

Default Value

application/json

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us: English

  • zh-cn: Chinese

Default Value

en-us

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

begin_time

Yes

String

Definition

Start time of the backup time window.

Constraints

N/A

Range

The value must be a valid time in the hh:mm format. hh ranges from 0 to 23, and mm ranges from 0 to 59. The current time is the UTC time.

Default Value

N/A

end_time

Yes

String

Definition

End time of the backup time window.

Constraints

The value of end_time must be later than that of begin_time.

Range

The value must be a valid time in the hh:mm format. hh ranges from 0 to 23, and mm ranges from 0 to 59. The current time is the UTC time.

Default Value

N/A

retention_num_backup_level1

No

Integer

Definition

Number of retained level-1 backups.

Constraints

This parameter is mandatory when the level-1 backup function is enabled. Otherwise, this parameter cannot be transferred.

Range

  • 0: Level-1 backups are not retained.

  • 1: number of retained level-1 backups

Default Value

0

policies

Yes

Array of Policy objects

Definition

Backup policy set, including the backup cycle, retention days, and policy type. For details, see the Policy data structure.

Constraints

N/A

Table 4 Policy

Parameter

Mandatory

Type

Description

period

Yes

String

Definition

Backup cycle.

Constraints

The value must be a cron expression in the format of "day month week" in the UTC time zone.

Range

The day can be a number ranging from 1 to 31, the special character * (indicating any value), or the special character L (indicating the last day). You can enter multiple values ranging from 1 to 31 or L and separate them with commas (,).

The month can be a number ranging from 1 to 12 or the special character * (indicating any value).

The week can be a number ranging from 1 to 7 (1 indicates Monday, 2 indicates Tuesday, and so on) or the special character * (indicating any value). You can enter multiple values ranging from 1 to 7 and separate them with commas (,).

Example values:

  • * * 6 indicates that the task is executed every Saturday. This is applicable to weekly policies.

  • * * 1,2,3 indicates that the task is executed every Monday, Tuesday, and Wednesday. This is applicable to weekly policies.

  • 1,2 * * indicates that the task is executed on the first and second days of each month. This is applicable to monthly policies.

  • L * * indicates that the task is executed on the last day of each month. This is applicable to monthly policies.

  • 15 3 * indicates that the task is executed on March 15 every year. This is applicable to yearly policies.

Default Value

N/A

retention_days

Yes

Integer

Definition

Number of days for storing backups.

Constraints

N/A

Range

1–732

You can also contact customer service to extend the retention period to up to 3,660 days.

Default Value

N/A

policy_type

Yes

String

Definition

Backup policy type.

Constraints

N/A

Range

  • base: standard backup policy

  • sparse: sparse backup policy

Default Value

N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

status

String

Definition

Status.

Range

COMPLETED: The backup policy is successfully configured.

instance_id

String

Definition

Instance ID, which is compliant with the UUID format.

Range

The value is the same as the instance ID in the request.

instance_name

String

Definition

Instance name.

Range

Instance name corresponding to the instance ID

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Modifying the automated backup policy of an instance (Data is backed up from 19:00 to 20:00 every Monday to Sunday. Backups are stored for seven days.)

PUT https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/21b6ea5a78244de98c1c2622e1dc593ain07/backups/advanced-policy

{
  "begin_time" : "19:00",
  "end_time" : "20:00",
  "policies" : [ {
    "period" : "* * 1,2,3,4,5",
    "retention_days" : 7,
    "policy_type" : "base"
  } ]
}

Example Response

Status code: 200

Success.

{
  "status" : "COMPLETED",
  "instance_id" : "21b6ea5a78244de98c1c2622e1dc593ain07",
  "instance_name" : "Taurus-123"
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.