cachegroups/{{ID}}
PUT
Update Cache Group
- Auth. Required
Yes
- Roles Required
“admin” or “operations”
- Permissions Required
CACHE-GROUP:UPDATE, CACHE-GROUP:READ, TYPE:READ
- Response Type
Object
Request Structure
Parameter |
Description |
---|---|
ID |
The ID of a Cache Group |
- fallbacks
An optional field which, when present, should contain an array of strings that are the Names of other Cache Groups which will be the Fallbacks1
- fallbackToClosest
A boolean that sets the Fallback to Closest behavior of the Cache Group1
Note
The default value of
fallbackToClosest
istrue
, and if it isnull
Traffic Control components will still interpret it as though it weretrue
.- latitude
An optional field which, if present, should be a floating-point number that will define the Latitude for the Cache Group2
- localizationMethods
Array of Localization Methods (as strings)
Tip
This field has no defined meaning if the Type identified by
typeId
is not “EDGE_LOC”.- longitude
An optional field which, if present, should be a floating-point number that will define the Longitude for the Cache Group2
- name
The Name of the Cache Group
- parentCachegroupId
An optional field which, if present, should be an integer that is the ID of a Parent for this Cache Group.
- secondaryParentCachegroupId
An optional field which, if present, should be an integral, unique identifier for this Cache Group’s secondary parent
- shortName
An abbreviation of the
name
- typeId
An integral, unique identifier for the Cache Group’s Type
PUT /api/4.0/cachegroups/8 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 118
Content-Type: application/json
{
"latitude": 0.0,
"longitude": 0.0,
"name": "test",
"fallbacks": [],
"fallbackToClosest": true,
"shortName": "test",
"typeId": 23,
"localizationMethods": ["GEO"]
}
Response Structure
- fallbacks
An array of strings that are Cache Group names that are registered as Fallbacks for this Cache Group1
- fallbackToClosest
A boolean value that defines the Fallback to Closest behavior of this Cache Group1
- id
An integer that is the ID of the Cache Group
- lastUpdated
The time and date at which this entry was last updated in Traffic Ops’s Custom Date/Time Format
- latitude
A floating-point Latitude for the Cache Group
- localizationMethods
An array of Localization Methods as strings
- longitude
A floating-point Longitude for the Cache Group
- name
A string containing the Name of the Cache Group
- parentCachegroupId
An integer that is the ID of this Cache Group’s Parent - or
null
if it doesn’t have a Parent- parentCachegroupName
A string containing the Name of this Cache Group’s Parent - or
null
if it doesn’t have a Parent- secondaryParentCachegroupId
An integer that is the ID of this Cache Group’s Secondary Parent - or
null
if it doesn’t have a Secondary Parent- secondaryParentCachegroupName
A string containing the Name of this Cache Group’s Secondary Parent Cache Group - or
null
if it doesn’t have a Secondary Parent- shortName
A string containing the Short Name of the Cache Group
- typeId
An integral, unique identifier for the ‘Type’ of the Cache Group
- typeName
A string that names the Type of this Cache Group
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: t1W65/2kj25QyHt0Ib0xpBaAR2sXu2kOsRZ49WjKZp/AK5S1YWhX7VNWCuUGiN1VNM4QRNqODC/7ewhYDFUncA==
X-Server-Name: traffic_ops_golang/
Date: Wed, 14 Nov 2018 19:14:28 GMT
Content-Length: 385
{ "alerts": [
{
"text": "cachegroup was updated.",
"level": "success"
}
],
"response": {
"id": 8,
"name": "test",
"shortName": "test",
"latitude": 0,
"longitude": 0,
"parentCachegroupName": null,
"parentCachegroupId": null,
"secondaryParentCachegroupName": null,
"secondaryParentCachegroupId": null,
"fallbacks": [],
"fallbackToClosest": true,
"localizationMethods": [
"GEO"
],
"typeName": "EDGE_LOC",
"typeId": 23,
"lastUpdated": "2018-11-14 19:14:28+00"
}}
DELETE
Delete a Cache Group. A Cache Group which has assigned servers or is the Parent of one or more other Cache Groups cannot be deleted.
- Auth. Required
Yes
- Roles Required
“admin” or “operations”
- Permissions Required
CACHE-GROUP:DELETE, CACHE-GROUP:READ
- Response Type
undefined
Request Structure
Parameter |
Description |
---|---|
ID |
The ID of a Cache Group to be deleted |
DELETE /api/4.0/cachegroups/42 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Response Structure
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: 5jZBgO7h1eNF70J/cmlbi3Hf9KJPx+WLMblH/pSKF3FWb/10GUHIN35ZOB+lN5LZYCkmk3izGbTFkiruG8I41Q==
X-Server-Name: traffic_ops_golang/
Date: Wed, 14 Nov 2018 20:31:04 GMT
Content-Length: 57
{ "alerts": [
{
"text": "cachegroup was deleted.",
"level": "success"
}
]}
- 1(1,2,3,4)
Traffic Router will first check for a
fallbacks
array and, when that is empty/unset/all the Cache Groups in it are also unavailable, will subsequently check forfallbackToClosest
. If that istrue
, then it falls back to the geographically closest Cache Group capable of serving the same content or, when it isfalse
/no such Cache Group exists/said Cache Group is also unavailable, will respond to clients with a failure response indicating the problem.- 2(1,2)
While these fields are technically optional, note that if they are not specified many things may break. For this reason, Traffic Portal requires them when creating or editing Cache Groups.