universal
This interface is used to count the number of requests for a specified transport protocol on edge nodes for multiple domain names. Users need to provide a query time range and a domain name list, and select a protocol type. The returned content includes the number of requests for each domain name with a specified protocol. This interface helps users monitor and analyze traffic under different transport protocols to optimize network performance and improve service quality.
Single user trigger frequency: 2000/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.Must be a time that is 183 days earlier than the current time, and the time must be earlier than the current time and dateTo;
3.Period between dataFrom and dateTo cannot be longer than 7 days(technical support can be contacted to adjust);
4.dateFrom and dateTo can be either both are specified or neither is specifies;
5.If neither dateFrom nor dateTo is specified, then by default, data in the last 24 hour is 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.Must be greater than dateFrom;
3.If it's greater than the current time, then the current time is assigned as the value; |
*domainList | Domain names, domain number limits can be adjusted depending on different accounts. The default value is 20 |
*dataIntervalString | Data granularity: 1m , 5m, support 5m |
*protocolTypeString | Transmission protocol
1.Options: http, https;
2.https is used as the default value is no value specified;
3.httpRequestData is displayed if http is queried, and httpsRequestData is displayed if https is queried; |
*groupByList | Group dimension
1.The value can be selected is domain;
2.The data is displayed according to the specified dimension; |
| Name | Description |
|---|---|
resultList | |
domainString | Domain |
httpsRequestDataList | |
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 | Total number of requests |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| 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 |
| MissingBody | Request body has not specified | 400 | Request body has not specified |
| 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 7 days | 400 | Period between dataFrom and dateTo is longer than 7 days |
| NumberLimitExceeded | Number of queried domains exceeds limits set to the account | 400 | Number of queried domains exceeds limits set to the account |
| PARAM_INVALID | Parameter groupBy not compliant to specifications | 400 | Parameter groupBy not compliant to specifications |
| InternalError | System has encountered an error | 500 | System has encountered an error |
| PARAM_INVALID | param: domain is null or invalid. | 400 | param: domain is null or invalid. |
| PARAM_INVALID | param: dataInterval is null or invalid. | 400 | param: dataInterval is null or invalid. |
| PARAM_INVALID | param: protocolType is null or invalid. | 400 | param: protocolType is null or invalid. |
#!/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/request/protocol" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
"dateFrom":"2017-09-20T16:52:16+00:00",
"dateTo":"2017-09-20T16:52:16+00:00",
"domain":[
"test.com"
],
"dataInterval":"5m",
"protocolType":"https",
"groupBy":[
"domain"
]
}'{
"result":[
{
"domain":"test.com",
"httpsRequestData":[
{
"timestamp":"2017-07-10 00:00",
"value":"100"
},
{
"timestamp":"2017-07-10 00:05",
"value":"200"
},
{
"timestamp":"2017-07-10 23:55",
"value":"100"
}
]
}
]
}