Get Policy

Returns a policy including all of its rules.

Request

Retrieve a policy via the following request:

HTTP Method Request URI

GET

https://api.vdms.io/rules-engine/v1.1/policies/PolicyID

Define the following variable when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). Description

PolicyID

Required

Replace this variable with the system-defined ID corresponding to the desired policy.

Use the Get All Policies endpoint to retrieve a list of policies and their system-defined IDs.

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

Unlike requests to api.edgecast.com, requests to our API gateway (api.vdms.io) require an access token (OAuth).

Request Body

Request body parameters are not required by this endpoint.

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request contains the following response elements:

Name Data Type Description

@id

String

Indicates the relative path to an endpoint through which you may retrieve the current policy.

@type

String

Returns Policy.

id

String

Identifies the policy by its system-defined ID.

name

String

Identifies the policy by its name.

description

String

Indicates the policy's description.

policy_type

String

Returns customer.

state

String

Indicates the policy's state. Valid values are:

  • draft: Policies in this state may be modified.
  • locked: Most of a locked policy's properties are read-only.

platform

String

Indicates the delivery platform corresponding to the policy. Valid values are:

  • http_large
  • http_small
  • adn

created_at

String

Indicates the date and time (UTC) at which the policy was created.

Syntax:

YYYY-MM-DDThh:mm:ssZ

Example:

2024-01-08T20:31:06Z

updated_at

String

Indicates the date and time (UTC) at which the policy was last updated.

Syntax:

YYYY-MM-DDThh:mm:ssZ

rules

Array

Contains the rules associated with this policy. Each object in this array contains a rule.

@id

String

rules array

Indicates the relative path to an endpoint through which you may retrieve the current rule.

This endpoint has not been released yet.

@type

String

rules array

Returns Rule.

id

String

rules array

Identifies the rule by its system-defined ID.

name

String

rules array

This parameter is reserved for future use.

description

String

rules array

Indicates the rule's description.

ordinal

Integer

rules array

Indicates the position of the rule within the policy.

created_at

String

rules array

Indicates the date and time (UTC) at which the rule was created.

Syntax:

YYYY-MM-DDThh:mm:ssZ

Example:

2024-01-08T20:31:06Z

updated_at

String

rules array

Indicates the date and time (UTC) at which the rule was last updated.

Syntax:

YYYY-MM-DDThh:mm:ssZ

matches

Array

rules array

Contains the match conditions associated with the rule. Each object in this array contains a match condition configuration.

Match conditions are listed in the order in which they appear in the rule.

history

Array

Describes each state change for this policy.

matches Array

The matches array describes one or more match condition(s) using the following parameters:

The set of supported parameters varies by match condition.

Name Data Type Description

compare

String

Device - Resolution Height and Resolution Width Only

Determines how the value defined in the value parameter will be compared against the request. Set this parameter to the desired mathematical operator. Valid values are:

== | < | <= | > | >=

features

Array

Contains the features associated with this match condition. Each object in this array contains a feature configuration.

hostnames

String

match.request.edge-cname.literal Match Condition Only

Identifies a hostname corresponding to an edge CNAME configuration.

ignore_case

Boolean

Determines whether the comparison between the value parameter and the request will be case-sensitive. Valid values are:

  • True: A match will be found regardless of case.
  • False: A case-sensitive comparison will be performed.

Certain match conditions use a parameter other than value to determine whether a request is a match. The ignore_case parameter applies to whichever parameter will be compared against the request. For example, match.request.edge-cname.literal uses hostnames.

matches

Array

Contains the match conditions associated with this match condition. Each object in this array contains a match condition configuration.

Match conditions are listed in the order in which they appear in the rule.

name

String

Identifies the entity that will be matched.

Example:

The match.request.cookie.literal match condition uses this parameter to identify the cookie whose value will be compared against the value parameter.

ordinal

Integer

Indicates the position of the match condition within the rule.

relative_to

String

URL Match Conditions Only

Determines where the URL comparison will start. Valid values are:

root | origin

Learn more.

result

String

Determines whether the comparison must result in a match in order to satisfy this match condition. Valid values are:

match | nomatch

type

String

Identifies a match condition by its code name.

Learn more.

value

String | Array of string values

Determines the value that will be compared against the request.

Acceptable values for this parameter vary by match condition.
Learn more.

Multiple values (e.g., space-separated values) are returned as an array of string values.

features Array

The features array describes one or more feature(s) associated with the parent match condition using the following parameters:

View the set of supported parameters for each feature in the features array template provided below this table.

Name Data Type Description

action

String

Indicates the action (e.g., set) that will take place.

code

String

Indicates a HTTP status code.

codes

String | Array of string values

Indicates one or more HTTP status codes.

Multiple values (e.g., space-separated values) are returned as an array of string values.

destination

String

Identifies a relative path via a regular expression.

enabled

Boolean

Determines whether the feature will be enabled. Valid values are:

true | false

extensions

String | Array of string values

Identifies one or more file extensions.

Multiple values (e.g., space-separated values) are returned as an array of string values.

format

String

feature.logs.custom-log-field-1 Feature Only

Indicates the format and the content that will be assigned to a custom log field.

header_name

String

feature.access.token-auth-denial-code Feature Only

Set this to Location.

header_value

String

feature.access.token-auth-denial-code Feature Only

Identifies the URL to which unauthorized requests will be redirected.

Learn more.

instance

String

feature.waf.web-application-firewall Feature Only

Identifies a WAF instance by its system-defined ID.

kbytes_per_second

Integer

feature.caching.bandwidth-throttling Feature Only

Indicates the bandwidth, in Kbps, to which requests will be throttled.

media_types

String

feature.caching.compress-file-types Feature Only

Specify one or more media types (aka content types).

methods

String | Array of string values

feature.specialty.cacheable-http-methods Feature Only

Specify one or more supported HTTP methods.

Multiple values (e.g., space-separated values) are returned as an array of string values.

mode

String

feature.caching.cache-key-query-string Feature Only

Determine whether query string parameters will be included in the cache-key. Valid values are:

include | exclude | include-all | exclude-all

Learn more.

name

String

Identifies the object (e.g., request header) on which the feature will be applied by its name.

names

String

feature.origin.proxy-special-headers Feature Only

Identifies one or more CDN-specific request header that will be forwarded to an origin server.

Multiple values (e.g., space-separated values) are returned as an array of string values.

ordinal

Integer

Indicates the position of the feature.

parameters

String

feature.caching.cache-key-query-string Feature Only

Identifies one or more query string parameters by their names.

prebuf_seconds

Integer

feature.caching.bandwidth-throttling Feature Only

Determines the number of seconds that our edge servers will wait until throttling bandwidth.

requests

Integer

feature.origin.max-keep-alive-requests Feature Only

Determines the maximum number of requests for a Keep-Alive connection before it is closed.

seek_end

String

feature.caching.h264-support-video-seek-params Feature Only

Overrides the name assigned to ec_end.

seek_start

String

feature.caching.h264-support-video-seek-params Feature Only

Overrides the name assigned to ec_seek.

source

String

Identifies a relative path via a regular expression.

status

String

Identifies requests via a HTTP status code.

treatment

String

Determines how an edge server will handle a header.

type

String

Identifies a feature by its code name.

View the set of supported parameters for each feature in the features array template provided below this table.

units

String

Determines the time unit that will be used for the value parameter.

value

String | Integer | Array

Determines the value that will be set.

Multiple values (e.g., space-separated values) are returned as an array.

history Object

The history object describes the policy's state changes using the following parameters:

Name Data Type Description
id String Identifies this entry by its system-defined ID.
type String

Indicates the policy's new state. Valid values are:

created | deleted | locked | updated
created_at String

Indicates the date and time (UTC) at which the policy entered the state identified by the state property.

Syntax:

YYYY-MM-DDThh:mm:ssZ

Example:

2024-01-08T20:31:06Z

user

Object

Describes the user that requested the change in state.

user Object

The user object describes a user using the following parameters:

Name Data Type Description
id String Identifies a user by its system-defined ID.
first_name String Indicates a user's first name.
last_name String Indicates a user's last name.

email

String

Indicates a user's email address.

Errors

The response body for an unsuccessful request will contain an error response that provides additional information.

Sample Request and Response

A sample JSON request is shown below.

A sample JSON response is shown below.

HTTP/1.1 200 OK

Cache-Control: no-cache

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 1890

{
	"@id": "/rules-engine/v1.1/policies/123",
	"@type": "Policy",
	"id": "123",
	"name": "My First Policy",
	"description": null,
	"policy_type": "customer",
	"state": "locked",
	"platform": "http_large",
	"created_at": "2016-03-22T17:15:47Z",
	"updated_at": "2016-06-29T23:00:19Z",
	"rules": [{
			"@id": "/rules-engine/v1.1/policies/123/rules/123123",
			"@type": "Rule",
			"id": "123123",
			"name": "",
			"description": "",
			"ordinal": 1,
			"created_at": "2017-06-08T21:16:39Z",
			"updated_at": "2017-06-08T21:16:39Z",
			"matches": [{
					"type": "match.always",
					"ordinal": 1,
					"features": [{
							"type": "feature.caching.external-max-age",
							"ordinal": 1,
							"value": "3",
							"units": "minutes"
						}, {
							"type": "feature.caching.force-internal-max-age",
							"ordinal": 2,
							"status": "200",
							"value": "1",
							"units": "hours"
						}, {
							"type": "feature.caching.default-internal-max-age",
							"ordinal": 3,
							"status": "200",
							"value": "1",
							"units": "hours"
						}, {
							"type": "feature.headers.modify-client-response-header",
							"ordinal": 4,
							"action": "set",
							"name": "Strict-Transport-Security",
							"value": "max-age=63072000"
						}, {
							"type": "feature.headers.modify-client-response-header",
							"ordinal": 5,
							"action": "set",
							"name": "X-Content-Type-Options",
							"value": "nosniff"
						}, {
							"type": "feature.headers.modify-client-response-header",
							"ordinal": 6,
							"action": "set",
							"name": "X-Frame-Options",
							"value": "SAMEORIGIN"
						}, {
							"type": "feature.waf.web-application-firewall",
							"ordinal": 7,
							"instance": "123456-e060dd56-290e-4a6e-a275-ffbe63c5412b"
						}
					]
				}
			]
		}
	],
	"history": [{
			"id": 4794,
			"type": "updated",
			"created_at": "2016-06-29T23:00:19Z",
			"user": {
				"id": "0",
				"first_name": null,
				"last_name": null,
				"email": null
			}
		}, {
			"id": 4795,
			"type": "locked",
			"created_at": "2016-06-29T23:00:19Z",
			"user": {
				"id": "0",
				"first_name": null,
				"last_name": null,
				"email": null
			}
		}, {
			"id": 4793,
			"type": "created",
			"created_at": "2016-03-22T17:15:47Z",
			"user": {
				"id": "0",
				"first_name": null,
				"last_name": null,
				"email": null
			}
		}
	]
}