Enable Bucket Trash Feature
Last Updated:2021-09-13
Interface Description
This interface is used to enable the Bucket Trash feature. The user must be the source bucket owner with the FULL_CONTROL permission and the destination bucket owner.
Request URI
PUT /v1/{bucketName}/?trash
Parameter Name | Parameter Type | Required | Description | Example Value | Parameter Position |
---|---|---|---|---|---|
bucketName | String | Yes | Bucket name | "bucketName_example" | Path |
Request Body Parameters
Instructions for Data Structure of Request Body Field
Parameter name | Parameter type | Required | Description | Example value |
---|---|---|---|---|
trashDir | String | No | Trash directory name with a length limit, which is optional. The default name is .trash if it is left blank. | trashDirName |
Response Body Parameters
None
Request Example
PUT /v1/bucketName_example/?trash
<Common Request Header>
{
"trashDir" : "trashDirName"
}
Response Example
None
Error Code
Error Code | Error Description | HTTP Status Code | Explanations |
---|---|---|---|
MalformedJSON | JSONformat error | 400 | JSONformat error |
EntityTooLarge | The trash directory name is too long | 400 | Not more than 1,024 bytes |
InvalidTrashDirectoryName | The trash directory contains invalid characters. | 400 | It can only contain letters, numbers, Chinese characters, underline (_), hyphen (-), and decimal point (.). |
NoSuchBucket | The bucket does not exist. | 404 | The bucket does not exist. |
AccessDenied | Access denied | 403 | Only the bucket owner with the FULL_CONTROL permission can operate it. |