Help Center/ GeminiDB/ API Reference/ API v3/ Backups and Restorations/ Modifying the Recycling Policy
Updated on 2026-09-22 GMT+08:00

Modifying the Recycling Policy

Function

This API is used to change a retention period for deleted instances. The new retention period is available to only those instances deleted after the change, but not to the instances already moved to the recycle bin before the change.

Constraints

The retention period for deleted instances can be 1 to 7 days.

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:setRecyclePolicy

    Write

    -

    -

    nosql:recyclePolicy:set

    -

URI

PUT /v3/{project_id}/instances/recycle-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

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

recycle_policy

Yes

Table 4 object

Definition

Recycling policy.

Constraints

N/A

Table 4 RecyclePolicy

Parameter

Mandatory

Type

Description

retention_period_in_days

No

Integer

Definition

Policy retention duration, in days

Constraints

N/A

Range

1–7

Default Value

7

Response Parameters

Status code: 200

No response parameters

Example Requests

Setting the retention period of instances in the recycle bin to 3 days
PUT https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/recycle-policy
 
{
  "recycle_policy": {
    "retention_period_in_days": 3
  }
}

Example Responses

None

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.