Retrieves the bucket policy for a specific bucket.
Prerequisites
Before you begin, ensure that you have:
The
oss:GetBucketPolicypermission on the target bucket. For more information, see Attach a custom policy to a RAM user.
Syntax
ossutil api get-bucket-policy --bucket <value> [flags]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | The name of the bucket. |
For supported global flags, see Command-line options.
Theget-bucket-policycommand corresponds to theGetBucketPolicyAPI operation. For more information about the parameters in theGetBucketPolicyoperation, see GetBucketPolicy.
Examples
Retrieve a bucket policy
Retrieve the bucket policy for examplebucket:
ossutil api get-bucket-policy --bucket examplebucket