Help Center/ GaussDB/ API Reference/ Historical APIs/ Backup Management/ Configuring an Automated Backup Policy
Updated on 2024-10-22 GMT+08:00

Configuring an Automated Backup Policy

Function

This API is used to configure an automated backup policy. Before calling this API:

This API will be unavailable on March 31, 2025. You are advised to switch workloads to the new API (Configuring an Automated Backup Policy) before then.

URI

PUT https://{Endpoint}/gaussdb/v3/{project_id}/instances/{instance_id}/backups/policy
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Explanation:

Project ID of a tenant in a region.

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

Restrictions:

None

Value range:

The value can contain 32 characters. Only letters and digits are allowed.

Default value:

None

instance_id

Yes

Instance ID.

Request Parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

backup_policy

Yes

Object

Backup policy information.

For details, see Table 3.

Table 3 backup_policy field data structure description

Parameter

Mandatory

Type

Description

keep_days

Yes

Integer

Backup retention days.

The value ranges from 1 to 732.

start_time

Yes

String

Backup time window. The creation of an automated backup 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 value of HH must be 1 greater than the value of hh. The values of mm and MM must be the same and must be 00.

Example value:

21:00-22:00

period

Yes

String

Full backup period. An automated full backup will be created on the specified days of the week.

The value is a number separated by commas (,), indicating the days of the week. For example, 1,2,3,4 indicates that the backup period is Monday, Tuesday, Wednesday, and Thursday.

differential_period

Yes

String

Interval for automated differential backups.

The value is 15, 30, 60, 180, 360, 720, or 1440 in minute.

Example value: 30

Response Parameters

None

Example Request

https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in14/backups/policy
{
	"backup_policy": {
		"keep_days": 7,
		"start_time": "19:00-20:00",
		"period": "1,2,3,4,5",
		"differential_period": "30"
	}
}

Example Response

None

Status Code

Error Code

For details, see Error Codes.