JENNY BROWN: So far on Cloud Storage Bytes,
we've talked about managing object data
through renaming, moving, and deleting.
But there's another facet of managing objects
that's equally important--
managing metadata.
Today we'll take a look at what metadata
is available in a Cloud Storage object and how it's used.
Let's get started.
[CHEERFUL MUSIC]
Metadata identifies properties of a Cloud Storage object
and 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.
So, first, let's talk about editable metadata.
There are two categories of metadata
that are editable by users--
fixed-key metadata and custom metadata.
With fixed-key metadata, the keys are set,
but you can specify a value.
With custom metadata, you have to specify
both a key and a value.
You can edit this list of fixed key metadata values for objects
if you have sufficient permission to do so.
Cloud Storage uses identity and access management and access
control lists to control access to objects, including access
to the object's metadata.
If you'd like to know more about access control,
check out our episode and the related documentation.
The Cache-Control metadata can specify two different aspects
of how data is served from Cloud Storage--
if it can be cached and if it can be transformed.
I won't say more about Cache-Control here
because that'll be enough for a future video,
but you can also find out more in the documentation linked
below.
The Content-Disposition metadata specifies
presentation information about the data being transmitted.
Setting Content-Disposition allows
you to control the presentation of 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.
Check the links in the description
to see the Content-Disposition specification.
The Content-Encoding metadata can
be used to indicate that an object is compressed
while still maintaining the object's underlying content
type.
For example, a text file that is gzip compressed
can have the fact that it's a text file indicated
in the Content-Type and the fact that it's gzip compressed
indicated in Content-Encoding.
The Content-Language metadata indicates the language
or languages that the object is intended for.
Refer to ISO 639-1 language codes for the supported values
of this metadata.
The most commonly set metadata is Content-Type, also
known as media type.
This allows browsers to render the object properly.
All objects of a value is specified
in their Content-Type metadata, but this value
does not have to match the underlying type of the object.
For example, if the Content-Type isn't specified
when the object gets uploaded and it's not a common data
type, chances are it's going to be something generic or just
wrong in the metadata.
Custom metadata are like standard metadata,
except you can specify custom metadata key/value pairs.
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.
You can edit fixed-key and custom metadata
from the REST API, gsutil, and the Cloud Platform console.
Let's take a look at the console.
Open the Cloud Storage browser in the Cloud Platform console.
In the list of buckets, click on the name
of the bucket that contains the desired object
and navigate to the object.
Click the three dots for more options associated
with the object.
Click Edit metadata.
In the overlay window that appears,
make the desired edits to the metadata.
For standard metadata fields, edit the value.
Add your own custom metadata by clicking
the plus sign Add Item button.
You can edit both the key and the value of your custom
metadata.
Delete your custom metadata by clicking the associated X.
Finally, click Save.
And now you know how to edit metadata from the console.
But some metadata can't 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-supplied encryption
keys.
Other metadata is automatically added
and can only be viewed, such as the generation
number of the object or the time of creation.
Find out more in the docs linked below.
There's clearly a lot more you can do about metadata,
but that's for a totally different episode.
If you want to know about how Cloud Storage uses metadata,
check out the links in the description.
Don't forget to subscribe, give us a like,
and tell us what you want to learn about Google Cloud
Storage.
Thanks for joining us for this quick byte of Cloud Storage.
See you next time.
[CHEERFUL MUSIC]