universal
This interface is used to query the traffic, number of requests and peak bandwidth corresponding to multiple domain names under the dynamic acceleration product. Users provide the query time range and domain name, and the interface returns the total traffic, total number of requests, bandwidth peak and detailed data for each time slice of the domain name. It helps users analyze the traffic pattern of the website and identify the peak period, thereby optimizing bandwidth resource allocation and improving site performance.
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*dateFromString | Start time:
1. The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM;
2. No bigger than the current time.
3. Data in the last 183 days at most can be queried. |
*dateToString | End time:
1. The time format is yyyy-MM-ddTHH:mm:ss±HH:mm. Please note: ±HH:mm is the time zone offset, which can be adjusted according to your data needs, for example, +00:00 represents UTC time, +08:00 represents East 8th District, and -05:00 represents West 5th District. 2024-01-15T10:30:45+00:00 means UTC time January 15, 2024 10:30:45 AM
2. End time should be greater than start time. If the end time is greater than current time, current time will be used.
3. If both fields of dataFrom and dateTo are left empty, then data in the last 24 hours will be queried by default; if only one field is filled in and one is left empty, then exception will be occur.
4. Allowable maximum time range for query: 1 day, means the period between dateFrom to dateTo should not exceed 1 day (can be adjusted by contacting technical support up to 31 days). |
*domainList | Domain name:
1. The default upper limit to domains that can be entered is 200 (can be adjusted by contacting technical support);
2. All domains under the account are queried if this input parameter is not specified, but if the number of domains under the account exceeds limits, no query will be done (Error). |
*groupByList | Group keywords:
1. By default, group data will be displayed;
2. If there are keywords entered, value details shall be displayed by keywords;
If domain is specified to groupBy, it means results are returned according to domains.
3. Only domain can be specified. |
| Name | Description |
|---|---|
resultList | |
domainString | Domain |
totalFlowString | totalFlow, unit :MB, 2 decimal places reserved, example (74099.92) |
totalRequestString | totalRequest |
peakBandwidthString | peakBandwidth, unit :Mbps, 2 decimal places reserved, example (74099.92) |
peakTimeString | peakTime |
peakRequestString | Peak request |
peakRequestTimeString | Peak time of request |
flowRequestDataList | |
timestampString | timestamp:
1. When the data granularity of query is 5m, the format is yyyy-mm-dd HH: MM;Each time slice data value represents the data value in the previous time granularity range.The time slice at the beginning of the day is yyyy-mm-dd 00:05, and the last time slice is (yyyy-mm-dd +1) 00:00.
2. Return the time slice of start time and end time. |
flowString | flow |
bandwidthString | Bandwidth, unit: Mbps, 2 decimal places reserved, example (931556.21) |
requestString | request |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| MissingBody | Request body has not specified | 400 | Request body has not specified |
| NotAcceptable | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format | 400 | Accept as request header is not supported, as interface only supports json and xml formats, with json as the default format |
| InvalidHTTPRequest | Incorrect format of request body | 400 | Incorrect format of request body |
| InvalidDatePeriod | dataFrom or dateTo not compliant to specifications | 400 | dataFrom or dateTo not compliant to specifications |
| DateSpanError | Period between dataFrom and dateTo is longer than 30 minutes | 400 | Period between dataFrom and dateTo is longer than 30 minutes |
| PARAM_INVALID | Parameter of domain not compliant to specifications | 400 | Parameter of domain not compliant to specifications |
| NumberLimitExceeded | Number of queried domains exceeds limits set to the account | 400 | Number of queried domains exceeds limits set to the account |
| InternalError | System has encountered an error | 500 | System has encountered an error |
| PARAM_INVALID | DataPadding not compliant to specifications | 400 | DataPadding not compliant to specifications |
#!/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.atomile.com/api/report/flow-request/dwa" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/xml" \
-d '{"dateFrom": "2020-09-06T10:00:00+00:00","dateTo": "2020-09-06T01:00:00+00:00","domain": ["www.aaa.com","www.bbb.com","www.ccc.com"],"dataInterval": "5m","groupBy": ["domain"],"dataPadding":true
}'<?xml version="1.0" encoding="UTF-8"?>
<report>
<result>
<data>
<domain>www.aaa.com</domain>
<total-flow>780.00</total-flow>
<total-request>100</total-request>
<peak-bandwidth>3.20</peak-bandwidth>
<peak-request>100</peak-request>
<peak-request-time>2020-09-06 00:05</peak-request-time>
<peak-time>2020-09-06 01:00</peak-time>
<flow-request-data>
<detail>
<timestamp>2020-09-06 00:00</timestamp>
<bandwidth>0.00</bandwidth>
<flow>0.00</flow>
<request>0</request>
</detail>
<detail>
<timestamp>2020-09-06 00:05</timestamp>
<bandwidth>0.27</bandwidth>
<flow>10.00</flow>
<request>100</request>
</detail>
<detail>
<timestamp>2020-09-06 00:10</timestamp>
<bandwidth>0.53</bandwidth>
<flow>20.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:15</timestamp>
<bandwidth>0.80</bandwidth>
<flow>30.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:20</timestamp>
<bandwidth>1.07</bandwidth>
<flow>40.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:25</timestamp>
<bandwidth>1.33</bandwidth>
<flow>50.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:30</timestamp>
<bandwidth>1.60</bandwidth>
<flow>60.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:35</timestamp>
<bandwidth>1.87</bandwidth>
<flow>70.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:40</timestamp>
<bandwidth>2.13</bandwidth>
<flow>80.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:45</timestamp>
<bandwidth>2.40</bandwidth>
<flow>90.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:50</timestamp>
<bandwidth>2.67</bandwidth>
<flow>100.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 00:55</timestamp>
<bandwidth>2.93</bandwidth>
<flow>110.00</flow>
</detail>
<detail>
<timestamp>2020-09-06 01:00</timestamp>
<bandwidth>3.20</bandwidth>
<flow>120.00</flow>
</detail>
</flow-request-data>
</data>
</result>
</report>