get-bucket-policy

Updated at:

Queries the policies of a specific bucket.

Usage notes

To query the policies of a specific bucket, you must have the oss:GetBucketPolicy permission. For more information, see Grant a custom policy.

Command syntax

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

Parameter

Type

Description

--bucket

string

The name of the bucket.

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

  • For more information about supported global command-line options, see Command-line options.

Examples

The following code provides an example of how to query the policies of a bucket named examplebucket:

ossutil api get-bucket-policy --bucket examplebucket