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

Querying the Recycle Bin Configuration

Function

This API is used to query the recycle bin configuration.

Debugging

You can debug this API in API Explorer.

Authorization

Each account has all of the permissions required 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 permissions listed below are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

ecs:recycleBin:get

read

-

-

-

-

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.