Obtaining Bucket ACL Information
Function
This API obtains the ACL information of a specified bucket. For more information about bucket ACLs, see Configuring a Bucket ACL.
Authorization
To call this API, you must be the bucket owner or have the permission to obtain the ACL information of a bucket. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.
- If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
- If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you must have the obs:bucket:GetBucketAcl permission. For details, see Creating a Custom IAM Policy.
- If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you must have the obs:bucket:getBucketAcl permission, as shown in the following table. For details, see Creating a Custom IAM Identity Policy.
Action
Access Level
Resource Type (*: Required)
Dependencies
obs:bucket:getBucketAcl
Read
bucket *
-
-
-
- obs:EpochTime
- obs:SourceIp
- obs:TlsVersion
- obs:CustomDomain
- If you use bucket policies for authorization, you must have the obs:bucket:GetBucketAcl permission. For details, see Creating a Custom Bucket Policy.
URI
GET /
Calling Method
For details, see Calling APIs. Before calling this API, calculate the API signature and add it to the request.
You can debug this API in API Explorer.
Request Syntax
1 2 3 4 | GET /?acl HTTP/1.1 Host: bucketname.obs.region.myhuaweicloud.com Date: date Authorization: authorization |
URI Parameters
This request contains no URI parameters.
Request Headers
This request uses common headers. For details, see Table 3.
Request Body
This request contains no request body parameters.
Response Syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | HTTP/1.1 status_code Date: date Content-Length: length Content-Type: application/xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControlPolicy xmlns="http://obs.region.myhuaweicloud.com/doc/2015-06-30/"> <Owner> <ID>id</ID> </Owner> <AccessControlList> <Grant> <Grantee> <ID>id</ID> </Grantee> <Permission>permission</Permission> <Delivered>false</Delivered> </Grant> </AccessControlList> </AccessControlPolicy> |
Response Headers
This response uses common headers. For details, see Table 1.
Response Body
This response contains elements of information about the bucket ACL. Table 1 describes the elements.
| Element | Type | Description |
|---|---|---|
| Owner | XML | Definition Bucket owner information, which is the parent node of ID (bucket owner's account ID). Range N/A |
| ID | String | Definition Account ID of the bucket owner. Range N/A |
| AccessControlList | XML | Definition ACL that records all users who have the permission to access the bucket and their permissions. It is the parent node of Grant. Range N/A |
| Grant | XML | Definition Identifies users and user permissions. It is the parent node of Grantee, Permission, and Delivered. Range N/A |
| Grantee | XML | Definition Records user information. It is the parent node of ID (authorized user's account ID). Range N/A |
| Canned | String | Definition Grants permissions to everyone. Range Everyone |
| Delivered | Boolean | Definition Indicates whether the bucket ACL is applied to objects in the bucket. Range true: The bucket ACL is applied to the bucket objects. false: The bucket ACL is not applied to the bucket objects. |
| Permission | String | Definition Permissions of the bucket granted to a specified user. Range
|
Error Responses
Table 3 describes possible special errors in this request.
| Error Code | Description | HTTP Status Code |
|---|---|---|
| NoSuchBucket | The bucket is not found. | 404 Not Found |
Refer to Error Code Overview for all other errors.
Sample Request
1 2 3 4 5 6 | GET /?acl HTTP/1.1 User-Agent: curl/7.29.0 Host: examplebucket.obs.region.myhuaweicloud.com Accept: */* Date: Wed, 01 Jul 2015 02:39:28 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:X7HtzGsIEkzJbd8vo1DRu30vVrs= |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | HTTP/1.1 200 OK Server: OBS x-obs-request-id: BF260000016436B69D82F14E93528658 x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSjTh8661+HF5y8uAnTOBIpNO133hji+ Content-Type: application/xml Date: Wed, 01 Jul 2015 02:39:28 GMT Content-Length: 784 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControlPolicy xmlns="http://obs.ap-southeast-1.myhuaweicloud.com/doc/2015-06-30/"> <Owner> <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> </Owner> <AccessControlList> <Grant> <Grantee> <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> <Grant> <Grantee> <ID>783fc6652cf246c096ea836694f71855</ID> </Grantee> <Permission>READ</Permission> <Delivered>false</Delivered> </Grant> <Grant> <Grantee> <Canned>Everyone</Canned> </Grantee> <Permission>READ_ACP</Permission> </Grant> </AccessControlList> </AccessControlPolicy> |
Using SDKs to Call APIs
You are advised to use OBS SDKs to call APIs. SDKs encapsulate APIs to simplify development. You can call SDK API functions to access OBS without manually calculating signatures.
Helpful Links
- For more information about bucket ACL, see Configuring a Bucket ACL.
- For details about the billing items involved in API operations, see Billing Items.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot