CDN Pro
查询某个时间范围内的刷新请求的汇总信息。可通过查询参数指定时间范围和目标环境。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
startdate | String | 是 | RFC 3339格式的日期,表示查询的开始时间。必须使用UTC时区,不能是其它时区。例如:startdate=2019-10-30T00:00:00Z |
enddate | String | 是 | RFC 3339格式的日期,表示查询的结束时间。必须使用UTC时区,不能是其它时区。例如:enddate=2019-10-30T00:00:00Z |
target | String | 否 | 取值范围: staging, production 默认值: production 刷新请求对应的环境。 |
参数名称 | 类型 | 描述 |
---|---|---|
requests | Integer | 取值范围: >= 0 刷新请求的数量。 |
fileRequests | Integer | 取值范围: >= 0 包含了文件刷新类型的刷新请求的数量。 |
dirRequests | Integer | 取值范围: >= 0 包含了目录刷新类型的刷新请求的数量。 |
fileEntries | Integer | 取值范围: >= 0 刷新请求中文件(fileURL)条目的总数。 |
dirEntries | Integer | 取值范围: >= 0 刷新请求中目录(dirURL)条目的总数。 |
regexRequests | Integer | 取值范围: >= 0 包含了正则表达式刷新类型的刷新请求的数量。 |
regexEntries | Integer | 取值范围: >= 0 刷新请求中正则表达式条目的总数。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidStartDate | Invalid parameter 'startdate'. '2019' is not a valid RFC3339 timestamp in UTC. The timestamp should be in "yyyy-MM-dd'T'HH:mm:ss'Z'" format. | 400 | startdate参数无效。必须是 RFC3339 日期格式,并采用UTC时区。参考格式:"yyyy-MM-dd'T'HH:mm:ss'Z'"。 |
InvalidTimeSpan | The parameter 'enddate' should be after 'startdate'. | 400 | enddate参数的时间必须在startdate时间之后。 |
InvalidTarget | An invalid target was specified. It must be either 'staging' or 'production' or left empty. | 400 | target参数取值无效。必须是 'staging' 或 'production',或者放空。 |
#!/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/purges/purgeSummary" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json"
{ "requests": 1, "fileRequests": 1, "dirRequests": 1, "fileEntries": 2, "dirEntries": 2, "regexRequests": 0, "regexEntries": 0 }