All Products
Search
Document Center

Object Storage Service:get-bucket-encryption

Last Updated:Mar 20, 2026

Returns the server-side encryption (SSE) rules configured for a bucket. For a complete description of the response structure and field definitions, see GetBucketEncryption.

Usage notes

By default, an Alibaba Cloud account has permission to query a bucket's encryption rules. To use a RAM user or Security Token Service (STS) to query encryption rules, the RAM user or STS role must have the oss:GetBucketEncryption permission. For more information, see Attach a custom policy to a RAM user.

Syntax

ossutil api get-bucket-encryption --bucket value [flags]
ParameterTypeDescription
--bucketstringThe name of the bucket to query.
Note: The get-bucket-encryption command maps to the GetBucketEncryption API operation. For supported global flags, see Command-line options.

Examples

Query encryption rules (default output format)

ossutil api get-bucket-encryption --bucket examplebucket

Query encryption rules in JSON format

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

Query encryption rules in YAML format

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