Overview
The analytics API is the best way to incorporate usage data into an existing workflow and forecast billing. Analytics responses consist of 2 parts:
- The list of metrics names
- The data array containing metrics broken out by the granularity specified in the request
The simplest response type is one in which there is only one element in the data array due to the start and end date encompassing a single instance of the specified granularity. Here is a sample request for the metrics for the month of September 2014 on the CDS (CDN delivery) platform grouped by month:
curl -H "Authorization: Bearer <bearer_token>" \
"https://striketracker.highwinds.com/api/accounts/<accountId>/analytics/transfer?
startDate=2014-09-01T00:00:00Z&endDate=2014-09-30T23:59:59Z&platforms=3&granularity=P1M"
This requests produces the following response:
{
"series": [
{
"type":"",
"key":"<hostId>",
"metrics": [
"usageTime",
"ninetyFiveFiveMbps",
"ninetyFiveFiveMbpsUsageTime",
"ninetyFiveFiveRequests",
"ninetyFiveFiveRequestsUsageTime",
"xferUsedTotalMB",
"xferUsedMinMB",
"xferUsedMaxMB",
"xferUsedMeanMB",
"xferAttemptedTotalMB",
"durationTotal",
"xferRateMaxMbps",
"xferRateMaxUsageTime",
"xferRateMinMbps",
"xferRateMinUsageTime",
"xferRateMeanMbps",
"requestsCountTotal",
"requestsCountMin",
"requestsCountMax",
"requestsCountMean",
"rpsMax",
"rpsMaxUsageTime",
"rpsMin",
"rpsMinUsageTime",
"rpsMean",
"lastUpdatedTime",
"xferRateMbps",
"userXferRateMbps",
"rps",
"completionRatio",
"responseSizeMeanMB",
"peakToMeanMBRatio",
"peakToMeanRequestsRatio"
],
"data": [
[
1409529600000,
0.2765296,
1411036200000,
0.033333333333333,
1412024700000,
76932.954354,
5.18493,
11.406846,
9.332874,
76932.954354,
217749,
0.30418256,
1410984000000,
0.1382648,
1410084000000,
0.24887664,
86326,
7,
15,
10,
0.05,
1412049300000,
0.023333333333333,
1410806400000,
0.033333333333333,
1412136866000,
0.23744738998148,
2826.4820267005,
0.033304783950617,
1,
0.89119100101939,
1.2222222222222,
1.5
]
]
}
]
}
Platforms
The platforms resource lists all of the platforms and whether are currently available to your account. If you feel that you could benefit from enabling additional platforms or just want to know more about their functionality please contact your sales representative or solutions engineer.
Some platforms are legacy and not available for provisioning on any additional accounts.
curl -H "Authorization: Bearer <bearer_token>" \
"https://striketracker.highwinds.com/api/accounts/<accountId>/platforms"
Yields:
{
"list": [
{
"id": 1,
"code": "FLS",
"name": "Flash Live Streaming",
"capabilities": [
"ARCHIVABLE"
],
"type": null,
"available": false
},
{
"id": 2,
"code": "OLS",
"name": "Octoshape Live Streaming",
"capabilities": [
"ARCHIVABLE"
],
"type": null,
"available": false
},
{
"id": 3,
"code": "CDS",
"name": "HTTP Caching",
"capabilities": [
"ANALYZABLE",
"CONFIGURABLE",
"REPORTABLE"
],
"type": "DELIVERY",
"available": true
},
{
"id": 5,
"code": "MPS",
"name": "HTTP Streaming",
"capabilities": [
"CONFIGURABLE",
"REPORTABLE"
],
"type": null,
"available": false
},
{
"id": 6,
"code": "AIS",
"name": "Apple iPhone/iPad Streaming",
"capabilities": [
"ANALYZABLE"
],
"type": "DELIVERY",
"available": false
},
{
"id": 7,
"code": "ADS",
"name": "Adobe Dynamic Streaming",
"capabilities": [
"ANALYZABLE"
],
"type": "DELIVERY",
"available": false
},
{
"id": 8,
"code": "MSS",
"name": "Microsoft Smooth Streaming",
"capabilities": [
"ANALYZABLE"
],
"type": "DELIVERY",
"available": false
},
{
"id": 12,
"code": "MPI",
"name": "MultiProtocol Ingest",
"capabilities": [
"REPORTABLE"
],
"type": "INGEST",
"available": false
},
{
"id": 13,
"code": "MTC",
"name": "Mid-Tier Cache",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 23,
"code": "IOS",
"name": "Internal Origin Service",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 33,
"code": "DSS",
"name": "Distributed Storage Service",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 34,
"code": "SDS",
"name": "HTTPS Caching (SDS)",
"capabilities": [
"ANALYZABLE",
"CONFIGURABLE",
"REPORTABLE"
],
"type": "DELIVERY",
"available": false
},
{
"id": 35,
"code": "SIS",
"name": "Secure Apple iPhone/iPad Streaming",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 36,
"code": "SMS",
"name": "Secure Microsoft Smooth Streaming",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 37,
"code": "SAS",
"name": "Secure Adobe Dynamic Streaming",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 38,
"code": "FMS",
"name": "Flash Media Streaming",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 39,
"code": "WMS",
"name": "Windows Media Streaming",
"capabilities": [],
"type": null,
"available": false
},
{
"id": 40,
"code": "CDD",
"name": "CDS Origin Shielding",
"capabilities": [
"ANALYZABLE",
"ANALYZABLE_USAGE_ONLY"
],
"type": "SHIELDING",
"available": false
},
{
"id": 41,
"code": "CDI",
"name": "CDS Ingest",
"capabilities": [
"ANALYZABLE",
"ANALYZABLE_USAGE_ONLY"
],
"type": "INGEST",
"available": false
},
{
"id": 42,
"code": "SES",
"name": "Script Engine Traffic",
"capabilities": [
"ANALYZABLE",
"ANALYZABLE_USAGE_ONLY"
],
"type": null,
"available": false
},
{
"id": 43,
"code": "CDR",
"name": "Content Delivery Receipts",
"capabilities": [
"ANALYZABLE"
],
"type": null,
"available": false
},
{
"id": 44,
"code": "SDI",
"name": "Secure Ingest",
"capabilities": [
"ANALYZABLE",
"ANALYZABLE_USAGE_ONLY"
],
"type": null,
"available": false
}
]
}
Services
The services resource informs you which services are available on the requested account. As with platforms, please contact your sales representative or solutions engineer to enable more services.
curl -H "Authorization: Bearer <bearer_token>" \
"https://striketracker.highwinds.com/api/accounts/<accountId>/services"
Yields:
{
"list": [
{
"id": 40,
"name": "HTTP Caching (CDS)",
"description": "NA/EU"
},
{
"id": 41,
"name": "HTTP Caching (CDS)",
"description": "NA/EU, Brazil, Asia-Pacific, Oceania"
},
{
"id": 44,
"name": "Raw Access Logs",
"description": "Access log enablement"
}
]
}