How To View And Edit Object Metadata In Cloud Storage

How To View And Edit Object Metadata In Cloud Storage

How To View And Edit Object Metadata In Cloud Storage

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed PubSub Notification in Cloud Storage.

https://cloudaffaire.com/how-to-configure-pubsub-notifications-for-cloud-storage/

In this blog post, we will discuss how to view and edit Object Metadata in Cloud Storage.

Object metadata:

Objects stored in Cloud Storage 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. The mutability of metadata varies: some metadata you can edit at any time, some metadata you can only set at the time the object is created, and some metadata you can only view.

Editable metadata:

There are two categories of metadata that users can change for objects:

  • Fixed-key metadata: Metadata whose keys are set, but for which you can specify a value.
    • Access control metadata: Cloud Storage uses Identity and Access Management (IAM) and Access Control Lists (ACLs) to control access to objects.
    • Cache-Control: The Cache-Control metadata can specify two different aspects of how data is served from Cloud Storage: whether the data can be cached and whether the data can be transformed.
      • Caching data: 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.
      • Transforming data: Cache-Control metadata also allows you to serve objects as they are stored, without applying any transformations to the data, such as removing gzip content-encoding for incompatible clients.
    • Content-Disposition: The Content-Disposition metadata specifies presentation information about the data being transmitted. Setting Content-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 underlying Content-Type.
    • Content-Language: The Content-Language metadata indicates the language(s) that the object is intended for.
    • Content-Type: The most commonly set metadata is Content-Type (also known as media type), which allows browsers to render the object properly.
  • Custom metadata: Custom metadata is metadata that you can add and remove. To create custom metadata, you specify both a value and a key. Once you have created a custom metadata key:value pair, you can delete the key or change the value.

Non-editable 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.

Sample Object Metadata:

How To View And Edit Object Metadata:

Hope you have enjoyed this article. In the next blog post, we will discuss the Retention Policy in cloud storage.

All the public cloud providers are changing the console user interface rapidly and due to this some of the screenshots used in our previous AWS blogs are no longer relevant. Hence, we have decided that from now onwards most of the demo will be done programmatically. Let us know your feedback on this in the comment section.

To get more details on cloud storage, please refer below GCP documentation.

https://cloud.google.com/storage/docs/

https://cloud.google.com/storage/docs/metadata

 

Leave a Reply

Close Menu