Custom Evaluator
Summary
Custom Evaluator is a client-defined pattern-matcher which returns true or false, depending on whether the pattern defined in the evaluator matches a specific attribute of the request context, such as URI or request-header. Custom Evaluators are referenced only within the action field of an Eval Script Step
Definition
| Name | Schema | Default | Comments |
|---|---|---|---|
| id | integer | unique auto-generated record-ID | |
| name | string | short-code used to uniquely identify evaluator | |
| source | string or NULL | NULL | Name of evaluator type to match on, i.e. URI, UTCTime, DevCap(video), etc |
| match | string | string or JSON-array of string | Value or set of values to match to URI or header. Can include wildcard (*). Matcher yields true if the input matches any of the supplied match-strings |
| operation | string (IN or EQUALS) | ||
| negation | string (YES or NO) or NULL | NULL | If YES, negate the result of this rule |
| description | string | human-readable description |
Sources
| Name | Subfield | Description |
|---|---|---|
| URI | no | The URI of the feature-manifest |
| Header | yes | A header value from the request. Takes a parameterized subfield, i.e. Header(X-Geo-Asn) |
| UTCTime | no | this matches the time in the form of YYYY-MM-DD HH:mm, and optionally ISO8601. Either will be parsed but seconds and millis will not be guaranteed |
| MediaTitle | no | Matching the Asset Title being played |
| MediaLength | no | synonymous with Tag(vdur), the length of the media |
| Tag | yes | A freewheel or DAI tag, i.e. sub, gr, ge, etc. Takes a parameterized subfield, i.e. Tag(gr) |
| DevCap | yes | Device Capabilities. Takes a parameterized subfield, i.e. DevCap(video) |
REST Operations
GET custom-evaluator/<resourceId>
Return custom-evaluator resource identified by resourceId
GET custom-evaluator?<query-parameters>
Return custom-evaluator resources identified by query paramters:
Query Parameters:
| parameter | type | default | comments |
|---|---|---|---|
| page | integer | 0 | zero indexed page of results to return (optional) |
| page_size | integer | items-per-page to return (required) | |
| name | string | name to match (optional) |
PUT custom-evaluator/<resourceId>
Update custom-evaluator resource idientied by resourceId
JSON body parameters:
| Name | Schema | Default | Comments |
|---|---|---|---|
| name | string | short-code used to uniquely identify evaluator | |
| header_name | string or NULL | NULL | Name of request-header to match on. Can include wildcard (*). If not provided, the URI is used as the input. |
| match | string | string or JSON-array of string | Value or set of values to match to URI or header. Can include wildcard (*) |
| operation | string (IN or EQUALS) | ||
| negation | string (YES or NO) or NULL | NULL | If YES, negate the result of this rule |
| description | string | human-readable description |
POST custom-evaluator
Create new custom-evaluator resource
JSON body parameters:
| Name | Schema | Default | Comments |
|---|---|---|---|
| name | string | short-code used to uniquely identify evaluator | |
| header_name | string or NULL | NULL | Name of request-header to match on. Can include wildcard (*). If not provided, the URI is used as the input. |
| match | string | string or JSON-array of string | Value or set of values to match to URI or header. Can include wildcard (*) |
| operation | string (IN or EQUALS) | ||
| negation | string (YES or NO) or NULL | NULL | If YES, negate the result of this rule |
| description | string | human-readable description |
DELETE
Delete custom-evaluator resource idientied by resourceId