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. 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:
|
-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