You need to enable JavaScript to run this app.
导航
GetBucketTrash
最近更新时间:2025.03.25 20:57:18首次发布时间:2025.03.25 20:57:18
我的收藏
有用
有用
无用
无用

功能描述

此接口用于获取分层命名空间的回收站规则。

使用说明

目前该接口仅支持在分层命名空间使用,功能详情请参见回收站
请求消息样式

GET /?trash HTTP/1.1
Host: bucket-name.tos-cn-beijing.volces.com
Date: GMT Date
Authorization: authorization string

请求参数和消息头

该请求使用的公共请求消息头,请参见公共参数

名称

位置

参数类型

是否必选

示例值

说明

trash

Query

String

-

代表 GetBucketTrash 请求的特殊标识。

请求元素

该请求不使用消息元素。

响应消息头

该请求返回的公共响应消息头,请参见公共参数

响应元素

名称

参数类型

是否必填

示例值

说明

BucketTrash

Container

回收站规则信息。

TrashPath

String

.Trash

回收站的全路径。

CleanInterval

Integer

7

文件或目录进入回收站后过期删除的天数,必须为正整数。

Status

String

Enabled

设置回收站是否开启,取值说明如下:

  • Enabled:表示开启回收站功能。
  • Disabled:表示暂停回收站功能。

请求示例

GET /?trash HTTP/1.1
Host: bucket-name.tos-cn-beijing.volces.com
Date: Mon, 14 Apr 2021 01:17:29 GMT  
Authorization: authorization string

响应示例

HTTP/1.1 200 OK
Date: Fri, 30 Jul 2021 13:53:55 GMT
Server: TosServer
x-tos-id-2: 1e89f203jld00006-a444fd0
x-tos-request-id: 1e89f203b2d00006-a444ed0
Content-Length: ***
{
    "BucketTrash": {
        "Trash": {
            "TrashPath": ".Trash",
            "CleanInterval": 7,
            "Status": "Enabled"
        }
    }
}

如果没有设置回收站规则,则返回默认的规则,示例如下。

HTTP/1.1 200 OK
Date: Fri, 30 Jul 2021 13:53:55 GMT
Server: TosServer
x-tos-id-2: 1e89f203jld00006-a444fd0
x-tos-request-id: 1e89f203b2d00006-a444ed0
Content-Length: ***
{
    "BucketTrash": {
        "Trash": {
            "TrashPath": ".Trash",
            "CleanInterval": 7,
            "Status": "Disabled"
        }
    }
}