查询刷新任务总数

更新时间:2023-04-04 20:22:18

适用产品

CDN Pro

接口描述

查询某个时间范围内的刷新请求的汇总信息。可通过查询参数指定时间范围和目标环境。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Params 参数

参数名称描述
*startdateString
RFC 3339格式的日期,表示查询的开始时间。必须使用UTC时区,不能是其它时区。例如:startdate=2019-10-30T00:00:00Z
*enddateString
RFC 3339格式的日期,表示查询的结束时间。必须使用UTC时区,不能是其它时区。例如:enddate=2019-10-30T00:00:00Z
targetString
取值范围: staging, production 默认值: production 刷新请求对应的环境。

返回参数

Body 参数

参数名称描述
requestsInteger
取值范围: >= 0 刷新请求的数量。
fileRequestsInteger
取值范围: >= 0 包含了文件刷新类型的刷新请求的数量。
dirRequestsInteger
取值范围: >= 0 包含了目录刷新类型的刷新请求的数量。
fileEntriesInteger
取值范围: >= 0 刷新请求中文件(fileURL)条目的总数。
dirEntriesInteger
取值范围: >= 0 刷新请求中目录(dirURL)条目的总数。
regexRequestsInteger
取值范围: >= 0 包含了正则表达式刷新类型的刷新请求的数量。
regexEntriesInteger
取值范围: >= 0 刷新请求中正则表达式条目的总数。

错误码

错误代码(code)描述(message)HTTP状态码语义
InvalidStartDateInvalid 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.400startdate参数无效。必须是 RFC3339 日期格式,并采用UTC时区。参考格式:"yyyy-MM-dd'T'HH:mm:ss'Z'"。
InvalidTimeSpanThe parameter 'enddate' should be after 'startdate'.400enddate参数的时间必须在startdate时间之后。
InvalidTargetAn invalid target was specified. It must be either 'staging' or 'production' or left empty.400target参数取值无效。必须是 'staging' 或 'production',或者放空。

示例

200
400
200
请求示例
复制代码 复制成功
#!/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
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!