CDN Pro
获取一段时间内对调度域名发起的DNS解析请求数。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 描述 |
---|---|
*startdateString | 查询范围的开始时间,以RFC 3339日期格式表示。必须使用UTC时区指定时间。示例:startdate=2019-10-30T00:00:00Z。 |
*enddateString | 查询范围的结束时间,以RFC 3339日期格式表示。必须使用UTC时区指定时间。示例:startdate=2019-11-14T00:00:00Z。 |
*typeString | 取值范围: fiveminutes,hourly,daily,monthly
指定返回数据的粒度,支持5分钟,小时,日,月粒度。默认情况下,我们以UTC 00:00:00作为一天的开始。如果您希望指定不同的时区,可以附加时区标识,即-12、-11、-10、-9、-8、-7、-6、-5、-4、-3、-2、-1、+1、+2、+3、+4、+5、+6、+7、+8、+9、+10、+11、+12。例如,type=daily+8表示使用UTC+8时区指定一天的开始时间。 |
参数名称 | 描述 |
---|---|
filtersGetEdgeHostnameStatisticsRequestFilters | 指定调度域名进行查询。 |
edgeHostnamesList | 一个或多个调度域名。 |
参数名称 | 描述 |
---|---|
dataNameString | 对返回数据的简要描述。 |
dataUnitString | 计量单位。不同报表类型计量单位不一样。 |
dataSeriesList | 数据点。 |
timestampString | 每个时间段的起始时间,以RFC 3339日期格式表示。始终采用UTC时区。例如:'timestamp': '2019-10-29T01:00:00Z' |
dataInteger | 该时间段对应的值。计量单位,由dataUnit字段指定。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidType | Parameter 'type' is required. | 400 | type参数必填。 |
InvalidTimeSpan | The max time span of 'daily' report must be no more than 366 days. | 400 | 以天为粒度查询时,查询跨度不能超过365天。 |
InvalidEdgeHostnames | Invalid Edge Hostname(s): 'a'. | 400 | 指定的调度域名无效。 |
#!/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://open.chinanetcenter.com/cdn/report/edgeHostnameReq?startdate=2023-01-01T00:00:00Z&enddate=2023-01-02T00:00:00Z" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{"filters": {"edgeHostnames": ["myedgehost1.qtlglb.com", "myedgehost2.qtlglb.com"]}}'
{ "dataName": "edgeHostname dns requests", "dataUnit": "counts", "dataSeries": [ { "timestamp": "2020-01-09T00:00:00Z", "data": 59 }, { "timestamp": "2020-01-10T00:00:00Z", "data": 5 }, { "timestamp": "2020-01-14T00:00:00Z", "data": 80 }, { "timestamp": "2020-01-15T00:00:00Z", "data": 22 }, { "timestamp": "2020-01-16T00:00:00Z", "data": 62 }, { "timestamp": "2020-01-17T00:00:00Z", "data": 3 }, { "timestamp": "2020-01-18T00:00:00Z", "data": 4 }, { "timestamp": "2020-01-19T00:00:00Z", "data": 3 }, { "timestamp": "2020-01-20T00:00:00Z", "data": 3 }, { "timestamp": "2020-01-21T00:00:00Z", "data": 2035 }, { "timestamp": "2020-01-22T00:00:00Z", "data": 1369 }, { "timestamp": "2020-01-23T00:00:00Z", "data": 5 }, { "timestamp": "2020-01-24T00:00:00Z", "data": 8 }, { "timestamp": "2020-01-25T00:00:00Z", "data": 12 }, { "timestamp": "2020-01-26T00:00:00Z", "data": 4 }, { "timestamp": "2020-01-27T00:00:00Z", "data": 6 }, { "timestamp": "2020-01-28T00:00:00Z", "data": 4 }, { "timestamp": "2020-01-29T00:00:00Z", "data": 14 } ] }