Analytics operations#
This section describes the analytics operation in the Rackspace CDN API.
Retrieve analytics data#
GET /v1.0/{project_id}/services/{service_id}/analytics?{query parameters}
This operation retrieves analytics data using the Rackspace Metrics API.
The following table shows the successful response code for this operation.
Response Code |
Name |
Description |
---|---|---|
200 |
OK |
Success. |
Request#
The following table shows the URI parameters for the request.
Name |
Type |
Description |
---|---|---|
{project_id} |
String |
The project ID for the user. If you do not set the |
{service_id} |
String |
Specifies the service ID that represents distributed content. The value is a UUID, such as 96737ae3-cfc1-4c72-be88- 5d0e7cc9a3f0, that is generated by the server. |
This table shows the query parameters for the request:
Name |
Type |
Description |
---|---|---|
domain |
String |
The domain name for which to retrieve analytics data. For example: prod.abc.com |
startTime |
String |
The start time for the metric that you want to retrieve. The format is YYYY-MM-DDTHH:MM:SS. The timestamp is interpreted as the UTC time zone. |
endTime |
String |
The end time for the metric that you want to retrieve. The format is YYYY-MM-DDTHH:MM:SS. The timestamp is interpreted as the UTC time zone. |
metricType |
String |
An enum of the counters, for example, requestCount. Enums are metrics that can have a range of string values. When a metric is identified as an enum metric, a counter is kept for each different value of that metric. The counter is then incremented each time another instance of that value is received. |
This operation does not accept a request body.
Example: Retrieve analytics data, HTTP request
GET /v1.0/11111/services/6592bb63-e320-4dba-931d-31727e394aa0/analytics?domain=www.mywebsite.com&startTime=2016-05-25T00:00:00&endTime=2016-05-31T00:00:0&metricType=requestCount HTTP/1.1
Host: global.cdn.api.rackspacecloud.com
X-Auth-Token: 0f6e9f63600142f0a970911583522217
Accept: application/json
Content-type: application/json
Response#
The following table shows the body parameters for the response.
Name |
Type |
Description |
---|---|---|
domain |
String |
Specifies the domain for which metrics are retrieved. |
{metricType} |
String |
Specifies the type for the metric that is retrieved. For example, |
count |
String |
Specifies the number of occurrences of the specified {metricType} that is retrieved by geographic area. |
timestamp |
String |
Specifies the timestamp for the metric that is retrieved by geographic area. The timestamp is the UTC time zone. |
flavor |
String |
Specifies the flavor. The only valid value is |
provider |
String |
Specifies the provider. The only valid value is |
Example: Retrieve analytics data, HTTP and JSON response
HTTP/1.1 200 OK
Content-Type: application/json
{
"domain": "www.mywebsite.com",
"requestCount": {
"India": [
[{
"count": 37,
"timestamp": "2016-05-25T00:00:00"
}, {
"count": 10,
"timestamp": "2016-05-26T00:00:00"
}, {
"count": 100,
"timestamp": "2016-05-27T00:00:00"
}, {
"count": 29,
"timestamp": "2016-05-28T00:00:00"
}, {
"count": 20,
"timestamp": "2016-05-29T00:00:00"
}, {
"count": 97,
"timestamp": "2016-05-30T00:00:00"
}, {
"count": 74,
"timestamp": "2016-05-31T00:00:00"
}]
],
"EMEA": [
[{
"count": 420086,
"timestamp": "2016-05-24T00:00:00"
}, {
"count": 1506700,
"timestamp": "2016-05-25T00:00:00"
}, {
"count": 1275730,
"timestamp": "2016-05-26T00:00:00"
}, {
"count": 2251742,
"timestamp": "2016-05-27T00:00:00"
}, {
"count": 2166639,
"timestamp": "2016-05-28T00:00:00"
}, {
"count": 2260165,
"timestamp": "2016-05-29T00:00:00"
}, {
"count": 2126752,
"timestamp": "2016-05-30T00:00:00"
}, {
"count": 1470018,
"timestamp": "2016-05-31T00:00:00"
}]
],
"APAC": [
[{
"count": 173557,
"timestamp": "2016-05-24T00:00:00"
}, {
"count": 60650,
"timestamp": "2016-05-25T00:00:00"
}]
],
"North America": [
[{
"count": 96970,
"timestamp": "2016-05-24T00:00:00"
}, {
"count": 230642,
"timestamp": "2016-05-25T00:00:00"
}, {
"count": 50690,
"timestamp": "2016-05-26T00:00:00"
}]
],
"South America": [
[]
],
"Japan": [
[]
]
},
"flavor": "cdn",
"provider": "akamai"
}