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

Torch Object Storage

Copy page
Download PDF
Versioning
PutBucketVersioning
Copy page
Download PDF
PutBucketVersioning
Feature description​
This interface sets the versioning feature for a bucket. The versioning feature allows multiple versions of the same object within a bucket to be retained simultaneously, preventing accidental deletion or overwriting of objects, and can also be used to archive historical versions.​
Notes​
  • Only users with PutBucketVersioning permission can invoke the PutBucketVersioning interface. By default, the bucket owner directly holds the PutBucketVersioning permission, and the bucket owner can grant this permission to other users. For detailed instructions on permission control via bucket policy, refer to Bucket Authorization Policy Management.​
  • The versioning feature of a bucket is disabled by default. For detailed information on the bucket versioning feature, see Versioning Overview.​
  • HNS buckets do not support the PutBucketVersioning interface.​
Request syntax​
​
PUT /?versioning HTTP/1.1 ​
Host: bucketname.tos-cn-beijing.volces.com​
Date: GMT Date​
Authorization: authorization string​
​
{ ​
"Status":"Enabled"​
}​
​
Request parameters and headers​
This request uses common request headers. See Common Parameters.​
​
Name​
Location​
Type​
Required​
Sample value​
Note​
versioning​
Query​
String​
Yes​
-​
Represents a special identifier for the PutBucketVersioning request.​
​
Request body elements​
​
Name​
Type​
Required​
Sample value​
Note​
Status​
String​
Yes​
Enabled​
Enable or disable bucket versioning with the following values:​
  • Enabled: enable versioning.​
  • Suspended: suspend versioning.​
​
Response headers​
This request returns common response headers. See Common Parameters.​
Response body elements​
No elements are used in the response for this request.​
Sample request​
​
PUT /?versioning HTTP/1.1 ​
Host: bucketname.tos-cn-beijing.volces.com​
Date: GMT Date​
Authorization: authorization string​
​
{ ​
"Status":"Enabled"​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
x-tos-id-2: 1874010a59fb053f650a59fb-be4a38d-1qin1v-PuO-cb-tos-front-azc-1 ​
x-tos-request-id: 1874010a59fb053f650a59fb-be4a38d-1qin1v-PuO-cb-tos-front-azc-1 ​
Date: Wed, 20 Sep 2023 02:28:54 GMT​
server: TosServer​
Content-Length: 0​
​
​
Last updated: 2025.09.08 17:32:47