此接口用于为分层命名空间设置回收站功能。回收站功能开启后,删除文件或者目录,TOS会将被删除的文件和目录移动到规则中指定的回收站目录中。同时,TOS 将按照规则中指定的过期时间,自动删除回收站中的文件和目录。
目前该接口仅支持在分层命名空间使用,功能详情请参见回收站。
请求消息样式
PUT /?trash HTTP/1.1 Host: bucket-name.tos-cn-beijing.volces.com Date: GMT Date Authorization: authorization string Content-Length: ContentLength Content-MD5: MD5 { "BucketTrash": { "Trash": { "TrashPath": ".Trash", "CleanInterval": 7, "Status": "Enabled" } } }
该请求使用的公共请求消息头,请参见公共参数。
名称 | 位置 | 参数类型 | 是否必选 | 示例值 | 说明 |
---|---|---|---|---|---|
trash | Query | String | 是 | - | 代表 PutBucketTrash 请求的特殊标识。 |
名称 | 参数类型 | 是否必填 | 示例值 | 说明 |
---|---|---|---|---|
BucketTrash | Container | 是 | 回收站规则信息。 | |
TrashPath | String | 是 | .Trash | 回收站目录。 |
CleanInterval | Integer | 是 | 7 | 文件或目录进入回收站后过期删除的天数,必须为正整数。 |
Status | String | 是 | Enabled | 设置回收站是否开启,取值说明如下:
|
该请求返回的公共响应消息头,请参见公共参数。
该请求响应中无消息元素。
开启回收站功能,回收站路径为根目录下的 .Trash
,过期删除时间为 7 天。
PUT /?trash HTTP/1.1 Host: bucket-name.tos-cn-beijing.volces.com Date: Fri, 30 Jul 2021 08:05:36 +0000 Authorization: authorization string Content-Length: ContentLength Content-MD5: MD5 { "BucketTrash": { "Trash": { "TrashPath": ".Trash", "CleanInterval": 7, "Status": "Enabled" } } }
无。
暂停回收站功能。
PUT /?trash HTTP/1.1 Host: bucket-name.tos-cn-beijing.volces.com Date: Fri, 30 Jul 2021 08:05:36 +0000 Authorization: authorization string Content-Length: ContentLength Content-MD5: MD5 { "BucketTrash": { "Trash": { "TrashPath": ".Trash", "CleanInterval": 7, "Status": "Disabled" } } }
无。