- Documentation
Torch Object Storage
API Reference
Bucket
Versioning
PutBucketVersioning
Versioning
PutBucketVersioning
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
Authorization: authorization string
Request parameters and headers
Request body elements
Response headers
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
Authorization: authorization string
Sample response
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
Last updated: 2025.09.08 17:32:47