servers/{{ID}}/deliveryservices

GET

Retrieves all Delivery Services assigned to a specific server.

Auth. Required

Yes

Roles Required

None1

Permissions Required

DELIVERY-SERVICE:READ, SERVER:READ

Response Type

Array

Request Structure

Table 404 Request Path Parameters

Name

Description

ID

The integral, unique identifier of the server for which assigned Delivery Services shall be listed

Table 405 Request Query Parameters

Name

Required

Description

orderby

no

Choose the ordering of the results - must be the name of one of the fields of the objects in the response array

sortOrder

no

Changes the order of sorting. Either ascending (default or “asc”) or descending (“desc”)

limit

no

Choose the maximum number of results to return

offset

no

The number of results to skip before beginning to return results. Must use in conjunction with limit

page

no

Return the nth page of results, where “n” is the value of this parameter, pages are limit long and the first page is 1. If offset was defined, this query parameter has no effect. limit must be defined to make use of page.

#983 Request Example
GET /api/4.0/servers/10/deliveryservices HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: python-requests/2.24.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...

Response Structure

active

A boolean that defines Active.

anonymousBlockingEnabled

A boolean that defines Anonymous Blocking

ccrDnsTtl

The DNS TTL - named “ccrDnsTtl” for legacy reasons

cdnId

The integral, unique identifier of the CDN to which the Delivery Service belongs

cdnName

Name of the CDN to which the Delivery Service belongs

checkPath

A Check Path

consistentHashRegex

A Consistent Hashing Regular Expression

consistentHashQueryParams

An array of Consistent Hashing Query Parameters

deepCachingType

The Deep Caching setting for this Delivery Service

displayName

The Display Name

dnsBypassCname

A DNS Bypass CNAME

dnsBypassIp

A DNS Bypass IP

dnsBypassIp6

A DNS Bypass IPv6

dnsBypassTtl

The DNS Bypass TTL

dscp

A DSCP to be used within the Delivery Service

ecsEnabled

A boolean that defines the EDNS0 Client Subnet Enabled setting on this Delivery Service

edgeHeaderRewrite

A set of Edge Header Rewrite Rules

exampleURLs

An array of Example URLs

firstHeaderRewrite

A set of First Header Rewrite Rules

fqPacingRate

The Fair-Queuing Pacing Rate Bps

geoLimit

An integer that defines the Geo Limit

geoLimitCountries

An array of strings defining the Geo Limit Countries

geoLimitRedirectUrl

A Geo Limit Redirect URL

geoProvider

The Geolocation Provider

globalMaxMbps

The Global Max Mbps

globalMaxTps

The Global Max TPS

httpBypassFqdn

A HTTP Bypass FQDN

id

An integral, unique identifier for this Delivery Service

infoUrl

An Info URL

initialDispersion

The Initial Dispersion

innerHeaderRewrite

A set of Inner Header Rewrite Rules

ipv6RoutingEnabled

A boolean that defines the IPv6 Routing Enabled setting on this Delivery Service

lastHeaderRewrite

A set of Last Header Rewrite Rules

lastUpdated

The date and time at which this Delivery Service was last updated, in :rfc:3339 format

Changed in version 4.0: Prior to API version 4.0, this property used Traffic Ops’s Custom Date/Time Format.

logsEnabled

A boolean that defines the Logs Enabled setting on this Delivery Service

longDesc

The Long Description of this Delivery Service

matchList

The Delivery Service’s Match List

pattern

A regular expression - the use of this pattern is dependent on the type field (backslashes are escaped)

setNumber

An integer that provides explicit ordering of Match List items - this is used as a priority ranking by Traffic Router, and is not guaranteed to correspond to the ordering of items in the array.

type

The type of match performed using pattern.

maxDnsAnswers

The Max DNS Answers allowed for this Delivery Service

maxOriginConnections

The Max Origin Connections

midHeaderRewrite

A set of Mid Header Rewrite Rules

missLat

The Geo Miss Default Latitude used by this Delivery Service

missLong

The Geo Miss Default Longitude used by this Delivery Service

multiSiteOrigin

A boolean that defines the use of Use Multi-Site Origin Feature by this Delivery Service

orgServerFqdn

The Origin Server Base URL

originShield

A Origin Shield string

profileDescription

The Description of the Profile with which this Delivery Service is associated

profileId

The ID of the Profile with which this Delivery Service is associated

profileName

The Name of the Profile with which this Delivery Service is associated

protocol

An integral, unique identifier that corresponds to the Protocol used by this Delivery Service

qstringIgnore

An integral, unique identifier that corresponds to the Query String Handling setting on this Delivery Service

rangeRequestHandling

An integral, unique identifier that corresponds to the Range Request Handling setting on this Delivery Service

regexRemap

A Regex Remap Expression

regional

A boolean value defining the Regional setting on this Delivery Service

regionalGeoBlocking

A boolean defining the Regional Geoblocking setting on this Delivery Service

remapText

Raw Remap Text

signed

true if and only if signingAlgorithm is not null, false otherwise

signingAlgorithm

Either a Signing Algorithm or null to indicate URL/URI signing is not implemented on this Delivery Service

rangeSliceBlockSize

An integer that defines the byte block size for the ATS Slice Plugin. It can only and must be set if rangeRequestHandling is set to 3.

sslKeyVersion

This integer indicates the SSL Key Version

tenantId

The integral, unique identifier of the Tenant who owns this Delivery Service

tlsVersions

A list of explicitly supported TLS Versions

New in version 4.0.

topology

The unique name of the Topology that this Delivery Service is assigned to

trRequestHeaders

If defined, this defines the Traffic Router Log Request Headers used by Traffic Router for this Delivery Service

trResponseHeaders

If defined, this defines the Traffic Router Additional Response Headers used by Traffic Router for this Delivery Service

type

The Type of this Delivery Service

typeId

The integral, unique identifier of the Type of this Delivery Service

xmlId

This Delivery Service’s xml_id

#984 Response Example
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json
Permissions-Policy: interest-cohort=()
Set-Cookie: mojolicious=...; Path=/; Expires=Tue, 08 Jun 2021 01:15:07 GMT; Max-Age=3600; HttpOnly
Vary: Accept-Encoding
Whole-Content-Sha512: RO4tVfDdqx0rEU9BqlRmvsYXmVgVNkivqr6LhJlMulfR+1bLGivP8z93jy3N9bejcMdQwl1RwJojM3MbwgXcqA==
X-Server-Name: traffic_ops_golang/
Date: Tue, 08 Jun 2021 00:15:07 GMT
Content-Length: 806

{ "response": [{
    "active": false,
    "anonymousBlockingEnabled": false,
    "ccrDnsTtl": 3600,
    "cdnId": 2,
    "cdnName": "CDN-in-a-Box",
    "checkPath": null,
    "consistentHashQueryParams": [],
    "consistentHashRegex": null,
    "deepCachingType": "NEVER",
    "displayName": "test",
    "dnsBypassCname": null,
    "dnsBypassIp": null,
    "dnsBypassIp6": null,
    "dnsBypassTtl": null,
    "dscp": 0,
    "ecsEnabled": false,
    "edgeHeaderRewrite": null,
    "exampleURLs": [
        "http://cdn.test.mycdn.ciab.test"
    ],
    "firstHeaderRewrite": null,
    "fqPacingRate": null,
    "geoLimit": 0,
    "geoLimitCountries": null,
    "geoLimitRedirectURL": null,
    "geoProvider": 0,
    "globalMaxMbps": null,
    "globalMaxTps": null,
    "httpBypassFqdn": null,
    "id": 7,
    "infoUrl": null,
    "initialDispersion": 1,
    "innerHeaderRewrite": null,
    "ipv6RoutingEnabled": true,
    "lastHeaderRewrite": null,
    "lastUpdated": "2021-06-08T00:14:04.959292Z",
    "logsEnabled": false,
    "longDesc": "Apachecon North America 2018",
    "matchList": [
        {
            "type": "HOST_REGEXP",
            "setNumber": 0,
            "pattern": ".*\\.test\\..*"
        }
    ],
    "maxDnsAnswers": null,
    "maxOriginConnections": 0,
    "maxRequestHeaderBytes": 0,
    "midHeaderRewrite": null,
    "missLat": 41.881944,
    "missLong": -87.627778,
    "multiSiteOrigin": false,
    "originShield": null,
    "orgServerFqdn": "http://origin.infra.ciab.test",
    "profileDescription": null,
    "profileId": null,
    "profileName": null,
    "protocol": 0,
    "qstringIgnore": 0,
    "rangeRequestHandling": 0,
    "rangeSliceBlockSize": null,
    "regexRemap": null,
    "regional": false,
    "regionalGeoBlocking": false,
    "remapText": null,
    "routingName": "cdn",
    "serviceCategory": null,
    "signed": false,
    "signingAlgorithm": null,
    "sslKeyVersion": null,
    "tenant": "root",
    "tenantId": 1,
    "tlsVersions": null,
    "topology": null,
    "trResponseHeaders": null,
    "trRequestHeaders": null,
    "type": "HTTP",
    "typeId": 1,
    "xmlId": "test"
}]}
1

Only the Delivery Services visible to the requesting user’s Tenant will appear, regardless of their Role or the Delivery Services’ actual ‘server assignment’ status.

POST

Assign an arbitrary number of Delivery Services to a single server.

Auth. Required

Yes

Roles Required

“admin” or “operations”

Permissions Required

DELIVERY-SERVICE:READ, SERVER:READ, DELIVERY-SERVICE:UPDATE, SERVER:UPDATE

Response Type

Object

Request Structure

Table 406 Request Path Parameters

Name

Required

Description

ID

Yes

The integral, unique identifier of the server that you want to assign delivery services to.

Table 407 Request Query Parameters

Name

Required

Description

replace

Yes

Whether the list of Delivery Services you provide should replace the existing list or be merged with the existing list. Must be a 1, or true, or 0, or false.

The request body is an array of IDs of Delivery Services that you want to assign to the server. The array can be empty, but it must be provided.

#985 Request Example
POST /api/4.0/servers/6/deliveryservices?replace=1 HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 3

[
    1
]

Response Structure

dsIds

An array of integral, unique identifiers for Delivery Services which the request added to server. If :replace: is false, Delivery Services that are already assigned will remain, though they are not listed by :dsIds:.

replace

The :replace: value you provided in the body of the request, or null if none was provided.

serverId

The server’s integral, unique identifier

#986 Response Example
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Tue, 25 Feb 2020 09:08:32 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: iV+JzAZSsmlxRZsNtIRg3oA9470hAwrMpq5xhcYVi0Y831Trx2YRlsyhYpOPqHg5+QPoXHGF0nx8uso0fuNarw==
X-Server-Name: traffic_ops_golang/
Date: Tue, 25 Feb 2020 08:08:32 GMT
Content-Length: 129

{
    "alerts": [
        {
            "text": "successfully assigned dses to server",
            "level": "success"
        }
    ],
    "response": {
        "serverId": 6,
        "dsIds": [
            1
        ],
        "replace": true
    }
}