Querying the Recycle Bin Configuration
Function
This API is used to query the recycle bin configuration.
Constraints
This function is only available in the following regions: CN North-Beijing4, CN North-Ulanqab1, CN East-Shanghai1, CN South-Guangzhou, CN South-Guangzhou-InvitationOnly, CN Southwest-Guiyang1, and AP-Singapore.
Debugging
You can debug this API in API Explorer.
Authorization
- 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.
| Parameter | Mandatory | Description |
|---|---|---|
| project_id | Yes | Definition Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request
None.
Response
Table 2 describes the response parameter.
| Parameter | Type | Description |
|---|---|---|
| project_id | String | Definition Specifies the project ID. Range N/A |
| switch | String | Definition Specifies whether the recycle bin is enabled. Range
|
| policy | Object | Definition Specifies the recycle bin policy. For details, see Table 3. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| recycle_threshold_day | Integer | Definition Specifies how long an instance can be moved to the recycle bin after it is created. Range An integer greater than or equal to 0 |
| retention_hour | Integer | Definition Specifies how long an instance can be retained in the recycle bin before being permanently deleted. Range An integer greater than or equal to 0 |
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
}
} Returned Values
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot