endpoint-usage-by-time report

The following shows how to generate the endpoint-usage-by-time report using either the Reporting API’s Generate a report POST operation or the Get a cacheable report GET operation. Details about each report’s supported products, metrics, filters, and available data intervals are also available dynamically by running the API’s Get a report type operation, also shown below. See also other available reports.

Report definition

Provides information about the usage of your API endpoints over time and the API keys included in the incoming API requests.

This report allows you to configure the aggregation interval for each data record. Available interval values are: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.

Business object: cpcode

Data available for: 90 days

Required products: API Gateway

Available metrics

Metric Description
Data metrics
edgeBytes The volume for the amount of API traffic that left the Akamai network.
edgeHits The request count.
midgressBytes The volume for the amount of internal API traffic exchanged between Akamai edge servers.
Summary metrics
edgeBytesMax The highest volume for the amount of API traffic that left the Akamai network.
edgeBytesMin The lowest volume for the amount of API traffic that left the Akamai network.
edgeBytesTotal The total volume of edge traffic for given objects and filters.
edgeHitsMax The highest number of requests.
edgeHitsMin The lowest number of requests.
edgeHitsTotal The total number of edge requests for given objects and filters.
midgressBytesMax The highest volume for the amount of internal API traffic exchanged between Akamai edge servers.
midgressBytesMin The lowest volume for the amount of internal API traffic exchanged between Akamai edge servers.
midgressBytesTotal The total volume for the amount of internal API traffic exchanged between Akamai edge servers.

Available filters

Filter Type Description
Optional filters
endpoint_id Integer The ID of an API configuration registered with Akamai.
http_method Enumeration A request method indicating the action performed on a resource.
move: Copies, performs updates required by the move, like updating URLs, then deletes the source.
unlock: Removes a lock on the target resource.
proppatch: Sets or removes properties of the target resource.
delete: Removes all information about the target resource.
put: Replaces existing information about the target resource.
head: Retrieves header information about the target resource, with no message body in the response.
mkcol: Creates a new collection resource.
patch: Updates existing information about the target resource.
propfind: Retrieves properties defined on the target resource.
trace: Creates a message loop-back test along the path to the resource.
post: Sends information to the server.
get: Retrieves information about the target resource.
options: Describes communication methods for the target resource.
lock: Prevents the use of other methods on the target resource.
copy: Duplicates the target resource.
connect: Creates a tunnel to the server.
response_class Enumeration A class of HTTP response status codes, from 0xx through 6xx.
0xx: An aborted action on the client side.
1xx: An informational response, like Continue.
2xx: A successful response.
3xx: Success, but a redirect where the thing you want is somewhere else.
4xx: Error, where there’s some problem with the client request.
5xx: Error, where there’s some problem with how the API server responded to the client request.
6xx: Invalid headers (defined by Akamai).
response_code Integer An HTTP response status code, for example, 201.

Sample report

POST /reporting-api/v1/reports/endpoint-usage-by-time/versions/1/report-data{?start,end,interval}

Sample: /reporting-api/v1/reports/endpoint-usage-by-time/versions/1/report-data?start=2020-06-26T13%3A40%3A00Z&end=2020-06-26T14%3A00%3A00Z&interval=FIVE_MINUTES

Object type: Query

Download schema: report-request-schema.json

Query parameters

Parameter Type Sample Description
Required
start String 2020-06-26T13:40:00Z Specifies the start of the reported period as an ISO–8601 timestamp with optional time zone. The report includes data that matches the start value’s timestamp.
end String 2020-06-26T14:00:00Z Specifies the end of the reported period as an ISO–8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp.
interval Enumeration FIVE_MINUTES The duration of each data record. Available values: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.

JSON request members

Member Type Description
objectIds Array Specifies the set of cpcode values you want to report on.
objectIds Enumeration As an alternative to an array of ID values, specify all as a string for unfiltered data. Either way, objectIds is required.
metrics Array The set of desired metrics. If omitted, the report includes all available metrics.
filters Map of Arrays Specifies a set of custom filters, with each filter’s name keying an array with each filter’s set of values.

Request body:

{
    "objectIds": [
        "55232",
        "23433",
        "32433"
    ],
    "metrics": [
        "edgeBytes",
        "edgeBytesMax",
        "edgeBytesMin",
        "edgeBytesTotal",
        "edgeHits",
        "edgeHitsMax",
        "edgeHitsMin",
        "edgeHitsTotal",
        "midgressBytes",
        "midgressBytesMax",
        "midgressBytesMin",
        "midgressBytesTotal"
    ],
    "filters": {
        "endpoint_id": [
            "577595",
            "577598"
        ],
        "http_method": [
            "delete",
            "put"
        ],
        "response_class": [
            "3xx",
            "4xx"
        ],
        "response_code": [
            "201",
            "200"
        ]
    }
}

GET /reporting-api/v1/reports/endpoint-usage-by-time/versions/1/report-data{?start,end,interval,objectIds,allObjectIds,metrics,filters}

Sample: /reporting-api/v1/reports/endpoint-usage-by-time/versions/1/report-data?start=2020-06-26T13%3A40%3A00Z&end=2020-06-26T14%3A00%3A00Z&interval=FIVE_MINUTES&objectIds=55232,23433,32433&metrics=edgeBytes%2CedgeBytesMax&filters=endpoint_id%3D577596%2Cendpoint_id%3D577595%2Chttp_method%3Dget%2Chttp_method%3Dput

Query parameters

Parameter Type Sample Description
Required
start String 2020-06-26T13:40:00Z Specifies the end of the reported period as an ISO–8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp.
end String 2020-06-26T14:00:00Z Specifies if unavailable reports should be shown.
interval Enumeration FIVE_MINUTES The duration of each data record. Available values: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.
Optional
allObjectIds Boolean true As an alternative to objectIds, enabling this generates a report that includes all IDs available for the cpcode objectType. This parameter is ignored if the request also specifies a set of objectIds.
objectIds String 55232,23433,32433 As an alternative to allObjectIds, specifies the set of unique IDs for the cpcode objectType you want to report on, formatted as a comma-delimited list.
metrics String edgeBytes,edgeBytesMax Specifies a comma-separated list of metrics to include in the report, otherwise all metrics if omitted. The set of available metrics depends on the type of report. URL-encode the entire value in the GET request.
filters String endpoint_id=577596,endpoint_id=577595,http_method=get,http_method=put Specifies criteria to filter the report’s data. The set of available filters depends on the type of report. Separate each filter name and value with an equals (=) character, and separate various name/value pairs with commas (,). To specify more than one filter value, repeat the filter name. See the accompanying example for guidance. URL-encode the entire value in the GET request.

Status 200 application/json

Object type: Report

Download schema: report-response-schema.json

Response body:

{
    "metadata": {
        "name": "endpoint-usage-by-time",
        "version": "1",
        "outputType": "FLAT",
        "groupBy": [
            "startdatetime"
        ],
        "interval": "FIVE_MINUTES",
        "start": "2020-06-26T13:40:00Z",
        "end": "2020-06-26T14:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [
            {
                "name": "endpoint_id",
                "values": [
                    "577597",
                    "577599"
                ]
            },
            {
                "name": "http_method",
                "values": [
                    "patch",
                    "put"
                ]
            },
            {
                "name": "response_class",
                "values": [
                    "4xx",
                    "5xx"
                ]
            },
            {
                "name": "response_code",
                "values": [
                    "403",
                    "201"
                ]
            }
        ],
        "columns": [
            {
                "name": "groupBy",
                "label": "startdatetime"
            },
            {
                "name": "edgeBytes",
                "label": "Edge Bytes"
            },
            {
                "name": "edgeHits",
                "label": "Edge Bytes"
            },
            {
                "name": "midgressBytes",
                "label": "Midgress Bytes"
            }
        ],
        "objectType": "cpcode",
        "objectIds": [
            "55232",
            "23433",
            "32433"
        ]
    },
    "data": [
        {
            "startdatetime": "2020-06-26T13:40:00Z",
            "edgeBytes": "1954",
            "edgeHits": "4646",
            "midgressBytes": "3155"
        },
        {
            "startdatetime": "2020-06-26T13:45:00Z",
            "edgeBytes": "1059",
            "edgeHits": "3093",
            "midgressBytes": "349"
        },
        {
            "startdatetime": "2020-06-26T13:50:00Z",
            "edgeBytes": "4022",
            "edgeHits": "4873",
            "midgressBytes": "4119"
        },
        {
            "startdatetime": "2020-06-26T13:55:00Z",
            "edgeBytes": "1502",
            "edgeHits": "350",
            "midgressBytes": "1832"
        }
    ],
    "summaryStatistics": {
        "edgeBytesMax": {
            "value": "1132",
            "details": {}
        },
        "edgeBytesMin": {
            "value": "966",
            "details": {}
        },
        "edgeBytesTotal": {
            "value": "356",
            "details": {}
        },
        "edgeHitsMax": {
            "value": "996",
            "details": {}
        },
        "edgeHitsMin": {
            "value": "433",
            "details": {}
        },
        "edgeHitsTotal": {
            "value": "2665",
            "details": {}
        },
        "midgressBytesMax": {
            "value": "3445",
            "details": {}
        },
        "midgressBytesMin": {
            "value": "3063",
            "details": {}
        },
        "midgressBytesTotal": {
            "value": "2044",
            "details": {}
        }
    }
}

Status 200 text/csv

Response Body:

#METADATA_START
name,endpoint-usage-by-time
version,1
source,endpoint-usage-by-time/versions/1
groupBy,startdatetime
start,2020-06-26T13:40:00Z
end,2020-06-26T14:00:00Z
interval,`FIVE_MINUTES`
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,cpcode
objectIds,55232,23433,32433
endpoint_id,577597,577599
http_method,patch,put
response_class,4xx,5xx
response_code,403,201
#METADATA_END

#SUMMARYSTATISTICS_START
edgeBytesMax,1132
edgeBytesMin,966
edgeBytesTotal,356
edgeHitsMax,996
edgeHitsMin,433
edgeHitsTotal,2665
midgressBytesMax,3445
midgressBytesMin,3063
midgressBytesTotal,2044
#SUMMARYSTATISTICS_END

#COLUMNS_START
startdatetime,edgeBytes,edgeHits,midgressBytes
#COLUMNS_END

#DATA_START
2020-06-26T13:40:00Z,1954,4646,3155
2020-06-26T13:45:00Z,1059,3093,349
2020-06-26T13:50:00Z,4022,4873,4119
2020-06-26T13:55:00Z,1502,350,1832
#DATA_END

Get report details

This sample Get a report type operation gets the same information you need to run the endpoint-usage-by-time report as provided in this reference documentation, but available dynamically to your API client application.

GET /reporting-api/v1/reports/endpoint-usage-by-time/versions/1

Status 200 application/json

Object type: ReportType

Download schema: data-row-schema.json

Response body:

{
    "name": "endpoint-usage-by-time",
    "description": "Provides information about the usage of your API endpoints over time and the API keys included in the incoming API requests.",
    "businessObjectName": "cpcode",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": true,
    "outputType": "FLAT",
    "requiredProducts": [
        "API Gateway"
    ],
    "requiredRoles": [
        "API Gateway Viewer",
        "API Gateway Administrator"
    ],
    "available": true,
    "metrics": [
        {
            "name": "edgeBytes",
            "description": "The volume for the amount of API traffic that left the Akamai network.",
            "label": "Edge Bytes",
            "unit": "BYTE",
            "summaryStatistic": false
        },
        {
            "name": "edgeBytesMax",
            "description": "The highest volume for the amount of API traffic that left the Akamai network.",
            "label": "Edge Bytes Max",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "edgeBytesMin",
            "description": "The lowest volume for the amount of API traffic that left the Akamai network.",
            "label": "Edge Bytes Min",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "edgeBytesTotal",
            "description": "The total volume of edge traffic for given objects and filters.",
            "label": "Total Edge Bytes",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "edgeHits",
            "description": "The request count.",
            "label": "Edge Bytes",
            "unit": "COUNT",
            "summaryStatistic": false
        },
        {
            "name": "edgeHitsMax",
            "description": "The highest number of requests.",
            "label": "Edge Hits Max",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "edgeHitsMin",
            "description": "The lowest number of requests.",
            "label": "Edge Hits Min",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "edgeHitsTotal",
            "description": "The total number of edge requests for given objects and filters.",
            "label": "Total Edge Hits",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "midgressBytes",
            "description": "The volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Midgress Bytes",
            "unit": "BYTE",
            "summaryStatistic": false
        },
        {
            "name": "midgressBytesMax",
            "description": "The highest volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Midgress Bytes Max",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "midgressBytesMin",
            "description": "The lowest volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Midgress Bytes Min",
            "unit": "BYTE",
            "summaryStatistic": true
        },
        {
            "name": "midgressBytesTotal",
            "description": "The total volume for the amount of internal API traffic exchanged between Akamai edge servers.",
            "label": "Total Midgress Bytes",
            "unit": "BYTE",
            "summaryStatistic": true
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "groupBy": [
        "startdatetime"
    ],
    "filters": [
        {
            "name": "http_method",
            "type": "enum",
            "description": "A request method indicating the action performed on a resource.",
            "values": [
                {
                    "value": "move",
                    "description": "Copies, performs updates required by the move, like updating URLs, then deletes the source."
                },
                {
                    "value": "unlock",
                    "description": "Removes a lock on the target resource."
                },
                {
                    "value": "proppatch",
                    "description": "Sets or removes properties of the target resource."
                },
                {
                    "value": "delete",
                    "description": "Removes all information about the target resource."
                },
                {
                    "value": "put",
                    "description": "Replaces existing information about the target resource."
                },
                {
                    "value": "head",
                    "description": "Retrieves header information about the target resource, with no message body in the response."
                },
                {
                    "value": "mkcol",
                    "description": "Creates a new collection resource."
                },
                {
                    "value": "patch",
                    "description": "Updates existing information about the target resource."
                },
                {
                    "value": "propfind",
                    "description": "Retrieves properties defined on the target resource."
                },
                {
                    "value": "trace",
                    "description": "Creates a message loop-back test along the path to the resource."
                },
                {
                    "value": "post",
                    "description": "Sends information to the server."
                },
                {
                    "value": "get",
                    "description": "Retrieves information about the target resource."
                },
                {
                    "value": "options",
                    "description": "Describes communication methods for the target resource."
                },
                {
                    "value": "lock",
                    "description": "Prevents the use of other methods on the target resource."
                },
                {
                    "value": "copy",
                    "description": "Duplicates the target resource."
                },
                {
                    "value": "connect",
                    "description": "Creates a tunnel to the server."
                }
            ],
            "required": false
        },
        {
            "name": "response_code",
            "type": "int",
            "description": "An HTTP response status code, for example, 201.",
            "required": false
        },
        {
            "name": "response_class",
            "type": "enum",
            "description": "A class of HTTP response status codes, from 0xx through 6xx.",
            "values": [
                {
                    "value": "0xx",
                    "description": "An aborted action on the client side."
                },
                {
                    "value": "1xx",
                    "description": "An informational response, like Continue."
                },
                {
                    "value": "2xx",
                    "description": "A successful response."
                },
                {
                    "value": "3xx",
                    "description": "Success, but a redirect where the thing you want is somewhere else."
                },
                {
                    "value": "4xx",
                    "description": "Error, where there's some problem with the client request."
                },
                {
                    "value": "5xx",
                    "description": "Error, where there's some problem with how the API server responded to the client request."
                },
                {
                    "value": "6xx",
                    "description": "Invalid headers (defined by Akamai)."
                }
            ],
            "required": false
        },
        {
            "name": "endpoint_id",
            "type": "int",
            "description": "The ID of an API configuration registered with Akamai.",
            "required": false
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 90,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-reports-executor-api/v1/reports/endpoint-usage-by-time/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-reports-executor-api/v1/reports/endpoint-usage-by-time/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-reports-executor-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-reports-executor-api/v1/reports/endpoint-usage-by-time/versions/1/report-data"
        }
    ]
}