purge-usage-by-timeandresponse

The following shows how to generate the purge-usage-by-timeandresponse 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

Details of purge requests by time and response code.

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: account_id

Data available for: 45 days

Required products: EDGECONTROL

Available metrics

MetricDescription
Data metrics
requestCountTotal traffic by segments.

Available filters

FilterTypeDescription
Required filters
contract_typeStringA contract type ID a given user has access to.
Optional filters
client_idStringClient Id.
client_nameStringClient name.
client_ownerStringClient owner.
environmentEnumerationEnvironment.
STAGING: Staging.
PRODUCTION: Production.
request_actionEnumerationRequest action.
invalidate: Invalidate.
delete: Delete.
request_sourceEnumerationRequest source.
EDGEGRID: Edgegrid.
PORTAL: Portal.
request_typeEnumerationRequest type.
CPCODE: CP code
VCD: VCD
ARL: ARL
TAG: TAG
URL: URL
response_classEnumerationA 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_codeStringAn HTTP response status code, for example, 201.
response_statusEnumerationAn indicator of whether the HTTP response resulted in success or an error.
success: Successful HTTP response status.
error: Error HTTP response status.

POST request

POST /reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2/report-data{?start,end,interval}

Sample: /reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2/report-data?start=2023-06-27T13%3A55%3A00Z&end=2023-06-27T14%3A15%3A00Z&interval=FIVE_MINUTES

For other granularity, you need to adjust start and end dates:

Sample with longer interval: /reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2/report-data?start=2023-02-01&end=2023-06-01&interval=MONTH

Query parameters

ParameterTypeSampleDescription
Required
startString2023-06-27T13:55:00ZSpecifies 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.
endString2023-06-27T14:15:00ZSpecifies 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.
intervalEnumerationFIVE_MINUTESThe duration of each data record. Available values: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.

JSON request members

MemberTypeDescription
objectIdsArraySpecifies the account_id value you want to report on.
metricsArrayThe set of desired metrics. If omitted, the report includes all available metrics.
filtersMap of ArraysSpecifies a set of custom filters, with each filter's name keying an array with each filter's set of values.

Request body:

{
    "objectIds": [
        "1-123A"
    ],
    "metrics": [
        "requestCount"
    ],
    "filters": {
        "client_id": [
            "client1",
            "client3"
        ],
        "client_name": [
            "name5",
            "name3"
        ],
        "client_owner": [
            "owner3",
            "owner1"
        ],
        "contract_type": [
            "1-3CV382"
        ],
        "environment": [
            "STAGING",
            "PRODUCTION"
        ],
        "request_action": [
            "invalidate",
            "delete"
        ],
        "request_source": [
            "PORTAL",
            "EDGEGRID"
        ],
        "request_type": [
            "VCD",
            "ARL"
        ],
        "response_class": [
            "2xx",
            "3xx"
        ],
        "response_code": [
            "403",
            "201"
        ],
        "response_status": [
            "success",
            "error"
        ]
    }
}

GET request

GET /reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2/report-data{?start,end,interval,objectIds,metrics,filters}

Sample: /reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2/report-data?start=2023-06-27T13%3A55%3A00Z&end=2023-06-27T14%3A15%3A00Z&interval=FIVE_MINUTES&objectIds=1-123A&metrics=requestCount&filters=client_id%3Dclient5%2Cclient_id%3Dclient3%2Cclient_name%3Dname3%2Cclient_name%3Dname5

Query parameters

ParameterTypeSampleDescription
Required
startString2023-06-27T13:55:00ZSpecifies 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.
endString2023-06-27T14:15:00ZSpecifies 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.
intervalEnumerationFIVE_MINUTESThe duration of each data record. Available values: MONTH, WEEK, DAY, HOUR, FIVE_MINUTES.
objectIdsString1-123ASpecifies the account_id value you want to report on.
Optional
metricsStringrequestCountSpecifies 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.
filtersStringclient_id=client5,‚Äčclient_‚Äčid=‚Äčclient3,‚Äčclient_‚Äčname=‚Äčname3,‚Äčclient_‚Äčname=‚Äčname5Specifies 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.

JSON response

Status 200 application/json

Response body:

{
    "metadata": {
        "name": "purge-usage-by-timeandresponse",
        "version": "2",
        "outputType": "HIERARCHICAL",
        "groupBy": [
            "startdatetime",
            "response_code"
        ],
        "interval": "FIVE_MINUTES",
        "start": "2023-06-27T13:55:00Z",
        "end": "2023-06-27T14:15:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [
            {
                "name": "client_id",
                "values": [
                    "client4",
                    "client5"
                ]
            },
            {
                "name": "client_name",
                "values": [
                    "name5",
                    "name1"
                ]
            },
            {
                "name": "client_owner",
                "values": [
                    "owner4",
                    "owner5"
                ]
            },
            {
                "name": "contract_type",
                "values": [
                    "1-3CV382"
                ]
            },
            {
                "name": "environment",
                "values": [
                    "STAGING",
                    "PRODUCTION"
                ]
            },
            {
                "name": "request_action",
                "values": [
                    "delete",
                    "invalidate"
                ]
            },
            {
                "name": "request_source",
                "values": [
                    "PORTAL",
                    "EDGEGRID"
                ]
            },
            {
                "name": "request_type",
                "values": [
                    "CPCODE",
                    "TAG"
                ]
            },
            {
                "name": "response_class",
                "values": [
                    "2xx",
                    "3xx"
                ]
            },
            {
                "name": "response_code",
                "values": [
                    "503",
                    "100"
                ]
            },
            {
                "name": "response_status",
                "values": [
                    "success",
                    "error"
                ]
            }
        ],
        "columns": [
            {
                "name": "groupBy",
                "label": "startdatetime"
            },
            {
                "name": "groupBy",
                "label": "response_code"
            },
            {
                "name": "requestCount",
                "label": "Requests"
            }
        ],
        "objectType": "account_id",
        "objectIds": [
            "1-123A"
        ]
    },
    "data": [
        {
            "startdatetime": "2023-06-27T13:55:00Z",
            "data": [
                {
                    "response_code": "403",
                    "requestCount": "2459"
                },
                {
                    "response_code": "503",
                    "requestCount": "2400"
                },
                {
                    "response_code": "404",
                    "requestCount": "3228"
                },
                {
                    "response_code": "201",
                    "requestCount": "4944"
                }
            ]
        },
        {
            "startdatetime": "2023-06-27T14:00:00Z",
            "data": [
                {
                    "response_code": "403",
                    "requestCount": "4639"
                },
                {
                    "response_code": "503",
                    "requestCount": "2127"
                },
                {
                    "response_code": "404",
                    "requestCount": "782"
                },
                {
                    "response_code": "201",
                    "requestCount": "3803"
                }
            ]
        },
        {
            "startdatetime": "2023-06-27T14:05:00Z",
            "data": [
                {
                    "response_code": "403",
                    "requestCount": "1755"
                },
                {
                    "response_code": "503",
                    "requestCount": "4796"
                },
                {
                    "response_code": "404",
                    "requestCount": "3829"
                },
                {
                    "response_code": "201",
                    "requestCount": "1408"
                }
            ]
        },
        {
            "startdatetime": "2023-06-27T14:10:00Z",
            "data": [
                {
                    "response_code": "403",
                    "requestCount": "214"
                },
                {
                    "response_code": "503",
                    "requestCount": "3425"
                },
                {
                    "response_code": "404",
                    "requestCount": "4966"
                },
                {
                    "response_code": "201",
                    "requestCount": "4167"
                }
            ]
        }
    ],
    "summaryStatistics": {}
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,purge-usage-by-timeandresponse
version,2
source,purge-usage-by-timeandresponse/versions/2
groupBy,startdatetime,response_code
start,2023-06-27T13:55:00Z
end,2023-06-27T14:15:00Z
interval,`FIVE_MINUTES`
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,account_id
objectIds,1-123A
client_id,client4,client5
client_name,name5,name1
client_owner,owner4,owner5
contract_type,1-3CV382
environment,STAGING,PRODUCTION
request_action,delete,invalidate
request_source,PORTAL,EDGEGRID
request_type,CPCODE,TAG
response_class,2xx,3xx
response_code,503,100
response_status,success,error
#METADATA_END

#SUMMARYSTATISTICS_START

#SUMMARYSTATISTICS_END

#COLUMNS_START
startdatetime,response_code,requestCount
#COLUMNS_END

#DATA_START
2023-06-27T13:55:00Z,403,2459
2023-06-27T13:55:00Z,503,2400
2023-06-27T13:55:00Z,404,3228
2023-06-27T13:55:00Z,201,4944
2023-06-27T14:00:00Z,403,4639
2023-06-27T14:00:00Z,503,2127
2023-06-27T14:00:00Z,404,782
2023-06-27T14:00:00Z,201,3803
2023-06-27T14:05:00Z,403,1755
2023-06-27T14:05:00Z,503,4796
2023-06-27T14:05:00Z,404,3829
2023-06-27T14:05:00Z,201,1408
2023-06-27T14:10:00Z,403,214
2023-06-27T14:10:00Z,503,3425
2023-06-27T14:10:00Z,404,4966
2023-06-27T14:10:00Z,201,4167
#DATA_END

Get report details

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

GET /reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2

Status 200 application/json

Response body:

{
    "name": "purge-usage-by-timeandresponse",
    "description": "Details of purge requests by time and response code.",
    "businessObjectName": "account_id",
    "version": 2,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": true,
    "supportsPagination": false,
    "outputType": "HIERARCHICAL",
    "requiredProducts": [
        "EDGECONTROL"
    ],
    "requiredRoles": [
        "IDM: API Clients - Admin Access"
    ],
    "available": true,
    "metrics": [
        {
            "name": "requestCount",
            "description": "Total traffic by segments.",
            "label": "Requests",
            "unit": "COUNT",
            "summaryStatistic": false
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "groupBy": [
        "startdatetime",
        "response_code"
    ],
    "filters": [
        {
            "name": "client_owner",
            "type": "string",
            "description": "Client owner.",
            "required": false
        },
        {
            "name": "response_code",
            "type": "string",
            "description": "An HTTP response status code, for example, 201.",
            "required": false
        },
        {
            "name": "environment",
            "type": "enum",
            "description": "Environment.",
            "values": [
                {
                    "value": "STAGING",
                    "description": "Staging."
                },
                {
                    "value": "PRODUCTION",
                    "description": "Production."
                }
            ],
            "required": false
        },
        {
            "name": "response_status",
            "type": "enum",
            "description": "An indicator of whether the HTTP response resulted in success or an error.",
            "values": [
                {
                    "value": "success",
                    "description": "Successful HTTP response status."
                },
                {
                    "value": "error",
                    "description": "Error HTTP response status."
                }
            ],
            "required": false
        },
        {
            "name": "contract_type",
            "type": "string",
            "description": "A contract type ID a given user has access to.",
            "required": true
        },
        {
            "name": "client_id",
            "type": "string",
            "description": "Client Id.",
            "required": false
        },
        {
            "name": "request_action",
            "type": "enum",
            "description": "Request action.",
            "values": [
                {
                    "value": "invalidate",
                    "description": "Invalidate."
                },
                {
                    "value": "delete",
                    "description": "Delete."
                }
            ],
            "required": false
        },
        {
            "name": "request_source",
            "type": "enum",
            "description": "Request source.",
            "values": [
                {
                    "value": "EDGEGRID",
                    "description": "Edgegrid."
                },
                {
                    "value": "PORTAL",
                    "description": "Portal."
                }
            ],
            "required": false
        },
        {
            "name": "client_name",
            "type": "string",
            "description": "Client name.",
            "required": false
        },
        {
            "name": "request_type",
            "type": "enum",
            "description": "Request type.",
            "values": [
                {
                    "value": "CPCODE",
                    "description": "CP code"
                },
                {
                    "value": "VCD",
                    "description": "VCD"
                },
                {
                    "value": "ARL",
                    "description": "ARL"
                },
                {
                    "value": "TAG",
                    "description": "TAG"
                },
                {
                    "value": "URL",
                    "description": "URL"
                }
            ],
            "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
        }
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY",
        "HOUR",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 45,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/purge-usage-by-timeandresponse/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/purge-usage-by-timeandresponse/versions/2/report-data"
        }
    ]
}