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: Preview Preview Preview
  • 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: Preview Preview
  • gsutil: Refer Here for cp command line reference Preview Preview Preview

Exercise:

  • Create a folder in your local machine and create some files Preview
  • 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>

Preview

  • Now lets create some more files Preview
  • 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 Preview Preview
  • To display the disk usage of the objects Preview

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

Preview

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

Leave a Reply

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

About learningthoughtsadmin