Help Center/ GeminiDB/ API Reference/ APIs v3/ Backups and Restorations/ Modifying the Recycling Policy
Updated on 2023-11-21 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.

URI

PUT https://{Endpoint}/v3/{project_id}/instances/recycle-policy

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

recycle_policy

Yes

object

Recycling policy. For details, see Table 4.

Table 4 RecyclePolicy

Parameter

Mandatory

Type

Description

retention_period_in_days

No

Integer

Policy retention duration (1 to 7 days). The value is a positive integer. The default value is 7.

Response Parameters

Status code: 200

No response parameters

Example Requests

  • URI example
    PUT https://gaussdb-nosql.eu-west-101.myhuaweicloud.eu/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 Responses

None

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.