• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. API Reference
  4. Common Parameters
  5. Asynchronous Job Progress Query

Asynchronous Job Progress Query

Function

This API is an extension one. It is used to query the name of the job executed by an asynchronous API and the execution progress. For example, you can use this API to query the image creation progress.

URI

  • URI format

    GET /v1/cloudimages/job/{job_id}

  • Parameter description

    Parameter

    Mandatory

    Description

    job_id

    Yes

    Specifies the asynchronous job ID.

Request

Example request

GET /v1/cloudimages/job/ff8080814dbd65d7014dbe0d84db0013

Response

  • Parameter description

    Parameter

    Type

    Description

    status

    String

    Specifies the job status. The value can be:

    SUCCESS: The job is successfully executed.

    FAIL: The job failed to be executed.

    RUNNING: The job is in progress.

    INIT: The job is being initialized.

    job_id

    String

    Specifies the job ID.

    job_type

    String

    Specifies the job type.

    begin_time

    String

    Specifies the start time of the job. The value is in UTC format.

    end_time

    String

    Specifies the end time of the job. The value is in UTC format.

    error_code

    String

    Specifies the error code.

    fail_reason

    String

    Specifies the cause of the failure.

    entities

    Dict

    Specifies the custom attributes of the job. When the job is normal, the system returns the image ID, execution progress, and job name. If an exception occurs on the job, an error code and associated information are returned.

  • Example response
    STATUS CODE 200
    { 
         "status": "SUCCESS", 
         "entities": { 
             "image_id": "e9e91bff-14b6-4a0b-8377-4ed0813e3360" 
       "process_percent": 0.24,
            "current_task": "ImportImageTask:ObtainImageInfoTask",
         }, 
         "job_id": "ff8080814dbd65d7014dbe0d84db0013", 
         "job_type": "createImageByInstance", 
         "begin_time": "04-Jun-2015 18:11:06:586", 
         "end_time": "", 
         "error_code": null, 
         "fail_reason": null 
     }

Returned Values

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the rights to perform the operation.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    The service is unavailable.