• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Buckets
  5. PUT Bucket acl
  6. Requests

Requests

Syntax

PUT /?acl HTTP/1.1 
 User-Agent: agent
 Host: bucketname.obs.example.com 
 Date: date 
 Authorization: authorization  
 Content-Length: length 

 <AccessControlPolicy> 
 <Owner> 
 <ID>ID</ID>
 <DisplayName>displayname</DisplayName> 
 </Owner>
 <AccessControlList>
 <Grant>
 <Grantee>grantee</Grantee> 
 <Permission>permission</Permission> 
 </Grant>
 </AccessControlList>
 </AccessControlPolicy>    

Request Parameters

This request involves no parameters.

Request Headers

You can set the ACL of a bucket to a predefined ACL, also called a canned ACL. Each canned ACL has a predefined set of grantees and permission.

Optional header x-amz-acl is used in this request to specify canned ACLs. Table 1 describes the optional header.

Table 1 Optional header for specifying canned ACLs

Header

Description

Remarks

x-amz-acl

Indicates the canned ACL applied to a bucket.

Type: String

Valid values: private| public-read| public-read-write|authenticated-read|bucket-owner-read|bucket-owner-full-control|log-delivery-write

Optional

x-amz-security-token

Header field used to identify the request of a federated user. When the federal authentication function is enabled, users sending such requests are identified as federated users.

Type: string

Optional. This parameter must be carried in the request sent by federated users.

Request Elements

This request uses elements to specify an ACL. Table 2 describes the elements.

Table 2 Request elements

Element

Description

Remarks

Owner

Indicates the bucket owner. This element consists of ID and DisplayName.

Type: XML

Optional

ID

Indicates the DomainId of a grantee.

Type: String

Optional

DisplayName

Indicates the name of the grantee.

Type: String

Optional

Grant

Container for the grantee and its permission.

Type: XML

Optional

Grantee

Container for the details about the grantee. For details, see Table 1.

Type: XML

Optional

Permission

Indicates the permission to be granted. For details, see Table 2.

Type: Enumeration

Optional

AccessControlList

Indicates the ACL. This element consists of GrantGrantee, and Permission.

Type: XML

Optional