GCP Classroom Series – 01/Apr/2021

Change the storage class of buckets and objects

  • We can modify the storage class fo bucket either from gsutil or from console
  • Console:
  • The similar functionality on the cmdline can be achieved by using
gsutil rewrite -s coldine gs://bucketname/objectname

Upload the data to the buckets

  • Console:
  • gsutil: Refer Here for cp command line reference

Exercise:

  • Create a folder in your local machine and create some files
  • Now write the gsutil commands to create the storage bucket and upload all the files to the storage bucket
gsutil cp tbd/*.txt gs://<bucket-name>

  • Now lets create some more files
  • Now lets synchronize the contents of the folder to gcs bucket using gcs rsync
gsutil rsync ./tbd gs://<bucket-name>
gsutil ls gs://<bucket-name>/
  • Try to find a cli to set objectReader Permission to all objects in a bucket
  • To display the disk usage of the objects

Scenario:

  • We are using GCS to store the documents
  • Our organizations updates these documents regulary and needs to have the history of the documents.
  • In GCS we have versioning
  • To set versioning
gsutil versioning set on gs://bucketname

  • Now lets upload 1.txt again
  • when you upload a new version then the generation number is associated with the file

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%