All Products
Search
Document Center

Object Storage Service: get-bucket-versioning

Last Updated:Mar 20, 2026

Queries the versioning status of a bucket.

Prerequisites

Before you begin, ensure that you have:

Syntax

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

Parameters

ParameterTypeRequiredDescription
--bucketstringYesThe name of the bucket.

For global flags, see Command-line options.

Examples

Query the versioning status of examplebucket:

ossutil api get-bucket-versioning --bucket examplebucket

Query the versioning status and format the output as JSON:

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

Query the versioning status and format the output as YAML:

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