All Products
Search
Document Center

Object Storage Service: get-bucket-versioning

Last Updated:Aug 05, 2024

Queries the versioning status of a bucket.

Usage notes

To query the versioning status of a bucket, you must have the oss:GetBucketVersioning permission. For more information, see Attach a custom policy to a RAM user.

Command syntax

ossutil api get-bucket-versioning --bucket value [flags]

Parameter

Type

Description

--bucket

string

The name of the bucket.

Note

For more information, see Command-line options.

Examples

  • Query the versioning status of a bucket named examplebucket.

    ossutil api get-bucket-versioning --bucket examplebucket
  • Query the versioning status of a bucket named examplebucket and format the output in JSON.

    ossutil api get-bucket-versioning --bucket examplebucket --output-format json
  • Query the versioning status of a bucket named examplebucket and format the output in YAML.

    ossutil api get-bucket-versioning --bucket examplebucket --output-format yaml