Help Center/ Object Storage Service/ SDK Reference/ Go/ Bucket-Related APIs (SDK for Go)/ Obtaining the Public Access Status of a Bucket Policy (SDK for Go)
Updated on 2025-12-01 GMT+08:00

Obtaining the Public Access Status of a Bucket Policy (SDK for Go)

Function

This API obtains the public access status of an OBS bucket policy.

Restrictions

Method

func (obsClient ObsClient) GetBucketPolicyPublicStatus(input *GetBucketPolicyPublicStatusInput) (output *BaseModel, err error)

Request Parameters

Table 1 List of request parameters

Parameter

Type

Mandatory (Yes/No)

Description

input

*GetBucketPolicyPublicStatusInput

Yes

Explanation:

Request parameters for obtaining the public access status of an OBS bucket policy. For details, see GetBucketPolicyPublicStatusInput.

Table 2 GetBucketPolicyPublicStatusInput

Parameter

Type

Mandatory (Yes/No)

Description

bucketName

String

Yes

Explanation:

Bucket name.

Restrictions:

  • A bucket name must be unique across all accounts and regions.
  • A bucket name:
    • Must be 3 to 63 characters long and start with a digit or letter. Lowercase letters, digits, hyphens (-), and periods (.) are allowed.
    • Cannot be formatted as an IP address.
    • Cannot start or end with a hyphen (-) or period (.).
    • Cannot contain two consecutive periods (..), for example, my..bucket.
    • Cannot contain a period (.) and a hyphen (-) adjacent to each other, for example, my-.bucket or my.-bucket.
  • If you repeatedly create buckets of the same name in the same region, no error will be reported and the bucket attributes comply with those set in the first creation request.

Default value:

None

Responses

Table 3 List of returned results

Parameter

Type

Description

output

*BaseModel

Explanation:

Returned results. For details, see Table 4.

err

error

Explanation:

Error messages returned by the API

Table 4 BaseModel

Parameter

Type

Description

statusCode

int

Explanation:

HTTP status code.

Value range:

A status code is a group of digits indicating the status of a response. It ranges from 2xx (indicating successes) to 4xx or 5xx (indicating errors).

For more information, see Status Code.

Default value:

None

RequestId

string

Explanation:

Request ID returned by the OBS server

Default value:

None

ResponseHeaders

map[string][]string

Explanation:

HTTP response headers

Default value:

None

IsPublic

Boolean

Explanation:

Whether the bucket is public.

Default value:

False