Custom metadata usage considerations

These following considerations apply to using custom metadata with the HSwift API.

Property names

When naming properties, you should use names that, when concatenated with meta-, result in valid XML element names. That way, the X-Object-Meta- headers returned when you retrieve or check the existence of an object match the X-Object-Meta- headers you specified when you stored or copied the object.

If HCP has to modify a property name to create a valid element name, the returned X-Object-Meta- header won’t match the X-Object-Meta- header specified when the object was stored or copied. For example, if the specified header is X-Object-Meta-city/town, the returned header is X-Object-Meta-city_town.

Custom metadata size

When you use HSwift to store or copy an object, you can specify at most two kilobytes of custom metadata. The size of the custom metadata you specify is the sum of the number of bytes in the UTF-8 encoding of each property name and value.

Allowed operations

Whether you can add, replace, or delete custom metadata for an object under retention depends on a container setting. When you create a container, it's set to allow only the addition of custom metadata for objects under retention. You cannot use the HSwift API to change this setting. However, tenant administrators can change this setting for the containers you create.

.metapairs annotations with unexpected content

You could use HCP interfaces other than HSwift to store annotations named .metapairs, although it is not recommended. As a result, annotations named .metapairs are not guaranteed to be compatible with HSwift.

Here are some ways in which HCP responds to HSwift requests for object that have .metapairs annotations with unexpected content:

If the .metapairs annotation doesn't contain valid XML or if the first line in the annotation doesn't begin with the metapairs element, HCP returns an X-Object-Missing-Meta- header with a value of 1 (one) and does not return any X-Object-Meta- headers.

If an element name doesn't start with meta-, HCP doesn't return an X-Object-Meta- header for the element.

If a meta- element has no value, HCP doesn't return an X-Object-Meta- header for the element.

If a meta- element has an attribute, HCP ignores the attribute and returns the applicable X-Object-Meta- header.

If the XML contains nested elements and the lowest-level element is a meta- element, HCP returns an X-Object-Meta- header for the element. It does not return X-Object-Meta- headers for any other elements in that nested structure.

© 2015, 2020 Hitachi Vantara LLC. All rights reserved.