stats_summary
GET
Either retrieve a list of summary stats or the timestamp of the latest recorded stats summary.
What is returned is driven by the query parameter lastSummaryDate.
If the parameter is set it will return an object with the latest timestamp, else an array of summary stats will be returned.
- Auth. Required:
Yes
- Roles Required:
None
- Permissions Required:
STAT:READ, CDN:READ, DELIVERY-SERVICE:READ
- Response Type:
Array or Object
Request Structure
Summary Stats
Name |
Required |
Description |
|---|---|---|
deliveryServiceName |
no |
Return only summary stats that were reported for Delivery Service with the given display name |
cdnName |
no |
Return only summary stats that were reported for CDN with the given name |
statName |
no |
Return only summary stats that were reported for given stat name |
orderby |
no |
Choose the ordering of the results - can only be one of deliveryServiceName, statName or cdnName |
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
|
GET /api/5.0/stats_summary HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Last Updated Summary Stat
Name |
Required |
Description |
|---|---|---|
statName |
no |
Get lastest updated date for the given stat |
lastSummaryDate |
yes |
Tells route to get only lastest updated timestamp |
GET /api/5.0/stats_summary?lastSummaryDate=true HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Response Structure
Summary Stats
- cdnName:
The CDN name for which the summary stat was taken
Note
If the
cdnis equal toallit represents summary_stats across all delivery services across all CDNs- deliveryServiceName:
The Delivery Service display name for which the summary stat was taken for
Note
If the
deliveryServiceNameis equal toallit represents summary_stats across all delivery services within the given CDN- statName:
Stat name summary stat represents
- statValue:
Summary stat value
- summaryTime:
Timestamp of summary, in RFC 3339 format
Changed in version 5.0: Prior to version 5.0 of the API, this field was in Traffic Ops’s Custom Date/Time Format.
- statDate:
Date stat was taken, in
YYYY-MM-DDformat
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: dHNip9kpTGGS1w39/fWcFehNktgmXZus8XaufnmDpv0PyG/3fK/KfoCO3ZOj9V74/CCffps7doEygWeL/xRtKA==
X-Server-Name: traffic_ops_golang/
Date: Mon, 10 Dec 2018 20:56:59 GMT
Content-Length: 150
{ "response": [
{
"cdnName": "CDN-in-a-Box",
"deliveryServiceName": "all",
"statName": "daily_maxgbps",
"statValue": 5,
"summaryTime": "2019-11-19T03:37:33+05:30",
"statDate": "2019-11-19"
},
{
"cdnName": "CDN-in-a-Box",
"deliveryServiceName": "all",
"statName": "daily_maxgbps",
"statValue": 3,
"summaryTime": "2019-11-18T07:59:54+05:30",
"statDate": "2019-11-18"
},
{
"cdnName": "CDN-in-a-Box",
"deliveryServiceName": "all",
"statName": "daily_bytesserved",
"statValue": 1000,
"summaryTime": "2019-11-19T00:42:12+05:30",
"statDate": "2019-11-19"
}
]}
Last Updated Summary Stat
- summaryTime:
Timestamp of the last updated summary, in RFC 3339 format
Changed in version 5.0: Prior to version 5.0 of the API, this field was in Traffic Ops’s Custom Date/Time Format.
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: dHNip9kpTGGS1w39/fWcFehNktgmXZus8XaufnmDpv0PyG/3fK/KfoCO3ZOj9V74/CCffps7doEygWeL/xRtKA==
X-Server-Name: traffic_ops_golang/
Date: Mon, 10 Dec 2018 20:56:59 GMT
Content-Length: 150
{ "response": {
"summaryTime": "2019-11-19T06:12:34+05:30"
}}
POST
Post a stats summary for a given stat.
- Auth. Required:
Yes
- Roles Required:
None
- Permissions Required:
STAT:CREATE, STAT:READ, CDN:READ, DELIVERY-SERVICE:READ
- Response Type:
Object
Request Structure
- cdnName:
The CDN name for which the summary stat was taken
Note
If the
cdnis equal toallit represents summary_stats across all delivery services across all CDNs- deliveryServiceName:
The Delivery Service display name for which the summary stat was taken for
Note
If the
deliveryServiceNameis equal toallit represents summary_stats across all delivery services within the given CDN- statName:
Stat name summary stat represents
- statValue:
Summary stat value
- summaryTime:
Timestamp of summary, in RFC 3339 format
Changed in version 5.0: Prior to version 5.0 of the API, this field was in Traffic Ops’s Custom Date/Time Format.
- statDate:
Date stat was taken, in
YYYY-MM-DDformat
Note
statName, statValue and summaryTime are required. If cdnName and deliveryServiceName are not given they will default to all.
POST /api/5.0/stats_summary HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 113
Content-Type: application/json
{
"cdnName": "CDN-in-a-Box",
"deliveryServiceName": "all",
"statName": "daily_maxgbps",
"statValue": 10,
"summaryTime": "2019-12-05T09:55:07+05:30",
"statDate": "2019-12-05"
}
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: ezxk+iP7o7KE7zpWmGc0j8nz5k+1wAzY0HiNiA2xswTQrt+N+6CgQqUV2r9G1HAsPNr0HF2PhYs/Xr7DrYOw0A==
X-Server-Name: traffic_ops_golang/
Date: Thu, 06 Dec 2018 02:14:45 GMT
Content-Length: 97
{ "alerts": [
{
"text": "Stats Summary was successfully created",
"level": "success"
}]
}