GetBucketTrash
Last Updated:2021-12-08
Interface Description
This interface is used to get the bucket trash enabling status and return the current trash directory name. The directory name is .trash by default. The user must be the source bucket owner with the FULL_CONTROL permission and the destination bucket owner.
Request
-
Request syntax
GET /?trash HTTP/1.1 Host:
.bj.bcebos.com Date: Authorization: -
Request header field
No special header parameters.
-
Request element
None
Response
-
Response header field
No
-
Response element
Name Description trashDir Trash path name with a length limit Optional. The default name is .trash
if it is left blank.The return results are explained as follows:
Results Http Status Error Code Description Success 200 - - The bucket does not exist. 404 NoSuchBucket - The Trash feature is not enabled. 404 NoSuchTrashDirectory - Access denied 403 AccessDenied Only the bucket owner with the FULL_CONTROL permission can operate it.
Example
-
Request example
GET /?trash HTTP/1.1 Host: bucket.bj.bcebos.com x-bce-date: date Authorization: AuthorizationString
-
Response example
HTTP/1.1 200 OK x-bce-request-id: 4db4b34d-653d-4d9a-b49b-3049ca786409 Date: Wed, 31 May 2017 08:34:40 GMT Content-Length: request-body-length Content-Type: application/json; charset=utf-8 Server: BceBos Connection: keep-alive { "trashDir": ".trash/" }