DescribeRefreshTasks - 查询刷新预热任务

调用DescribeRefreshTasks查询刷新、预热状态是否在全网生效。

接口说明

  • 支持根据任务 ID 或 URL 查询。

  • 支持同时传入 TaskIdObjectPath 参数,如果不指定 TaskIdObjectPath,默认查询最近 3 天内第一页的数据(20 条)。

  • 只能查询最近 3 天内的数据。

  • 任务状态需要由 API 的调用请求来触发异步更新。

  • 如果您在 OSS 控制台开启了 CDN 缓存自动刷新,则无法通过 DescribeRefreshTasks 接口查看 OSS 上的缓存自动刷新任务。

  • 单用户调用频率:5 次/秒。如果您需要更高的调用频率,请使用仅支持通过任务编号查询刷新预热任务信息的接口 DescribeRefreshTaskById

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

cdn:DescribeRefreshTasks

none

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

请求参数

名称

类型

必填

描述

示例值

TaskId

string

按任务 ID 查询刷新状态。

1234321

ObjectPath

string

按路径查询,准确匹配。

http://example.com/1.txt

PageNumber

integer

取得第几页,取值范围为:1~100000

1

ObjectType

string

任务类型。取值:

  • file:文件刷新。

  • directory:目录刷新。

  • regex:正则刷新。

  • preload:文件预热。

  • block:URL 封禁。

  • unblock:URL 解封禁。

说明

当指定 DomainNameStatus 参数时,ObjectType 参数为必传参数。

file

DomainName

string

加速域名。仅支持单个查询,默认查询所有加速域名。

example.com

Status

string

任务状态。取值:

  • Complete:完成。

  • Refreshing:处理中。

  • Failed:失败。

Complete

PageSize

integer

分页大小,默认 20,最大 100。取值:1~100

20

StartTime

string

开始时间。日期格式按照 ISO8601 表示法,并使用 UTC+0 时间,格式为 yyyy-MM-ddTHH:mm:ssZ。

2017-12-21T08:00:00Z

EndTime

string

结束时间。日期格式按照 ISO8601 表示法,并使用 UTC+0 时间,格式为 yyyy-MM-ddTHH:mm:ssZ。

说明

结束时间需大于起始时间。

2017-12-22T08:00:00Z

ResourceGroupId

string

资源组 ID。

rg-acfmyuji4b6r4**

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

174F6032-AA26-470D-B90E-36F0EB205BEE

PageNumber

integer

页码。

10

PageSize

integer

整页大小。

1

TotalCount

integer

总条数。

2

Tasks

object

CDNTask

array<object>

任务列表。

object

Status

string

状态。取值:

  • Complete:完成。

  • Refreshing:处理中。

  • Failed:失败。

Complete

CreationTime

string

任务对象创建时间,UTC+0 时间。

2014-11-27T08:23:22Z

ObjectType

string

任务类型。

  • file:文件刷新。

  • directory:目录刷新。

  • regex:正则刷新。

  • preload:文件预热。

file

Process

string

进度百分比。

100%

Description

string

刷新预热失败返回的错误描述。

  • InternalError:内部错误。

  • OriginTimeout:源站响应超时。

  • OriginReturnStatusCode 5XX:源站响应 5xx 错误码。

Internal Error

ObjectPath

string

刷新对象路径。

http://example.com/1.txt

TaskId

string

任务 ID。

704225667

示例

正常返回示例

JSON格式

{
  "RequestId": "174F6032-AA26-470D-B90E-36F0EB205BEE",
  "PageNumber": 10,
  "PageSize": 1,
  "TotalCount": 2,
  "Tasks": {
    "CDNTask": [
      {
        "Status": "Complete",
        "CreationTime": "2014-11-27T08:23:22Z",
        "ObjectType": "file",
        "Process": "100%",
        "Description": "Internal Error",
        "ObjectPath": "http://example.com/1.txt",
        "TaskId": "704225667"
      }
    ]
  }
}

异常返回示例

JSON格式

{"RequestId":"16A96B9A-F203-4EC5-8E43-CB92E68F4CD8","HostId":"cdn.aliyuncs.com","Code":"InternalError","Message":"The request processing has failed due to some unknown error."}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidTaskId.Malformed The specified TaskId is invalid.
400 MissingParameter.ObjectType The ObjectType parameter is required if DomainName or Status is specified.
400 MissingTimeParameter The StartTime and EndTime must be both specified. 请同时提供开始时间和结束时间。
400 InvalidEndTime.Mismatch The specified EndTime is earlier than the StartTime. 用户参数中EndTime早于StartTime
400 DomainNameOverLimit A maximum of 500 domains are supported for each request.
400 InvalidTime The query time cannot exceed the last 3 days.
400 InvalidStartTime.Malformed The specified StartTime is invalid. 起始时间格式错误。请核对后重新提供。
400 InvalidEndTime.Malformed The specified EndTime is invalid. 结束时间格式错误。日期格式请参考所调用API的帮助文档说明。
400 InvalidObjectPath.Malformed The specified ObjectPath is invalid.
400 InvalidStartTime.ValueNotSupported The specified StartTime is invalid. 起始时间格式错误。日期格式请参考所调用API的帮助文档说明。
400 InvalidEndTime.ValueNotSupported The specified EndTime is invalid.
400 InvalidObjectType.ValueNotSupported The specified ObjectType is not supported.
400 InvalidStatus.ValueNotSupported The specified Status is not supported.
429 TooManyRequests The server is busy. Please try again later.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情