Resource Tags

Resource tags allows you to add key-value metadata to both storage resources and VSAs to group related resources together. For example we might have storages and VSAs situated in different locations, and we want to tag these resources to denote which ones are located in one region and which ones are in onther region.

The resource tags are denoted as resourceTag in the resource documents and is a data type that can consist of one to many K/V-pairs where the key is in the form [A-Za-z][A-Za-z-]*[A-Za-z] and value is a comma-separated list.

For storages there is an inheritence from storage groups to storages, and then from storages to storage methods. So by adding a storage to a storage group with resource tags the tags are inherited down to both the storage and any storage method.

A storage can override resourceTag values inherited from storage group(s) by adding matching key directly on storage. A storage method can override resourceTag values inherited from storage by adding matching key on storage method.

Adding resource tags to VSA

Resource tags for VSAs are configured by adding the resourceTags to the agent.conf for the VSA and a read upon VSA startup.

Example:

resourceTag.location = Stockholm

This will then be reflected in the VSAs resource document

Example:

<VXAListDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  ..
  <vxa>
    <uuid>e5844fdb-9bfb-4f25-a689-72349a34507a</uuid>
    ..
    <resourceTag>
      <key>location</key>
      <value>Stockholm</value>
    </resourceTag>
  </vxa>
  ..
 </VXAListDocument>

Adding resource tags to storage

Resource tags for storage groups, storages or storage methods are added by providing the resourceTag in either the storageGroup-, storage- or storageMethodDocument.

Example for a storage:

POST /storage
Content-Type: application/xml

<StorageDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <type>LOCAL</type>
  <capacity>150000000000</capacity>
  <method>
    <uri>file:///mnt/ingest/</uri>
    <read>true</read>
    <write>true</write>
    <browse>true</browse>
  </method>
  <lowWatermarkPercentage>90</lowWatermarkPercentage>
  <highWatermarkPercentage>75</highWatermarkPercentage>
  <showImportables>true</showImportables>
  <resourceTag>
    <key>location</key>
    <value>Stockholm</value>
  </resourceTag>
</StorageDocument>

Once the storage has been added we can see that both the storage and the storage method have the resourceTag set and where it has been inherited from.

<StorageDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <id>VX-1</id>
  <state>NONE</state>
  <priority>MEDIUM</priority>
  <type>LOCAL</type>
  ..
  <method>
    <id>VX-1</id>
    <uri>file:///mnt/ingest/</uri>
    <read>true</read>
    <write>true</write>
    <browse>true</browse>
    ..
    <resourceTag sourceName="VX-1" sourceType="storage">
      <key>location</key>
      <value>Stockholm</value>
    </resourceTag>
  </method>
  <metadata/>
  ..
  <showImportables>true</showImportables>
  <resourceTag>
    <key>location</key>
    <value>Stockholm</value>
  </resourceTag>
</StorageDocument>

Removing resource tags

Resource tags are removed by posting an empty value together with the resource key which we want to update.

Example:

POST /storage
Content-Type: application/xml

<StorageDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <type>LOCAL</type>
  <capacity>150000000000</capacity>
  <method>
    <uri>file:///mnt/ingest/</uri>
    <read>true</read>
    <write>true</write>
    <browse>true</browse>
  </method>
  <lowWatermarkPercentage>90</lowWatermarkPercentage>
  <highWatermarkPercentage>75</highWatermarkPercentage>
  <showImportables>true</showImportables>
  <resourceTag>
    <key>location</key>
    <value></value>
  </resourceTag>
</StorageDocument>