tencent cloud

Bucket Versioning - bucket-versioning
Last updated: 2025-05-09 18:27:40
Bucket Versioning - bucket-versioning
Last updated: 2025-05-09 18:27:40
The bucket-versioning command is used to manage versioning for a bucket. It can be used to enable, suspend, and view the status of bucket versioning.
Note:
If you need to use the command to enable/suspend versioning, when you perform authorization policy, set action to cos:PutBucketVersioning.
If you need to use the command to view the bucket versioning status, when you perform authorization policy, set action to cos:GetBucketVersioning.
For more authorizations, please see CAM-Enabled API.

Command Syntax

The following bucket-versioning commands are used to enable and suspend versioning:
./coscli bucket-versioning --method [method] cos://<bucket-name> versioning
The bucket-versioning and its subcommands include the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
Views the usage of this command.
-c
--method
Valid values: put/get.

Operation Example

Enable Bucket Versioning

./coscli bucket-versioning --method put cos://examplebucket Enabled

Suspend Bucket Versioning

./coscli bucket-versioning --method put cos://examplebucket Suspended

View Bucket Versioning Status

./coscli bucket-versioning --method get cos://examplebucket
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback