调用 DescribeTasks 接口,查询一个或多个异步请求的进度。
TaskIds
或资源IDResourceId
,具体请参见管理自定义镜像任务。下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeTasks | 要执行的操作,取值:DescribeTasks。 |
Version | String | 是 | 2020-04-01 | API的版本,取值:2020-04-01。 |
MaxResults | Integer | 否 | 20 | 分页查询时设置的每页行数:
|
NextToken | String | 否 | 3tiegs1y963vj0****** | 分页查询凭证,用于标记分页的位置,初次调用该接口时无需设置。下次查询时,取值为上一次API调用返回的 |
ResourceId | String | 否 | image-ebgy1og99tfct0gw | 资源ID。 说明 为提高兼容性,请使用 |
ResourceIds.N | Array of String | 否 | ResourceIds.1=image-ebgy1og99tfc****&ResourceIds.2=image-opisd1og89tfc**** | 资源ID,单次最多支持100个资源ID。
|
TaskIds.N | Array of String | 否 | TaskIds.1=t-ybnz9qci2sahiqdl****&TaskIds.2=t-ybnz9qci89sw***** | 任务ID,单次最多支持100个任务ID。您可以在调用ExportImage、CopyImage接口等操作自定义镜像时获取。
|
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
NextToken | String | bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq****** | 本次调用返回的查询凭证值,返回为空表示该页为末页。 |
Tasks | Array of TasksForDescribeTasks | -- | 任务列表。 |
GET /?Action=DescribeTasks&Version=2020-04-01 HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: ecs
{ "ResponseMetadata": { "RequestId": "202106111445100102252431000052****", "Action": "DescribeTasks", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "NextToken": "", "Tasks": [ { "Id": "t-ybnz9qci2sahiqdl****", "CreatedAt": "2022-05-06T00:01:00+08:00", "UpdatedAt": "2022-05-06T00:07:12+08:00", "EndAt": "2022-05-06T00:07:12+08:00", "ResourceId": "image-ybnz9qci2sahiqdl****", "Type": "ExportImage", "Process": 100, "Status": "Succeeded" } ] } }
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码 | 错误码 | 错误信息 | 说明 |
---|---|---|---|
400 | LimitExceeded.MaximumMaxResults | The number of specified MaxResults exceeds the maximum limit. | 指定的MaxResults超过最大限制。 |
400 | LimitExceeded.MaximumResourceIds | You've reached the limit on the number of ResourceIds that you can set. | 指定的资源ID数量超过限制。 |
400 | LimitExceeded.MaximumTaskIds | You've reached the limit on the number of TaskIds that you can set. | 指定的任务ID数量超过限制。 |
400 | LimitExceeded.MinimumMaxResults | The number of specified MaxResults exceeds the minimum limit. | 指定的MaxResults超过最小限制。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |