All Products
Search
Document Center

Object Storage Service:get-bucket-policy

Last Updated:Mar 20, 2026

Retrieves the bucket policy for a specific bucket.

Prerequisites

Before you begin, ensure that you have:

Syntax

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

Parameters

ParameterTypeRequiredDescription
--bucketstringYesThe name of the bucket.

For supported global flags, see Command-line options.

The get-bucket-policy command corresponds to the GetBucketPolicy API operation. For more information about the parameters in the GetBucketPolicy operation, see GetBucketPolicy.

Examples

Retrieve a bucket policy

Retrieve the bucket policy for examplebucket:

ossutil api get-bucket-policy --bucket examplebucket