QueryRealTimeBandwidthForMultiDomain

갱신 시간: 2024-04-23 17:36:11

Query the minute-level edge bandwidth of multiple domains

  • 데이터 지연: 5-10min
  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): APM,Bot Shield,Flood Shield,Content Acceleration,Dynamic Web Acceleration,Media Acceleration-Live,Low Latency Streaming,Media Acceleration,Cloud Live,Cloud VoD,Flood Shield 2.0

요청 파라미터

Body 파라미터

파라미터 이름설명
dateFromString
Start time: 1.Start time: time format is yyyy-MM-ddTHH:mm:ss+08:00, for example, 2016-12-02T10:00:00+08:00 (December 2rd, 2016, 10:00 a.m., Beijing Time); 2.Not greater than the current time; 3.The most recent half-year (183 days) data can be obtained
dateToString
End time: 1.The time format is 2016-12-02T10:00:00+08:00 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 1 hours will be queried by default; if one field is filled and one is left empty, then exception will occur. 4.Maximum time range allowable for query: The default value is 1 hour, that is, the difference between dateFrom and dateTo cannot exceed 1 hour (you can contact technical support to adjust it, the maximum is 31 days)
dataIntervalString
Data granularity: 1. Support 1m (1 minute granularity),5m (5 minutes granularity) 2. The default value is 1m
*domainList
Domain: 1.The default upper limit of domains that can be entered is 20 (if you want to adjust, please, contact technical support); 2.Automatically filter out illegal domains (illegal domains will be filtered out, the query results only return the data of legitimate domains)
groupByString
The optional value of the grouping dimension is domain; if it is passed in, detailed data will be displayed according to this dimension;

응답 파라미터

Body 파라미터

파라미터 이름설명
codeString
request result status code
messageString
request result information
dataList
domainString
Domain name. If you do not select domain name group Dimension, this field is a semicolon-separated string of all domain names.
peakValueString
Peak Bandwidth,unit is Mbps,example(9811.21Mbps)
peakTimeString
Time of peak bandwidth,example(2019-02-13 18:01)
totalString
Edge total traffic,example(74099.91MB)
bandwidthDataList
timestampString
Time: 1. When the data query granularity is 1m, then the format is yyyy-MM-dd HH:mm; Each time slice value represents the value within the previous time granularity range. The first time slice of the day is yyyy-MM-dd 00:01, and the last one is (yyyy-MM-dd+1) 00:00; 2. Return the time slices that contained in start time and in end time.
valueString
Edge bandwidth,the unit is Mbps,keep 2 decimal places

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
24102014This operation requires a body. Ensure that the body is present and the Content-Type header is set.400This operation requires a body. Ensure that the body is present and the Content-Type header is set.
24102013The accept header specified in your request is not acceptable.400The accept header specified in your request is not acceptable.
24102002There was an error in the body of your HTTP request.400There was an error in the body of your HTTP request.
24102006The date specified is invalid.400The date specified is invalid.
24102007You cannot specify a period greater than xx minute(s).400You cannot specify a period greater than xx minute(s).
24102021Date format error400Date format error
24102008param:domain is null or invalid.400param:domain is null or invalid.
24102008param:dataInterval is null or invalid.400param:dataInterval is null or invalid.
24102008param:groupBy is null or invalid.400param:groupBy is null or invalid.
24102019The request was rejected because the number of Domain(xx) exceeds the limit (xx).400The request was rejected because the number of Domain(xx) exceeds the limit (xx).
24102500We encountered an internal error. Please try again.500We encountered an internal error. Please try again.

예제

JSON
JSON
요청 예제
복사 복사 완료
#!/bin/bash
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/bandwidth/multi-domain/real-time/edge" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '
 
{
"dateFrom": "2019-01-01T10:00:00+08:00",
"dateTo": "2019-01-01T11:00:00+08:00",
"domain": ["www.baidu1.com","www.baidu2.com"],
"dataInterval": "1m",
"groupBy":"domain"}'
응답 예제
복사 복사 완료
{
    "code":"0",
    "message":"success",
    "data":[
        {
            "domain":"www.aaa.com",
            "peakValue":"1200.00",
            "peakTime":"2019-11-20 17:00",
            "total":"62000.00",
            "bandwidthData":[
                {
                    "timestamp":"2019-11-20 18:00",
                    "value":"52.42"
                },
                {
                    "timestamp":"2019-11-20 19:50",
                    "value":"5.39"
                }
            ]
        },
        {
            "domain":"www.bbb.com",
            "peakValue":"1200.00",
            "peakTime":"2019-11-20 16:00",
            "total":"62000.00",
            "bandwidthData":[
                {
                    "timestamp":"2019-11-20 18:00",
                    "value":"5.39"
                },
                {
                    "timestamp":"2019-11-20 19:50",
                    "value":"5.39"
                }
            ]
        }
    ]
}
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.