Query minute-level data of edge status codes. Users can specify the start time, end time, and domain name to query the request count data corresponding to the status codes. The data granularity can be selected as either 1 minute or 5 minutes in the request. The return result includes the number of requests per minute for each status code.
| パラメータ名 | 説明 |
|---|---|
dateFromString | Start time:
|
dateToString | End time:
|
*domainList | Domain:
|
dataIntervalString | Data granularity:
|
| パラメータ名 | 説明 |
|---|---|
resultList | result |
statusCodeDataList | statusCodeData |
statusCodeString | Status code |
requestDataList | requestData |
timestampString | DateTime, the format is yyyy-MM-dd HH:mm; the data value of every time slice represents the data value within the previous time granularity range. |
valueString | Number of requests for status codes |
| エラーコード(code) | 説明(message) | HTTPステータスコード | 意味 |
|---|---|---|---|
| MissingBody | The request body was not delivered | 400 | The request body was not delivered |
| NotAcceptable | The Accept request header does not support it. The API only supports json and xml formats. The default format is json | 400 | The Accept request header does not support it. The API only supports json and xml formats. The default format is json |
| InvalidHTTPRequest | Request body format error | 400 | Request body format error |
| InvalidDatePeriod | The dateFrom or dateTo does not conform to the specification | 400 | The dateFrom or dateTo does not conform to the specification |
| DateSpanError | More than 60 minutes (1 hour) between dateFrom and dateTo | 400 | More than 60 minutes (1 hour) between dateFrom and dateTo |
| PARAM_INVALID | Parameter domain does not conform to specification | 400 | Parameter domain does not conform to specification |
| NumberLimitExceeded | Number of domains passed exceeds account limit | 400 | Number of domains passed exceeds account limit |
| PARAM_INVALID | Parameter dataInterval does not conform to specification | 400 | Parameter dataInterval does not conform to specification |
| InternalError | We encountered an internal error. Please try again. | 500 | We encountered an internal error. Please try again. |
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/api/report/status-code/real-time/edge" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/xml" \
-d '{"dateFrom": "2019-01-01T10:00:00+00:00","dateTo": "2019-01-01T11:00:00+00:00","domain": ["www.baidu1.com","www.baidu2.com"],"dataInterval": "5m"
}'<?xml version="1.0" encoding="UTF-8"?>
<report>
<result>
<report>
<status-code-data>
<status-code-request-data>
<status-code>100</status-code>
<request-data>
<detail>
<timestamp>2019-02-21 00:00</timestamp>
<value>10000</value>
</detail>
<detail>
<timestamp>2019-02-21 00:05</timestamp>
<value>10000</value>
</detail>
</request-data>
</status-code-request-data>
<status-code-request-data>
<status-code>200</status-code>
<request-data>
<detail>
<timestamp>2019-02-21 00:05</timestamp>
<value>30000</value>
</detail>
<detail>
<timestamp>2019-02-21 00:15</timestamp>
<value>10000</value>
</detail>
</request-data>
</status-code-request-data>
<status-code-request-data>
<status-code>300</status-code>
<request-data>
<detail>
<timestamp>2019-02-21 00:15</timestamp>
<value>10000</value>
</detail>
</request-data>
</status-code-request-data>
<status-code-request-data>
<status-code>400</status-code>
<request-data>
<detail>
<timestamp>2019-02-21 00:10</timestamp>
<value>30000</value>
</detail>
</request-data>
</status-code-request-data>
<status-code-request-data>
<status-code>500</status-code>
<request-data>
<detail>
<timestamp>2019-02-21 00:05</timestamp>
<value>10000</value>
</detail>
<detail>
<timestamp>2019-02-21 00:10</timestamp>
<value>10000</value>
</detail>
</request-data>
</status-code-request-data>
</status-code-data>
</report>
</result>
</report>