All Products
Search
Document Center

Object Storage Service:get-bucket-public-access-block

Last Updated:Nov 12, 2024

The get-bucket-public-access-block command is used to query the Block Public Access configurations of a bucket.

Usage notes

By default, an Alibaba Cloud account has the permission to query the Block Public Access configurations of a bucket. Making query requests as a RAM user or by using Security Token Service (STS) requires oss:GetBucketPublicAccessBlock permission. For more information, see Attach a custom policy to a RAM user.

Command syntax

ossutil api get-bucket-public-access-block --bucket value [flags]

Parameter

Type

Description

--bucket

string

Name of the bucket.

Note
  • The get-bucket-public-access-block command corresponds to the GetBucketPublicAccessBlock operation. For more information about the parameters within, see GetBucketPublicAccessBlock.

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

Examples

  • Query the Block Public Access configurations of examplebucket.

    ossutil api get-bucket-public-access-block --bucket examplebucket
  • Query the Block Public Access configurations of examplebucket and display the configurations in the JSON format.

    ossutil api get-bucket-public-access-block --bucket examplebucket --output-format json
  • Query the Block Public Access configurations of examplebucket and display the configurations in the YAML format.

    ossutil api get-bucket-public-access-block --bucket examplebucket --output-format yaml