Help Center/ Elastic Cloud Server/ API Reference/ APIs/ Recycle Bin Management/ Querying the Recycle Bin Configuration
Updated on 2025-08-20 GMT+08:00

Querying the Recycle Bin Configuration

Function

This API is used to query the recycle bin configuration.

URI

GET /v1/{project_id}/recycle-bin

Table 1 describes the parameters in the URI.

Table 1 Path parameter

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

Request

None.

Response

Table 2 describes the response parameter.

Table 2 Response parameters

Parameter

Type

Description

project_id

String

Specifies the project ID.

switch

String

Specifies whether the recycle bin is enabled.

policy

Object

Specifies the recycle bin policy. For details, see Table 3.

Table 3 policy parameters

Parameter

Type

Description

recycle_threshold_day

Integer

Specifies how long an instance can be moved to the recycle bin after it is created.

retention_hour

Integer

Specifies how long an instance can be retained in the recycle bin before being permanently deleted.

Example Request

Query the recycle bin configuration.

GET https://{endpoint}/v1/{project_id}/recycle-bin

Example Response

{
	"project_id": "74d4d6ac2da84aa5bdc6fed4efc20413",
	"switch": "off",
	"policy": {
		"recycle_threshold_day": 8,
		"retention_hour": 8
	}
}

Error Codes

See Error Codes.