查询预取任务详情

更新时间:2024-01-16 20:28:31

适用产品

CDN Pro

接口描述

获取预取请求的详细信息。

调用频率

单用户调用频率:300/5min

推荐使用 Open API在线调试

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

请求参数

Path 参数

参数名称描述
*idString
预取请求的 id。

返回参数

Body 参数

参数名称描述
nameString
取值范围: <= 1000 字符 预取请求的简短描述。
fileListList
urlString
取值范围: [ 10 .. 2048 ] 字符 预取的URL。必须以'http'或'https'开头,长度不超过2048个字符。
headersList
如果需要在缓存键中加入请求头,可用该字段指定请求头。
nameString
HTTP头部名称。
valueString
HTTP头部值。
metadataObject
预取请求的状态信息。
idString
预取请求ID。
submissionTimeString
RFC 3339格式的日期,表示预取请求的提交时间。
successRateInteger
取值范围: [ 0 .. 100 ] 预取任务的成功率。
statusString
取值范围: waiting,inprogress,finished 预取请求的任务执行状态,包括等待中,进行中,已完成等状态。
finishTimeString
RFC 3339格式的日期,表示预取完成的时间。
apiRequestIdString
API请求ID。
regionsList
需要预取内容的大洲,以大洲英文名表示。未指定时表示预取内容到所有大洲的服务器。
startTimeString
RFC 3339格式的日期,表示开始预取的时间。必须使用UTC时间,例如'2021-03-06T00:00:00Z'。
webhookString
预取任务完成时调用的webhook ID。

错误码

错误代码(code)描述(message)HTTP状态码语义
InvalidPrefetchTaskIdThe specified prefetch task ID does not exist.404指定的预取请求ID不存在。

示例

200
404
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/prefetches/{id}" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json"
返回示例
复制代码 复制成功
{
    "name": "my new prefetch request",
    "fileList": [
        {
            "url": "http://example.com"
        },
        {
            "url": "http://example.com/abc",
            "headers": [
                {
                    "name": "MyheaderName",
                    "value": "123"
                }
            ]
        }
    ],
    "regions": [
        "Asia"
    ],
    "startTime": "2021-03-06T00:00:00Z",
    "metaData": {
        "id": "4f8553f7f30942fd8a2d247f05db3602",
        "submissionTime": "2021-03-05T00:34:28Z",
        "successRate": 0,
        "status": "waiting",
        "apiRequestId": "889c2c5a2d9d93ce"
    }
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!