Help Center/ GeminiDB/ API Reference/ API v3/ Backups and Restorations/ Configuring an Automated Backup Policy
Updated on 2026-09-22 GMT+08:00

Configuring an Automated Backup Policy

Function

This API is used to configuring an automated backup policy.

Constraints

This API supports the following instances:
  • GeminiDB Cassandra
  • GeminiDB Influx
  • GeminiDB Redis

Authorization Information

Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • 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

    Dependencies

    gaussdbfornosql:instance:setBackupPolicy

    Write

    instance *

    • g:ResourceTag/<tag-key>
    • g:EnterpriseProjectId

    nosql:backup:list

    -

URI

PUT /v3/{project_id}/instances/{instance_id}/backups/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. To obtain the value, call the Querying Instances and Details API. If no instance is available, call the Creating an Instance API to create one.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token

You can obtain the token by calling the IAM API by following Obtaining a User Token Through Password Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

backup_policy

Yes

Table 4 object

Definition

Backup policy objects, including the backup retention period (days) and start time.

Constraints

N/A

Table 4 BackupPolicy

Parameter

Mandatory

Type

Description

keep_days

Yes

Integer

Definition

Backup retention days.

The value 0 indicates that the automated backup policy is disabled.

Constraints

N/A

Range

0–35.

Default Value

N/A

start_time

No

String

Definition

Backup time window.

Constraints

  • Automated backups will be triggered during the backup time window. This parameter is mandatory if the automated backup policy is enabled. If the policy is disabled, you do not need to transfer this parameter.
  • The value is in the format of hh:mm-HH:MM (UTC time). hh and HH indicate the hour (00–23), and mm and MM indicate the minute (which can only be 00, 15, 30, or 45). Example: 01:00–02:00 or 14:30–15:30.
    • The HH value must be 1 greater than the hh value.
    • The values of mm and MM must be the same.

Range

N/A

Default Value

N/A

period

No

String

Definition

Backup period.

Automated backups will be created on the specified days every week.

Constraints

The value is a comma-separated list of digits, where each digit represents a day of the week (1 to 7 represent Monday to Sunday, respectively).

This parameter is mandatory if the automated backup policy is enabled (keep_days > 0).

This parameter is not transferred if the automated backup policy is disabled (keep_days = 0).

Range

This parameter value is determined by the value of keep_days in Table 4.

  • This parameter is not transferred if keep_days is set to 0.
  • This parameter value must be 1,2,3,4,5,6,7 if keep_days is set to a value ranging from 1 to 6.
  • This parameter value must be at least one day of the week (for example, 1,2,3,4) if keep_days is set to a value ranging from 7 to 35.

Default Value

N/A

Response Parameters

Status code: 204

No response parameters

Example Requests

  • Enabling or modifying the automated backup policy (Set period to 1,2,3,4,5,6, start_time to 01:00-02:00, and keep_days to 7.)
    PUT https://{Endpoint}/v3/375d8d8fad1f43039e23d3b6c0f60a19/instances/9136fd2a9fcd405ea4674276ce36dae8in02/backups/policy
    {
       "backup_policy" : { 
       "period" : "1,2,3,4,5,6", 
       "start_time" : "01:00-02:00", 
       "keep_days" : 7 
       }
     }
  • Disabling the automated backup policy
    PUT https://{Endpoint}/v3/375d8d8fad1f43039e23d3b6c0f60a19/instances/9136fd2a9fcd405ea4674276ce36dae8in02/backups/policy
    {
     
       "backup_policy" : { 
         "keep_days" : 0 
       }
     }

Example Responses

Status code: 204

No Content

{ }

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.