All Products
Search
Document Center

Object Storage Service:get-object-acl

Last Updated:Sep 20, 2024

The get-object-acl command is used to query the access control list (ACL) of an object in a bucket.

Usage notes

  • By default, an Alibaba Cloud account has the permissions to query the ACLs of objects. To query the ACLs by using a RAM user or Security Token Service (STS), you must have the oss:GetObjectAcl permission. For more information, see Attach a custom policy to a RAM user.

  • If a GetObjectACL request is sent to query the ACL of an object for which ACL is not configured, OSS returns the default ACL for this object. In this case, the ACL of this object is the same as that of the bucket in which the object is stored. For example, if the ACL of the bucket in which the object is stored is private, the ACL of the object is also private.

Command syntax

ossutil api get-object-acl --bucket value --key value [flags]

Parameter

Type

Description

--bucket

string

Name of the bucket.

--key

string

Full path of the object.

--version-id

string

Version ID of the object.

Note
  • The get-object-acl command corresponds to the GetObjectACL operation. For more information about the parameters in the GetObjectACL operation, see GetObjectACL.

  • For more information about supported global command-line options, see Command-line options.

Examples

  • Query the ACL of examplebucket.

    ossutil api get-object-acl --bucket examplebucket --key exampleobject
  • Query the ACL of examplebucket and display the result in the JSON format.

    ossutil api get-object-acl --bucket examplebucket --key exampleobject --output-format json
  • Query the ACL of examplebucket and display the result in the YAML format.

    ossutil api get-object-acl --bucket examplebucket --key exampleobject --output-format yaml