Origin Strategies¶
Examples¶
An “out of the box” origin strategy provided by the DLCS:
https://dlcs.azurewebsites.net/originStrategies/basic_https
A customer’s configured CustomerOriginStrategy resources (these are created by a customer using the API or portal - the association of a customer’s URI pattern with an out of the box origin strategy):
OriginStrategy¶
As a customer you can provide information to the DLCS to allow it to fetch your images from their origin endpoints. Every customer is given a default origin strategy, which is for the DLCS to attempt to fetch the image from its origin URL without presenting credentials. This is fine for images that are publicly available, but is unlikely to be appropriate for images you are exposing from your asset management system. You might have a service that is available only to the DLCS, or an FTP site.
/originStrategies/{originStrategy}
Supported operations¶
Method | Label | Expects | Returns | Statuses |
---|---|---|---|---|
GET | Retrieve a Origin Strategy | vocab:OriginStrategy | 200 OK, 404 Not found |
Supported properties¶
name¶
The human readable name of the origin strategy
domain | range | readonly | writeonly |
---|---|---|---|
vocab:OriginStrategy | xsd:string | False | False |
requiresCredentials¶
Whether the DLCS needs stored credentials to fetch images with this strategy
domain | range | readonly | writeonly |
---|---|---|---|
vocab:OriginStrategy | xsd:boolean | False | False |
CustomerOriginStrategy¶
As a customer you can provide information to the DLCS to allow it to fetch your images from their origin endpoints. Every customer has a default origin strategy, which is for the DLCS to attempt to fetch the image from its origin URL without presenting credentials. This is fine for images that are publicly available, but is unlikely to be appropriate for images you are exposing from your asset management system. You might have a service that is available only to the DLCS, or an FTP site. The DLCS has a predefined set of mechanisms for obtaining resources over HTTP, FTP, S3 etc. In your customer origin strategies you match these predefined strategies to regexes that match your origin URLs and credentials that the DLCS can use when requesting your assets.
/customers/{customer}/originStrategies/
Supported operations¶
Method | Label | Expects | Returns | Statuses |
---|---|---|---|---|
GET | Retrieve all Origin Strategies | vocab:CustomerOriginStrategy | 200 OK | |
POST | create an Origin Strategy | vocab:CustomerOriginStrategy | vocab:CustomerOriginStrategy | 201 Created Origin Strategy |
/customers/{customer}/originStrategies/{originStrategy}
Supported operations¶
Method | Label | Expects | Returns | Statuses |
---|---|---|---|---|
GET | Retrieve an Origin Strategy | vocab:CustomerOriginStrategy | 200 OK, 404 Not found | |
PUT | Replace an Origin Strategy | vocab:CustomerOriginStrategy | vocab:CustomerOriginStrategy | 200 OK, 404 Not found |
DELETE | Delete the Origin Strategy | owl:Nothing | 200 OK, 404 Not found |
Supported properties¶
regex¶
Regex for matching origin. When the DLCS tries to work out how to fetch from your origin, it uses this regex to match to find the correct strategy.
domain | range | readonly | writeonly |
---|---|---|---|
vocab:CustomerOriginStrategy | xsd:string | False | False |
strategy (🔗)¶
Link to the origin strategy definition that will be used if the regex is matched.
domain | range | readonly | writeonly |
---|---|---|---|
vocab:CustomerOriginStrategy | vocab:OriginStrategy | True | False |
/originStrategies/{originStrategy}
credentials (🔗)¶
JSON object - credentials appropriate to the protocol, will vary. These are either stored in S3 or as a JSON blob and are not available via the API.
domain | range | readonly | writeonly |
---|---|---|---|
vocab:CustomerOriginStrategy | xsd:string | False | False |
/customers/{customer}/originStrategies/{originStrategy}/credentials
Method | Label | Expects | Returns | Statuses |
---|---|---|---|---|
PUT | create or replace customer credential object | vocab:Credentials | vocab:Credentials | 201 Created |