CDN


The VIS supports integration with various CDN providers, which are stored as a ‘CDN object’ in the system.


CDN Object

{
    "Id": "2106d0d5-e0c1-4287-a51c-db14f46092a3",
    "ConfigurationJson": "{...}",
    "Name": "live.origin.vualto.com"
}

Configuration Json

Schemas:

A version 2 schema now exists and should be structured as follows:

{
  "type": "CLOUD_FRONT",
  "version": 2,
  "defaultInvalidation": "",
  "cdnSpecific": {}
}

cdnSpecific varies per CDN Type, and contains the identifying information for the CDN Provider.

defaultInvalidation is an optional default value, previously specified as path within the details object, this provides backwards compatibility but it is advised that you always provide an AltPath value when clearing cache instead (see below).

Type: LEASE_WEB

CDN Specific:

{
  "host": "lw-api-host",
  "customerNumber": "lw-customer-number",
  "zoneId": "lw-zone-id-here",
  "secretKey": "lw-secret-key"
}

Type: CLOUD_FRONT

CDN Specific:

{
  "distributionId": "aws-distribution-id",
  "accessKey": "aws-access-key",
  "secretKey": "aws-secret-key",
  "region": "aws-region-name"
}

Type: LEVEL_3

CDN Specific:

{
  "host": "level3-api-host",
  "notificationEmailAddresses": "email@vualto.com",
  "level3Key": "level3-key",
  "level3Secret": "level3-secret",
  "level3AccessGroup": "level3-access-group"
}

Type: EBU

CDN Specific:

{
  "username": "ebu-api-username",
  "password": "ebu-api-password",
  "customerId": "ebu-customerId",
  "distributionId": "ebu-distributionId",
  "distributionType": "ebu-distributionType",
  "policyId": "ebu-policyId"
}

policyId is optional, but providing it skips a lookup request to find this value.

Type: Fastly

CDN Specific

{
  "fastlyAuthKey": "fastly-api-key",
  "serviceId": "fastly-serviceId",
  "defaultDomain": "fastly-service-default-domain"
}

defaultDomain needs to have either the http or https protocol.

Restriction Information

Restriction information is displayed and submitted using the following structures:

RestrictionMethod:

  • IpAddress = 0
  • Iso3166 = 1

Iso3166 is the only fully supported value at this time.

RestrictionType:

  • None = 0
  • Allowed = 1
  • Denied = 2

RestrictionInfo Object:

{
  "method": 0,
  "type": 0,
  "items": [ "entry1", "entry2" ]
}

method is the RestrictionMethod

type is the RestrictionType


Supported Actions

POST /cdn/

Add or Update a CDN.

Request Body:

{
    "Id": "2106d0d5-e0c1-4287-a51c-db14f46092a3",
    "ConfigurationJson": "{...}",
    "Name": "live.origin.epvualto.com"
}

Note: id is required when updating a specific CDN, but is optional when adding.

Response: 200 OK


POST /cdn/clearcdncache/{id}

Clears the cache from the CDN by Id.

Request Body:

  AltPath {string} - Optional. Alternative path to one in Configuration Json for the CDN.

Response:

200 OK if the CDN was cleared or 400 Bad Request if the CDN was not found by Id.


PUT /cdn/{id}

Update a CDN by Id.

Request Body:

{
    "ConfigurationJson": "{...}",
    "Name": "live.origin.epvualto.com"
}

Response: 200 OK


PUT /cdn/restrict/geo/{id}

Update geographical restrictions (ISO3166) by Id.

The CdnProvider configuration must be a version 2 setup, and the integration must support this operation.

Request Body:

{
  "type": 0,
  "items": [ "gb" ]
}

type is the RestrictionType.

Response: 200 OK or 400 Bad Request if the CDN was not found by Id.


PUT /cdn/statistics/{id:guid}

Retrieves Statistics from the CDN based on the request body.

The CdnProvider configuration must be a version 2 setup, and the integration must support this operation.

Request Body

{
  "fromDate" : "2021-08-01T00:00:00+01:00",
  "toDate" : "2021-08-03T23:59:59+01:00",
  "statsField" : "bandwidth"
}

Response:

200 OK and JSON containing the stats value along with a friendly readable format.

or

400 Bad Request if the CDN was not found by Id.


GET /cdn/getcdnproviders/

Get all CDNs.

Response:

200 OK and a JSON array containing multiple CDN objects.


GET /cdn/{id}

Get a CDN by Id.

Response:

200 OK and JSON containing the CDN object.

or

204 No Content if no CDN was found.


GET /cdn/geo/{id}

Get RestrictionInfo for geographical locations (ISO3166) by Id.

The CdnProvider configuration must be a version 2 setup, and the integration must support this operation.

Response:

200 OK and JSON containing the RestrictionInfo object.

or

400 Bad Request if the CDN was not found by Id.


DEL /cdn/{id}

Delete a CDN by Id.

Response: 200 OK or 204 No Content if no CDN was found by that Id.