QueryTrafficBySpecificProtocol

갱신 시간: 2024-11-26 15:55:22

This API is used to query the Traffic data of multiple domain under the specified transmission protocol. The query is for the data of all Edge node. The user needs to specify the domain, start and end time, transmission protocol and other parameters, and can select the data granularity and grouping dimension. By default, the query will return the Traffic data of the HTTPS protocol, and the output result is the Traffic value of each domain at different time points. This interface is suitable for scenarios where you need to query and analyze the Traffic of multiple domain with different transmission protocols.

  • 데이터 지연: 5~15min
  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): Content Acceleration,Bot Shield,Dynamic Web Acceleration,Flood Shield,Media Acceleration Live Broadcast,Web Application Firewall,Media Acceleration,Media Acceleration-Live,Flood Shield 2.0

요청 파라미터

Body 파라미터

파라미터 이름설명
dateFromString
Start time: 1.The format is yyyy-MM-ddTHH:mm:ss+08:00; 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 format is yyyy-MM-ddTHH:mm:ss+08:00; 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: Support for 1m(1 minutes), 5m (5 minutes), 1h (1 hour), 1d (1 day)
protocolTypeString
Transmission protocol: 1.Options: http, https; 2.https is used as the default value is no value specified; 3.httpFlowData is displayed if http is queried, and httpsFlowData 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;

응답 파라미터

Body 파라미터

파라미터 이름설명
resultList
result
domainString
Domain
httpsFlowDataList
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. The first time slice of the day is yyyy-MM-dd 12:05 AM, and the last one is (yyyy-MM-dd+1) 00:00.
valueString
Traffic unit is MB and 2 digits of decimals allowed

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
NotAcceptableThe   accept header specified in your request is not acceptable.400Accept as request header is not   supported, as interface only supports json and xml formats, with json as the   default format
MissingBodyThis   operation requires a body. Ensure that the body is present and the   Content-Type header is set.400Request body has not specified
InvalidHTTPRequestThere   was an error in the body of your HTTP request.400Incorrect format of request body
InvalidDatePeriodThe   date specified is invalid.400dataFrom or dateTo not compliant   to specifications
DateSpanErrorYou   cannot specify a period greater than 7.400Period between dataFrom and   dateTo is longer than 7 days
NumberLimitExceededThe   request was rejected because the number of domain({actual}) exceeds the limit   ({expect}).400Number of queried domains exceeds   limits set to the account
PARAM_INVALIDparam:   groupBy is null or invalid.400Parameter groupBy not compliant   to specifications
InternalErrorWe   encountered an internal error. Please try again.500System has encountered an error
PARAM_INVALIDparam: domain is null or invalid.400Parameter domain does not comply with the specification
PARAM_INVALIDparam: dataInterval is null or invalid.400Parameter dataInterval does not comply with the specification
PARAM_INVALIDparam: protocolType is null or invalid.400Parameter protocolType does not comply with the specification

예제

JSON
XML
JSON
요청 예제
복사 복사 완료
#!/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/flow/protocol" \
-X "POST" \
-H "X-Time-Zone:GMT+08:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
    "dateFrom":"2017-07-05T00:00:00+08:00",
    "dateTo":"2017-07-05T23:00:00+08:00",
    "domain":[
        "test.com"
    ],
    "dataInterval":"5m",
    "protocolType":"https",
    "groupBy":[
        "domain"
    ]
}'
응답 예제
복사 복사 완료
{
      "result":[
          {
                "domain":"test.com",
              "httpsFlowData":[
                  {
                        "timestamp":"2017-07-05 00:00",
                      "value":"0.00"
                  },
                  {
                        "timestamp":"2017-07-05 00:05",
                        "value":"0.00"
                  }
              ]
          }
      ]
  }
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.