PutObjectACL
    • PDF

    PutObjectACL

    • PDF

    Article Summary

    Available in Classic and VPC

    Create an access control list (ACL) to apply to the object.
    You can control access to specific objects stored in a bucket. Access permissions can be granted by account or by default ACLs created.

    Note

    For a description of the types of permissions and default ACLs that can be granted by the Object Storage service, see Object Storage overview.

    Requests

    The following describes the request format for the endpoint. The request format is as follows.

    MethodURI
    PUT/{bucket-name}/{object-name}

    Request syntax

    The request syntax is as follows.

    PUT https://{endpoint}/{bucket-name}/{object-name}?acl= # path style
    PUT https://{bucket-name}.{endpoint}/{object-name}?acl= # virtual host style
    

    Request headers

    The following describes the PutObjectACL header. For headers common to all Object Storage APIs, see Object Storage common headers.

    FieldTypeRequiredDescription
    x-amz-aclStringRequiredPermission type to grant
    • private (default) | public-read | authenticated-read
      • private: grant FULL_CONTROL permissions to the owner
      • public-read: grant FULL_CONTROL permissions to the owner, and grant READ permissions to all users
      • authenticated-read: grant FULL_CONTROL permissions to the owner, and grant READ permissions to authenticated users

    Request path parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    bucket-nameStringRequiredName of the bucket where the object is stored
    object-nameStringRequiredObject to apply the ACL to

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    aclStringRequiredDeclare to apply the default ACL to the object
    • Enter only keys without values

    Request example

    The following is a sample request.

    Default ACL

    The following is an example of assigning a default ACL to an object.

    PUT /example-bucket/queen-bee?acl= HTTP/1.1
    Authorization: {authorization-string}
    x-amz-date: 20161207T162842Z
    x-amz-acl: public-read
    Host: kr.object.ncloudstorage.com
    

    ACL for object upload

    The following is an example of assigning an ACL directly when uploading an object.

    PUT /example-bucket/queen-bee HTTP/1.1
    Authorization: {authorization-string}
    x-amz-date: 20161207T162842Z
    x-amz-acl: public-read
    Host: kr.object.ncloudstorage.com
    

    Custom ACL

    The following is an example of assigning an ACL defined by the user.

    PUT /example-bucket/queen-bee?acl= HTTP/1.1
    Authorization: {authorization-string}
    x-amz-date: 20161207T163315Z
    Content-Type: text/plain
    Host: kr.object.ncloudstorage.com
    Content-Length: 564
    
    <?xml version="1.0" encoding="UTF-8"?>
    <AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
      <Owner>
        <ID>{owner-user-id}</ID>
        <DisplayName>{owner-user-id}</DisplayName>
      </Owner>
      <AccessControlList>
        <Grant>
          <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
            <ID>{first-grantee-user-id}</ID>
            <DisplayName>{first-grantee-user-id}</DisplayName>
          </Grantee>
          <Permission>READ_ACP</Permission>
        </Grant>
        <Grant>
          <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
            <ID>{second-grantee-user-id}</ID>
            <DisplayName>{second-grantee-user-id}</DisplayName>
          </Grantee>
          <Permission>FULL_CONTROL</Permission>
        </Grant>
      </AccessControlList>
    </AccessControlPolicy>
    

    Responses

    The following describes the response format.

    Response headers

    For response headers common to all Object Storage APIs, see Object Storage common response headers.

    Response status codes

    For response status codes common to all Object Storage APIs, see Object Storage response status codes.

    Response example

    The following is a sample response.

    Default ACL

    The following is a sample default ACL response.

    HTTP/1.1 200 OK
    Date: Wed, 07 Dec 2016 16:28:42 GMT
    Accept-Ranges: bytes
    x-amz-request-id: b8dea44f-af20-466d-83ec-2a8563f1617b
    Content-Length: 0
    

    ACL for object upload

    The following is a sample ACL response when uploading an object.

    HTTP/1.1 200 OK
    Date: Wed, 07 Dec 2016 16:28:42 GMT
    Accept-Ranges: bytes
    x-amz-request-id: b8dea44f-af20-466d-83ec-2a8563f1617b
    Content-Length: 0
    

    Custom ACL

    The following is a sample custom ACL response.

    HTTP/1.1 200 OK
    Date: Wed, 07 Dec 2016 17:11:51 GMT
    Accept-Ranges: bytes
    x-amz-request-id: ef02ea42-6fa6-4cc4-bec4-c59bc3fcc9f7
    Content-Length: 0
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.