Updated on 2025-08-06 GMT+08:00

Adding a Snapshot Policy

Function

This API is used to configure a snapshot policy.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{project_id}/clusters/{cluster_id}/snapshot-policies

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

cluster_id

Yes

String

Definition

Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID.

Constraints

The value must be a valid DWS cluster ID.

Range

It is a 36-digit UUID.

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

keep_day

No

Integer

Definition

Retention days.

Range

1 to 31.

backup_strategies

No

Array of BackupStrategyRequest objects

Definition

Policy list. This parameter is mandatory when you add a policy.

Range

N/A

device_name

No

String

Definition

Backup device. OBS, NBU, and NFS are supported.

Range

N/A

server_port

No

String

Definition

Port of the NBU backup media. This parameter is mandatory when the backup medium is NBU.

Range

N/A

backup_param

No

String

Definition

NBU backup parameters. This parameter is mandatory when the backup medium is NBU.

Range

N/A

server_ips

No

Array of strings

Definition

IP address of the backup media. This parameter is mandatory when the backup medium is NBU or NFS. If the backup medium is NBU, it indicates the address of the NBU server. If the backup medium is NFS, it indicates the address of the NFS server.

Range

N/A

Table 3 BackupStrategyRequest

Parameter

Mandatory

Type

Description

policy_id

No

String

Definition

Policy ID.

Range

N/A

policy_name

No

String

Definition

Policy name. This parameter is mandatory when you add a backup policy. The policy name must be unique, consist of 4 to 92 characters, and start with a letter. It is case-insensitive and can contain only letters, digits, hyphens (-), and underscores (_).

Range

N/A

backup_strategy

No

String

Definition

Execution policy. This parameter is mandatory when you add a backup policy. The value must comply with the cron expression format.

Range

N/A

backup_type

No

String

Definition

Backup type.

Range

full: full backup

increment: incremental backup

backup_level

No

String

Definition

Backup level.

Range

cluster

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

Add a cluster-level full snapshot policy named test (A snapshot is created at 03:00 every Monday to Sunday).

PUT https://{Endpoint} /v2/89cd04f168b84af6be287f71730fdb4b/clusters/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/snapshot-policies

Example Responses

Status code: 200

Request succeeded.

{ }

Status Codes

Status Code

Description

200

Request succeeded.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

404

No resources found.

500

Internal server error.

503

Service unavailable.