Use case – Object Versioning
Object Versioning is the GCP's way of automatic archival. Once object versioning is enabled for a bucket, every version of the object (resulting from multiple writes) will be given an identification tag, which will be called generation number and all of the versions will be archived automatically.
Object versioning in the Cloud Storage bucket
This is an API and command-line exclusive (at the time of writing), so console will not provide any hints. Versioning can be set using gsutil
with the following steps:
- Apply the
gsutil versioning set on
command, with the appropriate values. This will enable object versioning for all objects in the bucket. TheSet off
argument will turn it off:
gsutil versioning set on gs://loonycorn-bucket-00
- Similarly, the get argument will check whether versioning is enabled or not:
gsutil versioning get gs://loonycorn-bucket-00
- The versions of an object are identified by their generation number. So, in order to list all of the objects in the...