Class ObjectACL (3.5.0)

ObjectACL(blob)

An ACL specifically for a Cloud Storage object / blob.

Parameter

NameDescription
blobBlob

The blob that this ACL corresponds to.

Properties

client

The client bound to this ACL's blob.

reload_path

Compute the path for GET API requests for this ACL.

save_path

Compute the path for PATCH API requests for this ACL.

user_project

Compute the user project charged for API requests for this ACL.

Methods

clear

clear(client=None,if_generation_match=None,if_generation_not_match=None,if_metageneration_match=None,if_metageneration_not_match=None,timeout=60,retry=google.api_core.retry.retry_unary.Retry,)

Remove all ACL entries.

Ifuser_project is set, bills the API request to that project.

Note that this won't actually removeALL the rules, but itwill remove all the non-default rules. In short, you'll stillhave access to a bucket that you created even after you clearACL rules with this method.

Parameters
NameDescription
clientClient orNoneType

(Optional) The client to use. If not passed, falls back to theclient stored on the ACL's parent.

if_generation_matchlong

(Optional) See :ref:using-if-generation-match

if_generation_not_matchlong

(Optional) See :ref:using-if-generation-not-match

if_metageneration_matchlong

(Optional) See :ref:using-if-metageneration-match

if_metageneration_not_matchlong

(Optional) See :ref:using-if-metageneration-not-match

timeoutfloat or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See:configuring_timeouts

retrygoogle.api_core.retry.Retry orgoogle.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See:configuring_retries

save

save(acl=None,client=None,if_generation_match=None,if_generation_not_match=None,if_metageneration_match=None,if_metageneration_not_match=None,timeout=60,retry=google.api_core.retry.retry_unary.Retry,)

Save this ACL for the current object.

Ifuser_project is set, bills the API request to that project.

Parameters
NameDescription
aclACL, or a compatible list.

The ACL object to save. If left blank, this will save current entries.

clientClient orNoneType

(Optional) The client to use. If not passed, falls back to theclient stored on the ACL's parent.

if_generation_matchlong

(Optional) See :ref:using-if-generation-match

if_generation_not_matchlong

(Optional) See :ref:using-if-generation-not-match

if_metageneration_matchlong

(Optional) See :ref:using-if-metageneration-match

if_metageneration_not_matchlong

(Optional) See :ref:using-if-metageneration-not-match

timeoutfloat or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See:configuring_timeouts

retrygoogle.api_core.retry.Retry orgoogle.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See:configuring_retries

save_predefined

save_predefined(predefined,client=None,if_generation_match=None,if_generation_not_match=None,if_metageneration_match=None,if_metageneration_not_match=None,timeout=60,retry=google.api_core.retry.retry_unary.Retry,)

Save this ACL for the current object using a predefined ACL.

Ifuser_project is set, bills the API request to that project.

Parameters
NameDescription
predefinedstr

An identifier for a predefined ACL. Must be one of the keys inPREDEFINED_JSON_ACLS orPREDEFINED_XML_ACLS (which will be aliased to the corresponding JSON name). If passed,acl must be None.

clientClient orNoneType

(Optional) The client to use. If not passed, falls back to theclient stored on the ACL's parent.

if_generation_matchlong

(Optional) See :ref:using-if-generation-match

if_generation_not_matchlong

(Optional) See :ref:using-if-generation-not-match

if_metageneration_matchlong

(Optional) See :ref:using-if-metageneration-match

if_metageneration_not_matchlong

(Optional) See :ref:using-if-metageneration-not-match

timeoutfloat or tuple

(Optional) The amount of time, in seconds, to wait for the server response. See:configuring_timeouts

retrygoogle.api_core.retry.Retry orgoogle.cloud.storage.retry.ConditionalRetryPolicy

(Optional) How to retry the RPC. See:configuring_retries

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-11-05 UTC.