Understand Google cloud storage Metadata and hands on tutorials to view and modify cloud storage bucket and object metadata.
Google Cloud Storage Bucket Metadata
google cloud storage buckets have metadata associated with them. Google cloud storage metadata specifies properties for buckets and objects how it should be handled when its accessed.
This would be Handon tutorial to learn and modify object storage metadata, and you can follow along.
Google cloud platform offers free credits worth 400 $ to learn and explore GCP services. These credits can be used over free trial program duration of 90 days to explore 20 + google cloud services. Learn more about free tier account set up here Google Cloud Free Credits – Google Cloud Tutorials .
It is recommended to always create a new GCP project for your demo. At the end of demo always remember to delete this project. This will ensure that all the services associated with the demo are delete and there is no recurring cost.
Google cloud storage bucket offers unlimited storage and maximum size of 5 TB for single object storage.
If you are new to google cloud storage bucket and would like to use cloud storage for free refer Google Cloud Storage Free – Google Cloud Tutorials .
Non-editable metadata
The following metadata is set during bucket creation, and cannot be edited or removed:
- Bucket Name
- Bucket Location
- GCP project which bucket is part of
Editable metadata
Editable metadata for cloud storage buckets can be set at the time or bucket creation or modified later at any point of time.
How to check cloud storage bucket metadata ?
In the Google Cloud console, go to the Cloud Storage Buckets page.
In the bucket list, click the name of the bucket whose metadata you want to view.
Navigate to Configuration to check bucket specific metadata information.
This includes editable and non-editable metadata.
Bucket name,Region,cloud console URL are some of non-editable bucket metadata.
Storage class, access controls permissions and Tags are some examples of editable bucket metadata.
Edit the required metadata and click on save.
Google Cloud Storage Object metadata
Every object stored in google cloud storage bucket have metadata associated with them. Metadata identifies properties of the object, as well as specifies how the object should be handled when it’s accessed. Metadata exists as key: value pairs.
Example of object storage metadata is storage class. Storage class is the metadata key, and every object must specify value for this key. It can either be standard, nearline, cold line or archive. Storage class is a key object metadata that impacts objects availability and pricing.
Learn more about object storage life cycle management and cost optimization Google Cloud Storage Life Cycle Management And Optimize Storage Cost – Google Cloud Tutorials.
Editable metadata
There are two categories of metadata that users can change for object.
Fixed-key metadata: Metadata whose keys are set, but for which you can specify a value.
Custom metadata: Metadata that you add by specifying both a key and a value associated with the key.
Fixed-key object metadata
You can edit the following metadata for objects, though you must have sufficient permissions to so.
- Cache-Control – The
Cache-Control
metadata allows you to control whether and for how long browser and Internet caches are allowed to cache your objects, which can then be served to satisfy future requests. - Content-Disposition – The
Content-Disposition
metadata specifies presentation information about the data being transmitted. SettingContent-Disposition
allows you to control presentation style of the content, for example determining whether an attachment should be automatically displayed or whether some form of action from the user should be required to open it. - Content-Encoding – The
Content-Encoding
metadata can be used to indicate that an object is compressed, while still maintaining the object’s underlyingContent-Type
. For example, a text file that is gzip compressed can have the fact that it’s a text file indicated inContent-Type
and the fact that it’s gzip compressed indicated inContent-Encoding
. You should ensure that files are, in fact, compressed using the specifiedContent-Encoding
before uploading them, or else unexpected behavior can occur when attempting to download the objects. - Content-Type – The most commonly set metadata is
Content-Type
(also known as media type), which lets browsers render the object properly. All objects have a value specified in theirContent-Type
metadata. - Custom-Time – The
Custom-Time
metadata is a user-specified date and time represented in the RFC3339 formatYYYY-MM-DD'T'HH:MM:SS.SS'Z'
orYYYY-MM-DD'T'HH:MM:SS'Z'
when milliseconds are zero. - Object holds – Use metadata flags to place object holds, which prevent objects from being deleted or replaced.
How to Edit Object Storage metadata in google cloud?
In the Google Cloud console, go to the Cloud Storage Buckets page
In the list of buckets, click on the name of the bucket that contains the desired object
search the required object whose metadata needs to be viewed or modified.
Click the more actions menu.
Click Edit metadata.
- For standard metadata fields, edit the Value.
- Add your own custom metadata by clicking the + Add item button.
- You can edit both the Key and Value of your custom metadata.
- Delete your custom metadata by clicking the associated X.
Click Save.
Custom Object metadata
Custom metadata is metadata for which you define both the key and the value. To create custom metadata, you specify both a key and a value. After you have created a custom metadata key:value
pair, you can delete the key or change the value. Custom metadata is subject to a size limit and incurs storage costs.
Non-editable Object metadata
Some metadata cannot be edited directly. This metadata is set at the time of object creation or rewrite. As part of the object creation or rewrite, you can set some such metadata, such as the storage class of the object or customer managed encryption keys. Other metadata is automatically added and can only be viewed, such the generation number of the object or the time of creation.
FAQ – Google Cloud Storage Metadata
What is storage metadata?
Cloud Storage buckets have metadata associated with them. Metadata identifies properties of the bucket and specifies how the bucket should be handled when it’s accessed.
What kind of data can be stored in Google Cloud Storage?
You can use google cloud storage to store media files and data. It is used to store unstructured data. It allows unlimited data storage with max storage of 5 TB per object.
How to create a bucket on Google Cloud Storage?
Cloud storage bucket can be created using google cloud console or using command line utility.
learn more Google Cloud Storage Free – Google Cloud Tutorials
gcloud storage buckets create gs://BUCKET_NAME