Storage rule reference [VC 21.3.1 GEN]
Creating/modifying/reading storage rules
Storage rules can be applies on entities within the item, collection, library and shape tag resources. Note that for the shape tag resource no default rule can be set.
In the following reference, {rule-resource}
is one of the following:
-
/item/{item-id}/storage-rule
-
/collection/{collection-id}/storage-rule
-
/library/{library-id}/storage-rule
-
/shape-tag/storage-rule
List all storage rules
-
GET
/storage-rule/
Retrieves all storage-rules that matches the given parameters.
Query Parameters: -
type (string) – Comma-separated list of types to retrieve, if not specified all types will be retrieved. Valid values are
ITEM
,COLLECTION
,LIBRARY
andGENERIC
. -
tag (string) – Comma-separated list of tags to retrieve, if not specified rules of all tag types will be retrieved.
Produces: -
application/xml, application/json – StorageRulesDocument
Role: _storage_rule_read
-
Example
GET /storage-rule?type=LIBRARY,COLLECTION&tag=original,lowres
<StorageRulesDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<tag id="lowres">
<storageCount>1</storageCount>
<storage>VX-1</storage>
<appliesTo>
<id>VX-20</id>
<type>COLLECTION</type>
</appliesTo>
<precedence>HIGH</precedence>
</tag>
<tag id="original">
<storageCount>2</storageCount>
<appliesTo>
<id>*68</id>
<type>LIBRARY</type>
</appliesTo>
<precedence>MEDIUM</precedence>
</tag>
</StorageRulesDocument>
List all storage rules that applies to a certain shape
-
GET
/item/
(item-id)/shape/
(shape-id)/storage-rule
Retrieves the storage rules that applies to a certain shape in a sorted manner. The rules are sorted according to priority, with the most important rule being first and the least important rule being last.
Query Parameters: -
all (boolean) –
-
true
- Return all rules, regardless whether another rule overwrites it or not. -
false
(default) - Return only rules that are in effect.
-
Produces: -
application/xml, application/json – StorageRulesDocument
Role: _storage_rule_read
-
List all storage rules for an entity
-
GET
{rule-resource}
Retrieves all storage rules that are applied on a certain entity in a certain resource.
Produces: -
application/xml, application/json – StorageRulesDocument
Role: _storage_rule_read
-
Example
GET /storage-rule/
<StorageRulesDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<default>
<storageCount>2</storageCount>
<priority level="1">capacity</priority>
<priority level="2">bandwidth</priority>
<storage>VX-122</storage>
</default>
<tag id="lowres">
<storageCount>3</storageCount>
<storage>VX-123</storage>
</tag>
<tag id="web">
<priority level="1">bandwidth</priority>
<priority level="2">capacity</priority>
<storage>VX-124</storage>
</tag>
</StorageRulesDocument>
Set a default rule
-
PUT
{rule-resource}
Sets the default rule.
Status Codes: -
200 OK – Rule set successfully.
-
400 Bad request – The request was malformed.
-
404 Not found – Could not find a specified storage.
Accepts: -
application/xml, application/json – StorageRuleDocument
Role: _storage_rule_write
-
Example
PUT /collection/VX-45/storage-rule
Content-Type: application/xml
<StorageRuleDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<storageCount>2</storageCount>
<priority level="1">capacity</priority>
<priority level="2">bandwidth</priority>
<storage>VX-122</storage>
</StorageRuleDocument>
Delete a default rule
-
DELETE
{rule-resource}
Deletes the default rule.
Status Codes: -
200 OK – Rule deleted successfully.
-
404 Not found – Could not find a default rule.
Role: _storage_rule_write
-
Example
DELETE /collection/VX-45/storage-rule
200 OK
Retrieve a a storage rule
-
GET
{rule-resource}/
(tag-name) Returns the rule that is applied to a certain shape tag.
Status Codes: -
404 Not found – No shape tag with that that name could be found.
Produces: -
application/xml, application/json – StorageRuleDocument
Role: _storage_rule_read
-
Example
GET /collection/VX-45/storage-rule/lowres
<StorageRuleDocument id="lowres" xmlns="http://xml.vidispine.com/schema/vidispine">
<storageCount>3</storageCount>
<priority level="1">capacity</priority>
<priority level="2">bandwidth</priority>
<storage>VX-123</storage>
</StorageRuleDocument>
Set a storage rule
-
PUT
{rule-resource}/
(tag-name) Updates a storage rule applied to a certain shape tag.
Status Codes: -
200 OK – Rule set successfully.
-
400 Bad request – The request was malformed.
-
404 Not found – Could not find a specified storage or a shape tag with that name.
Accepts: -
application/xml, application/json – StorageRuleDocument
Role: _storage_rule_write
-
Example
PUT /collection/VX-45/storage-rule/lowres
Content-Type: application/xml
<StorageRuleDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<storageCount>3</storageCount>
<storage>VX-123</storage>
</StorageRuleDocument>
Delete a storage rule
-
DELETE
{rule-resource}/
(tag-name) Deletes a specific rule.
Status Codes: -
200 OK – Rule deleted successfully.
-
404 Not found – Could not find a shape tag with that name or a specific rule applied to that tag.
Role: _storage_rule_write
-