Applies a GCS bucket's default object ACLs to all contained objects using batch JSON patch requests issued via the Google APIs Python Client Library.
api: storage
keywords: cmdline, pagination, oauth2
- As of February 2013, the Google APIs interface to Google Cloud Storage (a.k.a. the GCS JSON API) is in Limited Preview, so users must request access from the API Console Services tab:
- Visit the API Access tab of the APIs Console to create a client ID for
an installed application. The new Client ID will have a "Download JSON"
option; click on this to acquire a
client_secrets.json file
. - Download
acl_setter.py
from this repo.
- As of February 2013, the Google APIs interface to Google Cloud Storage (a.k.a. the GCS JSON API) is in Limited Preview, so users must request access from the API Console Services tab:
- Visit the API Access tab of the APIs Console to create a service account for your project and download its private key.
- Record the service account's email address.
- Download
acl_setter.py
from this repo.
To execute acl_setter.py
with user credentials, run
$ python acl_setter.py --bucket=mybucket --client_secrets=client_secrets.json --credentials_file=credentials.json
where
mybucket
is the target bucket,client_secrets.json
is the path to the client_secrets.json file you downloaded earlier,- and
credentials.json
is a path to a local file for storing OAuth2 tokens
To execute acl_setter.py
with user credentials, run
$ python acl_setter.py --bucket=mybucket --key_file=privatekey.p12 --client_email=1234567890-qwertyuiop@developer.gserviceaccount.com --credentials_file=credentials.json
where
mybucket
is the target bucket,privatekey.p12
is the path to your service account private key,- the
--client_email
flag supplies the service account email address you recorded earlier, - and
credentials.json
is a path to a local file for storing OAuth2 tokens
See CONTRIB.md
See LICENSE