Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

Custom metadata headers are created as a means to pass data required by applications. Including custom metadata on stored objects increases the usefulness of content: it provides information that can be indexed by Elasticsearch and used to find, filter, and analyze the content later.

...

Note

Swarm stores these headers and supplied values without parsing, validation, or modification.

Work with custom metadata through the WRITE, UPDATE, and COPY methods. The COPY method allows updating and adding to the metadata on objects after the initial WRITE.

Info

Tip

With COPY requests, add the preserve query argument to guarantee any custom metadata existing on the object is carried over to the copy. To overwrite an existing value, include the header name with the new value on the request. (v9.2)

See SCSP Headers.

Requirements for Custom Names

Characters: For best compatibility going forward, Swarm restricts to these characters in custom metadata header names (v9.1):

  • letters (both cases, although case-insensitive is consistent with HTTP/1.1 RFC)

  • numbers

  • dash (hyphen)

  • underscore

Info

Elasticsearch and

dots

Dots

Some versions of Elasticsearch (such as 2.3.3) do not allow dots in normal field names. When indexing objects, Swarm converts any dots in custom metadata field names (x_foo_meta_2016.12) to underscores (x_foo_meta_2016_12). (v9.1)

Formats: Follow one of these two naming formats when custom headers are defined, or they are silently ignored and not persisted to the storage cluster: 

  • x-*-meta

  • x-*-meta-*

Code Block
x-ExampleCorp-meta-color: blue

Requirements for Custom Values

To specify more than one value for the same header, list the values on the same line, separated by commas.

...

Verify the total length of all persisted metadata, keys and values, does not exceed 32 KB. Metadata over 32 KB results in a 400 Bad Request error response from Swarm.

Sample Scenario for Custom Metadata

Assume a domain of "example.com" with a bucket called "surveillance", created for storing the company's surveillance videos. 

...