Storage rules¶
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.
Retrieving storage rules across different resources¶
- GET /storage-rule/¶
Retrieves all storage-rules that matches the given parameters.
Query Parameters: - type – A comma-separated list of types to retrieve, if not specified all types will be retrieved. Valid values are ITEM, COLLECTION, LIBRARY and GENERIC.
- tag – A 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>
<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>
Retrieving 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 –
- 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
- all –
Retrieving all storages rules¶
- GET {rule-entity}/(entity-id)/storage-rule/¶
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>
Setting a default rule¶
- PUT {rule-entity}/(entity-id)/storage-rule¶
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>
Retrieving a a specific rule¶
- GET {rule-entity}/(entity-id)/storage-rule/(shape-tag)¶
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>
Setting a specific rule¶
- PUT {rule-entity}/(entity-id)/storage-rule/(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 specific rule¶
- DELETE {rule-entity}/(entity-id)/storage-rule/(shape-tag)¶
Deletes a specific rule.
Status Codes: - 200 OK – Rule set 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