ó
ôBQc @ s0 d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d
l m
Z
d d l m Z d d l m
Z
d d
l m Z d d l m Z d d l m Z d d l m Z d d l m Z d Z d e f d „ ƒ YZ d S( iÿÿÿÿ( t Command( t COMMAND_NAME( t COMMAND_NAME_ALIASES( t CONFIG_REQUIRED( t FILE_URIS_OK( t MAX_ARGS( t MIN_ARGS( t PROVIDER_URIS_OK( t SUPPORTED_SUB_ARGS( t URIS_START_ARG( t HELP_NAME( t HELP_NAME_ALIASES( t HELP_ONE_LINE_SUMMARY( t HELP_TEXT( t HelpType( t HELP_TYPE( t NO_MAXs
SYNOPSIS
gsutil setacl [-R] file-or-canned_acl_name uri...
DESCRIPTION
The setacl command allows you to set an Access Control List on one or
more buckets and objects. The simplest way to use it is to specify one of
the canned ACLs, e.g.,:
gsutil setacl private gs://bucket
or:
gsutil setacl public-read gs://bucket/object
See "gsutil help acls" for a list of all canned ACLs.
If you want to define more fine-grained control over your data, you can
retrieve an ACL using the getacl command (see "gsutil help getacl"),
save the output to a file, edit the file, and then use the gsutil setacl
command to set that ACL on the buckets and/or objects. For example:
gsutil getacl gs://bucket/file.txt > acl.txt
(Make changes to acl.txt such as adding an additional grant.)
gsutil setacl acl.txt gs://cats/file.txt
Note that you can set an ACL on multiple buckets or objects at once,
for example:
gsutil setacl acl.txt gs://bucket/*.jpg
If you have a large number of ACLs to update you might want to use the
gsutil -m option, to perform a parallel (multi-threaded/multi-processing)
update:
gsutil -m setacl acl.txt gs://bucket/*.jpg
Note that multi-threading/multi-processing is only done when the named URIs
refer to objects. gsutil -m setacl gs://bucket1 gs://bucket2 will run the
setacl operations sequentially.
One other note: If you want to change a set of ACLs by adding and removing
grants, without the need to manually retrieve and edit the XML representation,
you can do that with the chacl command (see 'gsutil help chacl').
OPTIONS
-R, -r Performs setacl request recursively, to all objects under the
specified URI.
-a Performs setacl request on all object versions.
t
SetAclCommandc B sˆ e Z d Z i d e 6g e 6d e 6e e 6d e 6e e
6e e 6d e 6e
e 6Z i d e 6g e 6e j e 6d e 6e e 6Z d „ Z RS( s( Implementation of gsutil setacl command.t setacli t aRrvi s Set bucket and/or object ACLsc C s– | j rˆ x| | j D]n \ } } | d k r7 t | _ q | d k sO | d k r[ t | _ q | d k r | j j d | j ƒ q q Wn | j ƒ d S( Ns -as -rs -Rs -vsO WARNING: The %s -v option is no longer needed, and will eventually be removed.
i ( t sub_optst Truet all_versionst recursion_requestedt THREADED_LOGGERt infot command_namet SetAclCommandHelper( t selft ot unused_a( ( s3 /tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/setacl.pyt
RunCommand~ s
( t __name__t
__module__t __doc__R R R R R R t FalseR R R R R t command_specR
R R t COMMAND_HELPR R t _detailed_help_textR
t help_specR ( ( ( s3 /tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/setacl.pyR X s$
N( t
gslib.commandR R R R R R R R R R t gslib.help_providerR
R R R
R R t
gslib.utilR R&