Updated on 2026-01-08 GMT+08:00

Setting the Recycle Bin Policy

API Description

This API is used to set the recycle bin policy for an instance.

URI

  • URI format

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

Table 1 Path parameters

Name

Type

IN

Mandatory

Description

project_id

string

path

Yes

Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID.

instance_id

string

path

Yes

Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one.

Request Parameters

Table 2 Request header parameters

Parameter

Type

IN

Mandatory

Description

X-Auth-Token

string

header

Yes

User token

Table 3 Request body parameters

Name

Mandatory

Type

Description

recycle_policy

Yes

Object

Instance recycling policy. For details, see Table 4.

Table 4 RecyclePolicy

Name

Mandatory

Type

Description

enabled

Yes

Boolean

The recycling policy is enabled and cannot be disabled.

  • true: The recycling policy is enabled.

retention_period_in_days

No

Integer

Policy retention duration (1 to 7 days). The value is a positive integer. If this parameter is left blank, the policy is retained for 7 days by default.

  • Request example
    { 
      "recycle_policy" : { 
        "enabled" : true, 
        "retention_period_in_days" : 3 
      } 
    }

Response Parameters

  • Parameter description

    None

  • Example response

    None

Status Code

For details, see Status Code.

Error Code

For details, see Error Code.