Retrieves the Block Public Access configuration of Object Storage Service (OSS) resources.
Usage notes
An Alibaba Cloud account has the permissions to query the Block Public Access configuration by default. To perform this operation as a RAM user or by using Security Token Service (STS) credentials, you must have the oss:GetPublicAccessBlock permission. For more information, see Common examples of RAM policies.
Request syntax
GET /?publicAccessBlock HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue
Request headers
All headers in a GetPublicAccessBlock request are common request headers. For more information, see Common request headers.
Response headers
The response to a GetPublicAccessBlock request contains only common response headers. For more information, see Common response headers.
Response elements
|
Element |
Type |
Example |
Description |
|
PublicAccessBlockConfiguration |
Container |
N/A |
The container that stores the Block Public Access configuration. Parent nodes: none Child nodes: BlockPublicAccess |
|
BlockPublicAccess |
Boolean |
true |
Specifies whether Block Public Access is enabled for OSS resources.
|
Examples
-
Sample request
GET /?publicAccessBlock HTTP/1.1 Date: Mon, 19 Feb 2024 08:40:17 GMT Content-Length: 0 Content-Type: application/xml Host: oss-cn-hangzhou.aliyuncs.com Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e -
Sample success response
HTTP/1.1 200 OK x-oss-request-id: 534B371674E88A4D8906**** Date: Mon, 19 Feb 2024 08:40:17 GMT Server: AliyunOSS <?xml version="1.0" encoding="UTF-8"?> <PublicAccessBlockConfiguration> <BlockPublicAccess>true</BlockPublicAccess> </PublicAccessBlockConfiguration>
OSS SDKs
You can call GetPublicAccessBlock by using OSS SDKs for the following programming languages:
ossutil
For the ossutil command that corresponds to the GetPublicAccessBlock operation, see get-public-access-block.