异步任务进度查询 - ShowJobProgress
功能介绍
该接口为扩展接口,主要用于查询异步任务进度。
调试
您可以在API Explorer中调试该接口。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
请求示例
异步任务进度查询。
GET /v1/cloudimages/job/ff8080814dbd65d7014dbe0d84db0013
响应消息
- 响应参数
参数
参数类型
描述
job_id
String
任务ID。
job_type
String
任务类型。
- imsCreateImageByInstance:云服务器创建镜像
- imsImportImageJob:外部镜像文件创建镜像
- imsImportOvaImageJob:外部Ova镜像文件创建镜像
- imsVolumeCreateImageJob:数据盘创建系统盘镜像
- imsVolumesToSysDataImagesJob:数据盘创建数据盘镜像
- imsImportDataImageJob:外部镜像文件创建数据盘镜像
- imsCreateWholeImageByInstanceJob:云服务器创建整机镜像
- imsCreateWholeImageByBackupJob:云备份或云服务器备份创建整机镜像
- imsNativeImportImageJob:注册镜像
- imsNativeExportImageJob:导出镜像
- imsAddImageMembersJob:添加镜像成员
- imsDelImageMembersJob:删除镜像成员
- imsUpdateImageMembersJob:修改镜像成员
- imsCopyImageInRegionJob:Region内复制镜像
- imsCrossRegionCopyImageJob:跨Region复制镜像
begin_time
String
任务开始执行时间。格式为UTC时间。
end_time
String
任务结束时间。格式为UTC时间。
status
String
任务状态,目前取值如下:
- SUCCESS:表示该任务执行已经结束,任务执行成功。
- FAIL:表示该任务执行已经结束,任务执行失败。
- RUNNING:表示该任务正在执行。
- INIT:表示该任务还未执行,正在初始化。
error_code
String
错误码。
fail_reason
String
失败原因。
entities
Object
任务自定义属性。
任务正常时,返回镜像的ID;任务异常时,返回错误码和信息。
详情请参见表2。
表2 entities字段数据结构说明 参数
参数类型
描述
image_name
String
镜像名称。
process_percent
Double
任务执行进度。
current_task
String
当前任务名称。
subJobId
String
子任务ID。
image_id
String
镜像ID。
sub_jobs_result
Array of SubJobResult objects
子任务执行结果。详情请参见表3。
sub_jobs_list
Array of string
子任务id列表。
表3 SubJobResult字段数据结构说明 参数
参数类型
描述
status
String
子任务状态,取值如下:
- SUCCESS:表示该任务执行已经结束,任务执行成功。
- FAIL:表示该任务执行已经结束,任务执行失败。
- RUNNING:表示该任务正在执行。
- INIT:表示该任务还未执行,正在初始化。
job_id
String
子任务ID。
job_type
String
子任务类型。
取值范围:
imsGoofysImportImageJob:导入镜像
imsGoofysImportImageWithoutconfigJob:导入镜像
imsGoofysUploadImageJob:导入镜像
imsGoofysExportImageJob:导出镜像
imsImportBigFileImageJob:导入镜像
imsQuickExportImageJob:快速导出镜像
imsImportIsoFileImageJob:创建ISO镜像
imsImportDataImageJob:创建数据盘镜像
imsCopyVolumeToImageJob:数据盘创建数据盘镜像
begin_time
String
子任务开始执行时间。格式为UTC时间。
end_time
String
子任务结束时间。格式为UTC时间。
error_code
String
错误码。
fail_reason
String
失败原因。
entities
Object
子任务自定义属性。详情请参见表4
- 任务正常时,返回镜像的ID。
- 任务异常时,返回错误码和信息。
响应示例
- 当任务类型为imsCreateImageByInstance,云服务器创建镜像时,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d2d11f02349b4", "job_type": "imsCreateImageByInstance", "begin_time": "2026-03-27T02:14:03.552Z", "end_time": "2026-03-27T02:17:11.351Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "eacac5cb-1153-4b8c-873c-73e036f5a988", "process_percent": 1, "current_task": "" } } - 当任务类型为imsImportImageJob,外部镜像文件创建镜像时,响应示例如下:
{ "job_id": "9a175ac89d2a5e14019d2cde77f03a0f", "job_type": "imsImportImageJob", "begin_time": "2026-03-27T01:17:50.446Z", "end_time": "2026-03-27T01:57:11.143Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "subJobId": "0825e1f7fae2477b9db78d7ea34a1a10", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } } - 当任务类型为imsImportOvaImageJob,外部Ova镜像文件创建镜像,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d4c35cf71260b", "job_type": "imsImportOvaImageJob", "begin_time": "2026-04-02T03:21:28.174Z", "end_time": "2026-04-02T03:59:13.786Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "sub_jobs_result": [ { "job_id": "9a175ac79d2a54ad019d4c37b9772673", "job_type": "imsImportImageJob", "begin_time": "2026-04-02T03:23:33.620Z", "end_time": "2026-04-02T03:58:55.831Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "6d0c5c0e-5505-4ba8-ab65-7e78efe77130" } }, { "job_id": "9a175ac79d2a54ad019d4c37b9862674", "job_type": "imsImportDataImageJob", "begin_time": "2026-04-02T03:23:33.635Z", "end_time": "2026-04-02T03:25:45.953Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "3e0c2b6c-e56f-435a-bcb5-e6a45cccdd75" } } ] } } - 当任务类型为imsVolumeCreateImageJob,通过数据盘创建系统盘镜像时,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d3c757c246c47", "job_type": "imsVolumeCreateImageJob", "begin_time": "2026-03-30T01:57:05.698Z", "end_time": "2026-03-30T02:01:45.927Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "67891716-2e40-4cff-924e-e609017294fc", "process_percent": 1, "current_task": "" } } - 当任务类型为imsVolumesToSysDataImagesJob,数据盘创建数据盘镜像时,响应示例如下:
{ "job_id": "9a175ac69d2a5466019d4c2294462ed9", "job_type": "imsVolumesToSysDataImagesJob", "begin_time": "2026-04-02T03:00:27.845Z", "end_time": "2026-04-02T03:03:30.540Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "sub_jobs_result": [ { "job_id": "9a175ac69d2a5466019d4c2299782edd", "job_type": "imsCopyVolumeToImageJob", "begin_time": "2026-04-02T03:00:29.173Z", "end_time": "2026-04-02T03:03:05.904Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_id": "51a2a39b-622e-411f-a1a3-9745393baf3d", "image_name": "name" } } ] } } - 当任务类型为imsImportDataImageJob,外部镜像文件创建数据盘镜像时,响应示例如下:
{ "job_id": "9a175ac69d2a5466019d4c2fcc6a32cb", "job_type": "imsImportDataImageJob", "begin_time": "2026-04-02T03:14:54.184Z", "end_time": "2026-04-02T03:17:07.450Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "subJobId": "98ac8511d1274186afc1f50df6ed6ecd", "image_id": "b4609d4a-dcdc-4a54-bb33-8b9778bb9656", "process_percent": 1, "current_task": "" } } - 当任务类型为imsCreateWholeImageByInstanceJob,云服务器创建整机镜像时,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d2ece15ca4808", "job_type": "imsCreateWholeImageByInstanceJob", "begin_time": "2026-03-27T10:19:11.176Z", "end_time": "2026-03-28T10:19:23.952Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } } - 当任务类型为imsCreateWholeImageByBackupJob,云备份或云服务器备份创建整机镜像时,响应示例如下:
{ "job_id": "9a175ac89d2a5e14019d3c71ee087693", "job_type": "imsCreateWholeImageByBackupJob", "begin_time": "2026-03-27T01:17:50.446Z", "end_time": "2026-03-27T01:57:11.143Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } } - 当任务类型为imsNativeImportImageJob,注册镜像时,响应示例如下:
{ "job_id": "9a175ac89d2a5e14019d3c76e7cc774c", "job_type": "imsNativeImportImageJob", "begin_time": "2026-03-27T01:17:50.446Z", "end_time": "2026-03-27T01:57:11.143Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } } - 当任务类型为imsNativeExportImageJob,导出镜像时,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d2d0a1f074696", "job_type": "imsNativeExportImageJob", "begin_time": "2026-03-27T01:17:50.446Z", "end_time": "2026-03-27T01:57:11.143Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } } - 当任务类型为imsAddImageMembersJob,添加镜像成员时,响应示例如下:
{ "job_id": "9a175ac79d84d201019d85a1aaa33350", "job_type": "imsAddImageMembersJob", "begin_time": "2026-04-13T06:57:37.953Z", "end_time": "2026-04-13T06:57:40.252Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "results": [ { "image_id": "a24bf5a1-a44c-405a-ae33-4fe92c19d04e", "project_id": "3fa564b6aba743d1b864f907226a624e", "status": "success" } ], "process_percent": 1, "current_task": "" } } - 当任务类型为imsDelImageMembersJob,删除镜像成员时,响应示例如下:
{ "job_id": "9a175ac89d84d1fe019d85a549ea35c5", "job_type": "imsDelImageMembersJob", "begin_time": "2026-04-13T07:01:35.336Z", "end_time": "2026-04-13T07:01:36.277Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "results": [], "process_percent": 1, "current_task": "" } } - 当任务类型为imsUpdateImageMembersJob,修改镜像成员时,响应示例如下:
{ "job_id": "9a175ac79d89b857019d89da380f07f3", "job_type": "imsUpdateImageMembersJob", "begin_time": "2026-04-14T02:37:53.036Z", "end_time": "2026-04-14T02:37:53.645Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "results": [ { "image_id": "e2851247-416e-4bae-8a1d-de14015f635f", "project_id": "3fa564b6aba743d1b864f907226a624e", "status": "success" } ], "process_percent": 1, "current_task": "" } } - 当任务类型为imsCopyImageInRegionJob,区域内复制镜像时,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d2eb4a0e640a4", "job_type": "imsCopyImageInRegionJob", "begin_time": "2026-03-27T01:17:50.446Z", "end_time": "2026-03-27T01:57:11.143Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } } - 当任务类型为imsCrossRegionCopyImageJob,跨区域复制镜像时,响应示例如下:
{ "job_id": "9a175ac79d2a54ad019d47145b8f78cd", "job_type": "imsCrossRegionCopyImageJob", "begin_time": "2026-03-27T01:17:50.446Z", "end_time": "2026-03-27T01:57:11.143Z", "status": "SUCCESS", "error_code": null, "fail_reason": null, "entities": { "image_name": "name", "image_id": "698a61e2-abde-4151-a778-f9035e214c92", "process_percent": 1, "current_task": "" } }