DEV Community

Cover image for How to setmeta - Set metadata on already uploaded objects,multiple Objects -GCS
PREM KUMAR
PREM KUMAR

Posted on

 

How to setmeta - Set metadata on already uploaded objects,multiple Objects -GCS

The gsutil setmeta command allows you to set or remove the metadata on one or more objects. It takes one or more header arguments followed by one or more URLs, where each header argument is in one of two forms:

gsutil setmeta -h [header:value|header] ... url...
Enter fullscreen mode Exit fullscreen mode

setmeta to a object If you want to set cache-control to "public" then execute in Cloud Shell:

gsutil setmeta -h "Cache-Control:public" gs://<YOUR-BUCKET-NAME>/objectName
Enter fullscreen mode Exit fullscreen mode

setmeta to multiple object If you want to set cache-control to "public" then execute in Cloud Shell:

gsutil setmeta -h "Cache-Control:public" gs://<YOUR-BUCKET-NAME>/*.*
Enter fullscreen mode Exit fullscreen mode

*.* will add add the files inside the directory

Be a Opensource Contributor

Top comments (0)

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!