GetCdnRelayTraffic

갱신 시간: 2025-08-20 10:54:53

This API is used to query cdn relay traffic data for specified dimensions. Users can use this API to query detailed channel relay traffic reports for the corresponding customer, including output date, peak time, bandwidth peak, total traffic, etc. This is very helpful for customers to gain a direct understanding of their own relay traffic usage.

  • 단일 사용자 통화 빈도: 300/5min
  • 해당 상품(제품): Cloud VoD,Cloud Live,Media Acceleration,Low Latency Streaming,Log Download,Media Acceleration-Live,API Shield,Dynamic Web Acceleration,Edge Computing Hosting,Edge Application,Content Acceleration,CloudDNS,Media Acceleration Live Broadcast,Cloud Security 2.0,Flood Shield,Application Shield,CDN Pro,Flood Shield 2.0
API 인증에 관한 자세한 내용은 다음을 참조하십시오:API 인증 개요

요청 파라미터

Body 파라미터

파라미터 이름설명
dateFromString
Start Time 1. The time format is 'yyyy-MM-dd'. 2. Cannot exceed the current date. 3. Up to the past 730 days of data can be obtained.
dateToString
End time 1. The time format is 'yyyy-MM-dd'. 2. The end time must be greater than the start time. 3. If the end time greater than the current time, the current time is taken. 4. DateFrom and dateTo are both not provided, defaulting to query the current time; if only one is not provided, throw an exception. 5. Maximum query interval allowed: 30 days, that is the range between dateFrom and dateTo can not exceed 30 days.
timezoneString
1. Specify the time zone for both the query time range(dateFrom/dateTo) and the returned data. 2. Greenwich Mean Time Zone, the default time zone is GMT+08:00. 3. If you wish to specify a different time zone, you can append a time zone identifier, i.e. 'GMT+09:00' or 'GMT-10:00'.
timeRoundingString
기본값: up
선택 가능한 값:updown
Rounds up or down a timestamp by a given time period. Only valid when the granularity is less than 1d(not including 1day) 1. 'up' denotes rounds up, eg: granularity=5m then 00:00:00 ~ 00:05:00 will be displayed as 00:05:00. 2. 'down' denotes rounds down, eg: granularity=5m then 00:00:00 ~ 00:05:00 will be displayed as 00:00:00. 3. if not specified, the result will be rounded up.
domainString
Domains 1. Domain is not uploaded: Query all domain names of the account (More than 2000 domains will encounter error, you can contact technical support for adjustment). 2. Domain is uploaded: Up to 2000 domains are supported (you can contact technical support for adjustment). 3. For multiple domain, please separate them with a semicolon ';'.
serviceTypeString
Service type of the acceleration domain 1. If not specified, it is considered as 'no restriction on service type. 2. For multiple Application server types, please separate them with a semicolon ';'. eg: 'web,web-https'
billingRegionString
선택 가능한 값:매개변수 값 보기
billing region of the Acceleration domain 1. If not specified, it is considered as 'no restriction on billing region. 2. For multiple billing regions, please separate them with a semicolon ';'. eg: 'cn;kr'
granularityString
기본값: 1d
선택 가능한 값:5m1h1d
time granularity: the default granularity is one day. - 5m: five minutes - 1h: one hour - 1d: one day
groupByString
선택 가능한 값:domain
Group keywords 1. If not specified, result will be aggregated as default. 2. Passing in a keyword means that the details need to be displayed according to the values corresponding to the keyword dimension grouping (for example, passing in 'domain' means that the details are expanded according to domain). If an invalid value is specified, it will encounter an error. 3. Support passing multiple values, for multiple value please separate them with a semicolon ';', only support 'domain' grouping currently.

응답 파라미터

Body 파라미터

파라미터 이름설명
codeString
request status code
messageString
request status description
dataObject
response data
reportObject
container for data information.
typeString
기본값: cdn-traffic-report-data
The metric name
dateFromString
Indicates the starting time of response data. The time format is yyyy-MM-dd. 
dateToString
Indicates the ending time of response data. The time format is yyyy-MM-dd. 
timezoneString
기본값: GMT+08:00
Indicates the time zone for the returned data. Greenwich Mean Time Zone, the format is GMT+08:00
groupsList
List of data items. Each item contains fields as following: 'domain', 'flow', 'peakBandwidth', 'peakTime' 
domainString
the name of domain
totalRelayTrafficString
Indicates the CDN-to-Client traffic volume in gigabytes. The value is accurate to 3 decimal places.
peakBandwidthString
Indicates the peak bandwidth(5-minute granularity) of CDN-to-Client traffic volume in Mbps. 1.The value is accurate to 3 decimal places. 2.If granularity<=5m, no display in groups container objects
peakTimeString
Indicates the time of peak bandwidth(5-minute granularity). 
itemList
List of data items.Each item contains fields as following: 'time', 'flow'
timeString
Indicates the date and time 1. If the type is "5m", the timestamp format is "YYYY-MM-DD hh:mm:00", that means the period's end time. 2. If the type is "1h", the timestamp format is "YYYY-MM-DD hh:00:00", that means the period's start time. 3. If the type is "1d", the timestamp format is "YYYY-MM-DD 00:00:00", that means the period's start time.
relayTrafficString
Indicates the CDN-to-Client traffic volume in gigabytes. The value is accurate to 3 decimal places.

에러 코드

에러 코드(code)설명(message)HTTP 상태 코드설명
24001121Parameter not provided200Parameter not provided
24001122The format of parameter is incorrect200The format of parameter is incorrect
24001123The range of parameter is incorrect.200The range of parameter is incorrect.
24001124Parameter authentication failed200Parameter authentication failed
24001125Parameter data exceeds the limit200Parameter data exceeds the limit
24001126domain does not exist200domain does not exist
24001127domain is invalid200domain is invalid
24001128Billing region is invalid200Billing region is invalid
24001129The value of parameter is wrong200The value of parameter is wrong
24001130The given customer does not exist200The given customer does not exist
24002001Mysql querying encounter error200Mysql querying encounter error

예제

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://endpoint/cdn/traffic/relay" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/xml" \
-d '{"dateFrom":"2024-09-01","dateTo":"2024-09-01","domain":"a.com;b.com"}'
응답 예제
복사 복사 완료
{
    "code": "0",
    "message": "Success",
    "data": {
        "report": {
            "type": "get-cdn-relay-traffic",
            "dateFrom": "2024-09-01",
            "dateTo": "2024-09-01",
            "timezone": "GMT+07:00",
            "groups": [
                {
                    "domain": "a.com",
                    "totalRelayTraffic": "0.053",
                    "peakBandwidth": "0.246",
                    "peakTime": "2024-09-01 01:05:00",
                    "item": [
                        {
                            "time": "2024-09-01 01:00:00",
                            "relayTraffic": "0.000"
                        },
                        {
                            "time": "2024-09-01 01:05:00",
                            "relayTraffic": "0.009"
                        },
                        {
                            "time": "2024-09-01 01:10:00",
                            "relayTraffic": "0.005"
                        },
                        {
                            "time": "2024-09-01 01:15:00",
                            "relayTraffic": "0.005"
                        },
                        {
                            "time": "2024-09-01 01:20:00",
                            "relayTraffic": "0.005"
                        },
                        {
                            "time": "2024-09-01 01:25:00",
                            "relayTraffic": "0.003"
                        },
                        {
                            "time": "2024-09-01 01:30:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 01:35:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 01:40:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 01:45:00",
                            "relayTraffic": "0.003"
                        },
                        {
                            "time": "2024-09-01 01:50:00",
                            "relayTraffic": "0.003"
                        },
                        {
                            "time": "2024-09-01 01:55:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 02:00:00",
                            "relayTraffic": "0.004"
                        }
                    ]
                },
                {
                    "domain": "b.com",
                    "totalRelayTraffic": "0.053",
                    "peakBandwidth": "0.246",
                    "peakTime": "2024-09-01 01:05:00",
                    "item": [
                        {
                            "time": "2024-09-01 01:00:00",
                            "relayTraffic": "0.000"
                        },
                        {
                            "time": "2024-09-01 01:05:00",
                            "relayTraffic": "0.009"
                        },
                        {
                            "time": "2024-09-01 01:10:00",
                            "relayTraffic": "0.005"
                        },
                        {
                            "time": "2024-09-01 01:15:00",
                            "relayTraffic": "0.005"
                        },
                        {
                            "time": "2024-09-01 01:20:00",
                            "relayTraffic": "0.005"
                        },
                        {
                            "time": "2024-09-01 01:25:00",
                            "relayTraffic": "0.003"
                        },
                        {
                            "time": "2024-09-01 01:30:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 01:35:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 01:40:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 01:45:00",
                            "relayTraffic": "0.003"
                        },
                        {
                            "time": "2024-09-01 01:50:00",
                            "relayTraffic": "0.003"
                        },
                        {
                            "time": "2024-09-01 01:55:00",
                            "relayTraffic": "0.004"
                        },
                        {
                            "time": "2024-09-01 02:00:00",
                            "relayTraffic": "0.004"
                        }
                    ]
                }
            ]
        }
    }
}
이 문서의 내용이 도움이 되었습니까?
아니오
정상적으로 제출되었습니다.피드백을 주셔서 감사합니다.앞으로도 개선을 위해 노력하겠습니다.