hits-by-ip report
The following shows how to generate the
hits-by-ip
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
Hits returned by IP.
Business object: cpcode
Data available for: 92 days
Required products: Kona Site Defender, Download Delivery, OTA Updates, Web Application Protector, Wholesale Delivery, Adaptive Media Delivery, Dynamic Site Accelerator, Ion, Dynamic Site Delivery, Object Delivery, or Kona DDoS Defender
Available metrics
Metric | Description | |
---|---|---|
Data metrics | ||
successfulHits |
The number of requests returning successful responses. |
Sample report
POST /reporting-api/v1/reports/hits-by-ip/versions/1/report-data{?start,end}
Sample: /reporting-api/v1/reports/hits-by-ip/versions/1/report-data?start=2020-05-01T00%3A00%3A00Z&end=2020-06-01T00%3A00%3A00Z
Object type: Query
Download schema: report-request-schema.json
Query parameters
Parameter | Type | Sample | Description |
---|---|---|---|
Required | |||
start |
String | 2020-05-01T00:00: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-01T00: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. |
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. |
Request body:
{
"objectIds": [
"55232",
"23433",
"32433"
],
"metrics": [
"successfulHits"
]
}
GET /reporting-api/v1/reports/hits-by-ip/versions/1/report-data{?start,end,objectIds,allObjectIds,metrics}
Sample: /reporting-api/v1/reports/hits-by-ip/versions/1/report-data?start=2020-05-01T00%3A00%3A00Z&end=2020-06-01T00%3A00%3A00Z&objectIds=55232,23433,32433&metrics=successfulHits
Query parameters
Parameter | Type | Sample | Description |
---|---|---|---|
Required | |||
start |
String | 2020-05-01T00: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. |
end |
String | 2020-06-01T00:00:00Z |
Specifies if unavailable reports should be shown. |
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 | successfulHits |
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. |
Status 200
application/json
Object type: Report
Download schema: report-response-schema.json
Response body:
{
"metadata": {
"name": "hits-by-ip",
"version": "1",
"outputType": "FLAT",
"groupBy": [
"client_ip"
],
"start": "2020-05-01T00:00:00Z",
"end": "2020-06-01T00:00:00Z",
"availableDataEnds": null,
"suggestedRetryTime": null,
"rowCount": 4,
"filters": [],
"columns": [
{
"name": "groupBy",
"label": "client_ip"
},
{
"name": "successfulHits",
"label": "Successful Hits "
}
],
"objectType": "cpcode",
"objectIds": [
"55232",
"23433",
"32433"
]
},
"data": [
{
"client_ip": "250.250.250.250",
"successfulHits": "1583"
},
{
"client_ip": "250.250.250.251",
"successfulHits": "4530"
},
{
"client_ip": "Other",
"successfulHits": "4377"
},
{
"client_ip": "250.250.250.253",
"successfulHits": "3758"
}
],
"summaryStatistics": {}
}
Status 200
text/csv
Response Body:
#METADATA_START
name,hits-by-ip
version,1
source,hits-by-ip/versions/1
groupBy,client_ip
start,2020-05-01T00:00:00Z
end,2020-06-01T00:00:00Z
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,cpcode
objectIds,55232,23433,32433
#METADATA_END
#SUMMARYSTATISTICS_START
#SUMMARYSTATISTICS_END
#COLUMNS_START
client_ip,successfulHits
#COLUMNS_END
#DATA_START
250.250.250.250,1583
250.250.250.251,4530
Other,4377
250.250.250.253,3758
#DATA_END
Get report details
This sample
Get a report type
operation gets the same information you need to run the
hits-by-ip
report as provided in this reference documentation,
but available dynamically to your API client application.
GET /reporting-api/v1/reports/hits-by-ip/versions/1
Status 200
application/json
Object type: ReportType
Download schema: data-row-schema.json
Response body:
{
"name": "hits-by-ip",
"description": "Hits returned by IP.",
"businessObjectName": "cpcode",
"version": 1,
"status": "PUBLISHED",
"deprecated": false,
"timeBased": false,
"outputType": "FLAT",
"requiredProducts": [
"Kona Site Defender",
"Download Delivery",
"OTA Updates",
"Web Application Protector",
"Wholesale Delivery",
"Adaptive Media Delivery",
"Dynamic Site Accelerator",
"Ion",
"Dynamic Site Delivery",
"Object Delivery",
"Kona DDoS Defender"
],
"requiredRoles": [
"Reports - All privileges",
"Reports - View only",
"OTA App User"
],
"available": true,
"metrics": [
{
"name": "successfulHits",
"description": "The number of requests returning successful responses.",
"label": "Successful Hits ",
"unit": "COUNT",
"summaryStatistic": false
}
],
"groupOutlyingValues": {
"enabled": false
},
"groupBy": [
"client_ip"
],
"intervals": [
"MONTH",
"WEEK",
"DAY"
],
"dataRetentionDays": 92,
"limit": 25,
"links": [
{
"rel": "self",
"href": "/reporting-reports-executor-api/v1/reports/hits-by-ip/versions/1"
},
{
"rel": "versions",
"href": "/reporting-reports-executor-api/v1/reports/hits-by-ip/versions"
},
{
"rel": "all-reports",
"href": "/reporting-reports-executor-api/v1/reports"
},
{
"rel": "execute-report",
"href": "/reporting-reports-executor-api/v1/reports/hits-by-ip/versions/1/report-data"
}
]
}