I have 1000 files in Google Cloud Storage to make public, or in general a directory hierarchy.
In the Web UI, I can only seem to make one at a time public.
Is there some way to do this.
Run gsutil -m acl set -R -a public-read gs://bucket
-m
issues multiple requests at the same time.-R
issues requests for every object in your bucket.-a
issues requests for every version of every object.See gsutil help acl
for more info.
At the API layer gsutil issues the following HTTP request:
PUT /bucket/obj?acl HTTP/1.1
Host: storage.googleapis.com
x-goog-acl: public-read
You can see this by using the -D
flag with gsutil
:
gsutil -D setacl public-read gs://bucket/obj