To query a report, you need to review a product's data store metadata to see its supported dimensions and metrics. You can then choose from these combinations to create customized reports tailored to your specifications.
Step 1: List data stores
Run a List operation for the applicable product to see its collection of data stores, and store id
values assigned to the data store's dimensions and the metrics. This example uses the List Adaptive Media Delivery data stores operation:
The operation:
GET /media-delivery-reports/v1/adaptive-media-delivery/data-stores
The response:
[
{
{Previous data store}
},
{
"id": 44,
"name": "Offload AMD",
"type": "standard",
"description": "Provides origin hits and origin offload metrics for a chosen dimension.",
"dimensions": [
{
"id": 1,
"name": "Time",
"description": "Indicates the time a requestor consumed content. Akamai automatically sets this dimension.",
"group": [
{
"id": -1,
"name": "OTHERS",
"description": "OTHERS"
}
]
},
{
"id": 2,
"name": "CPCode",
"description": "A Content Provider code (CP code) is an identifier assigned to a contract for use in reporting, billing, and monitoring traffic served.",
"group": [
{
"id": -1,
"name": "OTHERS",
"description": "OTHERS"
}
]
},
{
"id": 18,
"name": "Content Type",
"description": "The value of the HTTP content type header served to the client.",
"group": [
{
"id": -1,
"name": "OTHERS",
"description": "OTHERS"
}
]
},
{...}
],
"metrics": [
{
"id": 4,
"name": "Edge Hits",
"type": "count",
"description": "All hits to the edge servers by end users.",
"group": [
{
"id": -1,
"name": "OTHERS",
"description": "OTHERS"
}
]
},
{
"id": 5,
"name": "Edge Object Volume",
"unit": "bytes",
"type": "volume",
"description": "Size of the actual content transferred to the client.",
"group": [
{
"id": -1,
"name": "OTHERS",
"description": "OTHERS"
}
]
},
{
"id": 6,
"name": "Edge Overhead Volume",
"unit": "bytes",
"type": "volume",
"description": "Total number of protocol component bytes that include request bytes, TCP/IP overhead bytes, Ethernet bytes, and UDP/IP overhead bytes served from the edge server to the end user.",
"group": [
{
"id": -1,
"name": "OTHERS",
"description": "OTHERS"
}
]
},
{...}
],
"aggregationInSeconds": 86400,
"purgeIntervalInDays": 90,
"maxQueryDurationInMinutes": 44640
},
{
"id": 45,
{Information specific to this data store}
},
{
{Additional data store}
}
]
The Offload AMD
data store has what we need. So, we store the relevant dimension and metric id
values.
Some dimensions use the same name and gather similar data, but each is tied to specific functionality. Review the description for each and make sure you're using the proper
id
for the dimension or metric you want.
Step 2: Get the data
Run the relevant operation to get data and include your dimension and metric id
values in the query string for the operation. Here's an example of the Get Adaptive Media Delivery data request that shows how to:
- Get
Edge Volume
by time for a specific CP code. - Set a time period of
2020-12-01T00:00Z
to2020-12-01T05:00Z
. - Include the dimension
id
of1
that representsTime
, and metricid
of107
that representsEdge Volume
for CP code12345
.
The operation:
GET /media-delivery-reports/v1/adaptive-media-delivery/data?startDate=2020-12-01T00:00Z&endDate=2020-12-01T05:00Z&cpcodes=12345&ipVersion=ipv4&limit=1000&offset=0&deliveryOption=http&deliveryFormat=hls&deliveryType=live&dimensions=1&metrics=107`
The response:
[
{
"columns": [
{
"type": "dimension",
"name": "Time",
"description": "time",
"index": 0
},
{
"type": "metric",
"name": "Edge Volume",
"description": "Edge Volume",
"index": 1,
"aggregate": "191.79",
"peak": "101.09",
"unit": "GB"
}
],
"rows": [
[ "1448931300", "101.09" ],
[ "1448937600", "10.06" ],
[ "1448943000", "80.64" ]
],
"metaData": {
"aggregationInSeconds": 300,
"limit": 1000,
"startTimeInEpoch": 1448928000,
"hasMoreData": false,
"timeZone": "GMT",
"offset": 0,
"reportPack": "Test report pack",
"endTimeInEpoch": 1448946000
}
}
]