cachegroups/{{ID}}/deliveryservices

POST

Assigns all of the “assignable” servers within a Cache Group to one or more Delivery Services.

Note

“Assignable” here means all of the Cache Group’s servers that have a Type that matches one of the glob patterns EDGE* or ORG*. If even one server of any Type exists within the Cache Group that is not assigned to the same CDN as the Delivery Service to which an attempt is being made to assign them, the request will fail.

Auth. Required:

Yes

Roles Required:

“admin” or “operations”

Permissions Required:

CACHE-GROUP:UPDATE, DELIVERY-SERVICE:UPDATE, CACHE-GROUP:READ, DELIVERY-SERVICE:READ

Response Type:

Object

Request Structure

deliveryServices:

The integral, unique identifiers of the Delivery Services to which the Cache Group’s servers are being assigned

#1132 Request Example
POST /api/5.0/cachegroups/8/deliveryservices HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 25
Content-Type: application/json

{"deliveryServices": [2]}

Response Structure

deliveryServices:

An array of integral, unique identifiers for Delivery Services to which the Cache Group’s servers have been assigned

id:

An integer that is the Cache Group’s ID

serverNames:

An array of the (short) hostnames of all of the Cache Group’s “assignable” Servers

#1133 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-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: j/yH0gvJoaGjiLZU/0MA8o5He20O4aJ5wh1eF9ex6F6IBO1liM9Wk9RkWCw7sdiUHoy13/mf7gDntisZwzP7yw==
X-Server-Name: traffic_ops_golang/
Date: Wed, 14 Nov 2018 19:54:17 GMT
Content-Length: 183

{ "alerts": [
    {
        "text": "Delivery services successfully assigned to all the servers of cache group 8.",
        "level": "success"
    }
],
"response": {
    "id": 8,
    "serverNames": [
        "foo"
    ],
    "deliveryServices": [
        2
    ]
}}