This page discusses the metadata fields that are stored along with buckets in Cloud Storage.
Introduction
Buckets created in Cloud Storage have metadata associated with them. Metadata identifies properties of the bucket and specifies how the bucket should be handled when it's accessed.
Some metadata exists as key: value
pairs. For example, the name of a bucket is
represented by the metadata entry name: my-bucket-name
for the JSON API. The
XML API presents such metadata as <elements></elements>
, such as
<LocationConstraint>US</LocationConstraint>
for the bucket location.
Other metadata can have an array of data associated with the key. For example, the lifecycle management metadata can contain a set of rules that apply to current and future objects in a bucket.
The mutability of metadata varies:
Some you can only view.
Some you can only set when the bucket is first created, and cannot edit or remove.
Some you can add and edit, but not remove.
Some you can add, edit, and remove at any time.
Non-editable metadata
The following metadata is set during bucket creation, and cannot be edited or removed:
The project the bucket is a part of
Metageneration number (automatically generated by Cloud Storage)
Editable metadata
There are two categories of metadata that you can change for buckets:
Fixed-key metadata
Fixed-key metadata is metadata whose keys are set, but for which you can specify a value.
1 This metadata cannot be viewed or managed using the XML API.
2 You can use the XML API to set this metadata during bucket creation, but not to view or manage this metadata.
Custom-key metadata
Custom-key metadata is metadata that you add by specifying both a key and a value associated with the key. For buckets, custom-key metadata is known as labels, which you use to organize your buckets.
What's next
- Learn how to view bucket metadata.
- Read more about object metadata.