Create a report (POST /v1/reports)

Creates a statistics report.

Upon successful completion, the Location response header will return the URL of the report including the report ID. Details can then be retrieved by specifying the report ID in the report retrieval API. It usually takes a few minutes to create a report.

The report ID is automatically deleted one hour after creation of a report is completed.

If you try to create a number of reports that exceeds the normal usage limit, the status code 429 may be returned.

The table below lists the main status codes and X-Message header values.

Status code X-Message
202 Accepted: Request was received
400 Invalid entry for granularity/start_date/end_date/delivery_option/metrics/service_id: Invalid value
400 Invalid entry for service_id/per_region combination: Illegal combination
429 Rate limit exceeded: Too many requests. Wait for a few moments, and then execute again

Request Headers

Refer to "Common API request headers".

Request Parameters

granularity

Granularity in which to group the report data:
  • daily: Group the report data by day
  • hourly: Group the report data by hour (hh:00 to hh:59)
Data Type Cardinality
String 1..1

start_date

Start date (UTC). The specified date can be up to 60 days before the current date

Example: 20151201

Data Type Cardinality
String 1..1

end_date

End date (UTC). If omitted, the current date will be used.

A date earlier than start_date cannot be specified.

If the granularity is "daily", the specified end_date can be up to 31 days after start_date (for example, if start_date is Jan 1, and end_date is Feb 1, 31 days of data will be returned).

If the granularity is "hourly", the specified end_date can be up to 14 days after start_date.

Data Type Cardinality
String 0..1

delivery_option

Protocol scheme to use for aggregation
  • http: Limited to HTTP access
  • ssl: Limited to HTTPS access
  • all: Combined (default)
Data Type Cardinality
String 0..1

metrics

Comma-delimited expression of metrics to output in the report:

  • IncompleteDownloadCount: Count of incomplete downloads
  • 200Count: Count of responses with status code 200
  • 206Count: Count of responses with status code 206
  • 2XXCount: Count of responses with status code 2XX combined with the count of incomplete downloads
  • 302Count: Count of responses with status code 302
  • 304Count: Count of responses with status code 304
  • 3XXCount: Count of responses with status code 3XX
  • 404Count: Count of responses with status code 404
  • 4XXCount: Count of responses with status code 4XX
  • 5XXCount: Count of responses with status code 5XX
  • RequestCount: Count of requests from end user to edge server
  • TotalBytes: Amount of data transferred from the edge server to the end user (in MB)
  • IngressBytes: Amount of data transferred from the origin server to the edge server (in bytes)
  • IngressCount: Count of requests made to the origin server by the edge server
  • IngressRequestBytes: Amount of data transferred from the edge server to the origin server (in bytes)
  • OffloadHitRatio: Proportion of offloads performed by the origin server using the edge server. Cache hit rate.

Data Type Cardinality
String 1..1

per_region

Whether to output in each region or not
  • true: Outputs by region

    If per_region is specified, the granularity can be "daily".

    If per_region is specified, the metrics cannot include IngressBytes, IngressCount, IngressRequestBytes, or OffloadHitRatio.

  • false: Combined (default)
Data Type Cardinality
String 0..1

service_id

service_id. If omitted, all services are specified.

If per_region is specified, the granularity can be "daily".

If service_id is specified, the metrics cannot include IngressBytes, IngressCount, IngressRequestBytes, or OffloadHitRatio.

Data Type Cardinality
String 0..1

Request Elements

None.

Response Headers

Refer to "Common API response headers".

Location

URL including report ID

Data Type Cardinality
String 1..1

Response Elements

None.

Example of Response


 When report creation is successful:
  POST /v1/ reports?granularity=daily&start_date=20160812&end_date=20160814&delivery_option=all&metrics= 200Count,RequestCount&service_id=65a455b0-475a-42fd-b98e-75b396032bff&per_region=true
       
  HTTP/1.1 202 Accepted
  X-Message: Accepted
  Location: http://<Endpoint>/v1/reports/96b6c7a9-1f75-4b37-88de-9a6626a13f1c
  Content-Length: 0
        
 When report creation fails due to rate limit issues:
  POST ...
       
  HTTP/1.1 429
  X-Message: Rate limit exceeded
  Content-Length: 0