Key-value metadata [VC 21.3.1 GEN]
Some resources support basic key-value metadata (not to be confused with item metadata). This metadata is not indexed nor is it revision controlled. The role required to use the metadata depends on the resource.
Keys can be hierarchical, meaning the key can include the slash character.
Changed in version 4.16: Support for key-value metadata was added to shape-tags, libraries and task-definitions.
Supported resources
The resources that support key-value metadata, and the roles required to read and write to them can be seen in the table below. These are referred to as {key-value-metadata-resources}
.
Resource | URI | Read role | Write role |
---|---|---|---|
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
|
Managing key-value metadata
Retrieve all metadata
-
GET
{key-value-metadata-resource}
Retrieves all key-value pairs associated with the specified entity.
Produces: -
application/xml, application/json – A SimpleMetadataDocument containing all key-value pairs.
-
Example
GET /user/myuser/metadata
<SimpleMetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<field>
<key>occupation</key>
<value>developer</value>
</field>
<field>
<key>location</key>
<value>London</value>
</field>
</SimpleMetadataDocument>
Retrieve all metadata for a subtree
-
GET
{key-value-metadata-resource}/
(keypath) Retrieves all key-value pairs associated with the specified key path. The key path can contain
\*
for a wildcard segment, or\*\*
for any number of arbitrary segments.Produces: -
application/xml, application/json – A SimpleMetadataDocument containing all key-value pairs matching.
-
Example
GET /user/myuser/metadata/**/id
Create multiple key-value pairs
-
PUT
{key-value-metadata-resource}
Sets all the specified key-value pairs.
Accepts: -
application/xml, application/json – SimpleMetadataDocument
-
-
PUT
{key-value-metadata-resource}/
(prefix) Sets all the specified key-value pairs, prefixed by key path. Key path may not contain wildcards.
Accepts: -
application/xml, application/json – SimpleMetadataDocument
-
Example
PUT /user/myuser/metadata
Content-Type: application/xml
<SimpleMetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<field>
<key>occupation</key>
<value>developer</value>
</field>
<field>
<key>location</key>
<value>London</value>
</field>
</SimpleMetadataDocument>
200 OK
Delete all key-value pairs
-
DELETE
{key-value-metadata-resource}
Clears all key-value pairs for the specified entity.
Example
DELETE /user/myuser/metadata
200 OK
Retrieve the metadata for a specific key
-
GET
{key-value-metadata-resource}/
(keypath) Retrieves the value of a specific key. If a key path is specified, exactly one key-value pair must match the key path, else an error is returned.
Key paths can also be specified as well as specific keys.
Produces: -
text/plain – The raw string value.
-
Example
GET /user/myuser/metadata/location
London
Set the value for a specific key
-
PUT
{key-value-metadata-resource}/
(keypath) Sets the value for a specific key. The key path may not contain wildcards.
Accepts: -
text/plain – The raw string value.
-
Example
PUT /user/myuser/metadata/location
Content-Type: text/plain
Stockholm
200 OK
Delete key-value pairs
-
DELETE
{key-value-metadata-resource}/
(keypath) Deletes the key-value pair with the specified key. If a key path is given, it may include wildcards for deleting multiple keys.
Key paths can also be specified as well as specific keys.
Example
DELETE /user/myuser/metadata/location
200 OK