You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
API reference
PutBucketTrash
Copy page
Download PDF
PutBucketTrash
Description​
This interface sets the recycle bin function for the hierarchical namespace. Once the recycle bin function is enabled, TOS moves deleted files and directories to the recycle bin directory specified by the rule. At the same time, TOS automatically deletes files and directories in the recycle bin according to the expiration time specified by the rule.​
Instructions​
Currently, this interface only supports use in hierarchical namespaces. For details, see Recycle Bin.​
Request syntax​
​
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​
{​
"Trash": {​
"TrashPath": ".Trash",​
"CleanInterval": 7,​
"Status": "Enabled"​
}​
}​
​
Request parameters and headers​
This request uses common request headers. See Common parameters.​
​
Name​
Location​
type​
Required​
sample value​
Description​
trash​
Query​
String​
Yes​
-​
Indicates the special identifier for the PutBucketTrash request.​
​
Request body elements​
​
name​
Type​
Required​
Sample Value​
Description​
BucketTrash​
Container​
yes​
  • ​
Recycle bin rule information.​
TrashPath​
String​
Yes​
.Trash​
Recycle bin directory.​
CleanInterval​
Integer​
Yes​
7​
The number of days after which files or directories are permanently deleted from the recycle bin; must be a positive integer.​
Status​
String​
yes​
Enabled​
set whether the recycle bin is enabled; the values are as follows:​
  • Enabled: enables the recycle bin feature.​
  • Disabled: disables the recycle bin feature.​
​
Response headers​
This request returns common response headers. See common parameters.​
Response body elements​
No elements are used in this response.​
Sample request​
Sample request 1​
Enable the recycle bin function. The recycle bin path is .Trash in the root directory, and the expiration delete time is 7 days.​
​
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​
{​
"Trash": {​
"TrashPath": ".Trash",​
"CleanInterval": 7,​
"Status": "Enabled"​
}​
}​
​
Sample response 1​
None.​
Sample request 2​
Disable recycle bin feature.​
​
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​
{​
"Trash": {​
"TrashPath": ".Trash",​
"CleanInterval": 7,​
"Status": "Disabled"​
}​
}​
​
Sample response 2​
None.​
Last updated: 2026.01.07 14:31:34