Updated on 2025-11-27 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 parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation:

Project ID of a user in a region. To obtain this value, see Obtaining a Project ID.

Constraints:

N/A

Values:

N/A

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token

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

Constraints:

N/A

Values:

N/A

Default value:

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

recycle_policy

Yes

object

Explanation:

Recycling policy. For details, see Table 4.

Constraints:

N/A

Values:

N/A

Default value:

N/A

Table 4 RecyclePolicy

Parameter

Mandatory

Type

Description

retention_period_in_days

No

Integer

Explanation:

Policy retention duration, in days

Constraints:

N/A

Values:

17

Default value:

7

Response Parameters

Status code: 200

No response parameters

Example Request

  • URI example
    PUT https://gaussdb-nosql.ap-southeast-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/recycle-policy 
  • Setting the retention period of instances in the recycle bin to 3 days
    {
      "recycle_policy": {
        "retention_period_in_days": 3
      }
    }

Example Response

None

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.