CDN Pro
获取预取请求列表。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
startdate | String | 否 | RFC 3339格式的日期,表示查询的开始时间。必须为UTC时间,如'2021-03-01T01:00:00Z'。 |
enddate | String | 否 | RFC 3339格式的日期,表示查询的结束时间。必须为UTC时间,如'2021-03-01T01:00:00Z'。 |
offset | Integer | 否 | 默认值: 0 取值范围: >= 0 查询起始位置。 |
limit | Integer | 否 | 默认值: 100 取值范围: <= 200 每次查询的最大条数。 |
sortBy | String | 否 | 取值范围: submissionTime,finishTime 返回查询结果的排序依据。默认按预取请求的创建时间降序排序。 |
sortOrder | String | 否 | 取值范围: asc,desc 返回查询结果的排序顺序。默认按预取请求的创建时间降序排序。 |
search | String | 否 | 根据搜索关键字匹配预取请求的名称、ID和相关的加速域名,过滤预取请求。 |
参数名称 | 类型 | 描述 |
---|---|---|
count | Integer | 取值范围: >= 0 预取请求的总数。该数量取决于查询参数。 |
prefetchRequests | List | 预取请求列表。 |
id | String | 预取请求的ID。 |
name | String | 预取请求的简短描述。 |
status | String | 取值范围: waiting,inprogress,finished 预取请求的任务执行状态,包括等待中,进行中,已完成等状态。 |
submissionTime | String | RFC 3339格式的日期,表示预取请求的提交时间。 |
finishTime | String | RFC 3339格式的日期,表示预取任务的完成时间。 |
successRate | Integer | 取值范围: [ 0 .. 100 ] 预取任务的成功率。 |
apiRequestId | String | API请求ID。 |
fileEntries | Integer | 取值范围: >= 1 预取请求中的URL数量。 |
hostnames | List | 预取请求涉及的加速域名。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidListLimit | The value of limit should be between 1 and 200, inclusive. | 400 | limit参数取值范围必须在1-200之间。 |
InvalidSortBy | The valid sort by values for this endpoint are 'submissionTime', 'finishTime'. | 400 | sortBy参数取值只允许'submissionTime'和'finishTime'。 |
InvalidSortOrder | The valid sort order values are asc and desc. | 400 | sortOrder参数取值只允许'acs', 'desc'。 |
InvalidStartDate | Invalid parameter 'startdate'. 'a' 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'"。 |
InvalidListOffset | The offset must be a valid non-negative integer. | 400 | offset参数必须是大于等于零的整数。 |
#!/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/prefetches" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json"
{ "count": 2, "prefetchRequests": [ { "apiRequestId": "889c2c5a2d9d93ce", "fileEntries": 2, "hostnames": [ "example.com" ], "id": "4f8553f7f30942fd8a2d247f05db3602", "name": "another prefetch request", "status": "waiting", "submissionTime": "2021-03-05T00:34:28Z", "successRate": 0 }, { "apiRequestId": "39ac9855a7a7d547", "fileEntries": 2, "finishTime": "2021-03-04T23:30:28Z", "hostnames": [ "example2.com" ], "id": "17b36e2902544776a6e0043ce622ab10", "name": "my new prefetch request", "status": "finished", "submissionTime": "2021-03-04T23:30:07Z", "successRate": 100 } ] }