• Elastic Volume Service

evs
  1. Help Center
  2. Elastic Volume Service
  3. API Reference
  4. API v1
  5. Querying Task Status

Querying Task Status

Function

This API is used to query execution status of tasks, such as the status of EVS disk creation, capacity expansion, and deletion.

URI

  • URI format

    GET /v1/{project_id}/jobs/{job_id}

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    job_id

    Yes

    Specifies the task ID.

Request

None

Response

  • Parameter description

    Parameter

    Type

    Description

    status

    string

    Specifies the task status.

    • SUCCESS: The task is successfully executed.
    • RUNNING: The task is in progress.
    • FAIL: The task fails.
    • INIT: The task is being initialized.

    entities

    map<string, object>

    Specifies the response to the task. The contents for each type of task are different.

    job_id

    string

    Specifies the task ID.

    job_type

    string

    Specifies the task type.

    • createVolume: creates an EVS disk.
    • batchCreateVolume: batch creates EVS disks.
    • deleteVolume: deletes an EVS disk.
    • extendVolume: expands the EVS disk capacity.
    • bulkDeleteVolume: batch deletes EVS disks.
    • deleteSingleVolume: deletes EVS disks one by one during a batch deletion.

    begin_time

    string

    Specifies the time when the task was started.

    end_time

    string

    Specifies the time when the task finished.

    error_code

    string

    Specifies the returned error code when the task execution fails.

    fail_reason

    string

    Specifies the cause of the task execution failure.

    message

    string

    Specifies the returned error message when an error occurs.

    code

    string

    Specifies the returned error code when an error occurs.

    For details about the error code, see Error Codes.

    sub_jobs

    list

    Specifies the execution information of a sub-task. When no sub-task exists, the value of this parameter is left blank. The structure of each sub-task is similar to that of the parent task.

  • Example response
    {
        "status": "RUNNING", 
        "entities": {
            "volume_id": "bdf1bb37-f20f-4266-9a04-f43e0a127376"
        }, 
        "job_id": "4010a32d535527910153552b492c0002", 
        "job_type": "createVolume", 
        "begin_time": "2016-03-08T07:40:13.219Z", 
        "end_time": "", 
        "error_code": null, 
        "fail_reason": null
    }

    or

    {
        "status": "SUCCESS", 
        "entities": {
            "sub_jobs": [
                {
                    "status": "SUCCESS", 
                    "entities": {
                        "volume_id": "0b549095-4937-4849-8e4c-52aa027d64f7"
                    }, 
                    "job_id": "21917a8d52a19b040152a9f2f2e50041", 
                    "job_type": "createVolume", 
                    "begin_time": "2016-02-04T01:43:37.445Z", 
                    "end_time": "2016-02-04T01:44:02.239Z", 
                    "error_code": null, 
                    "fail_reason": null
                }, 
                {
                    "status": "SUCCESS", 
                    "entities": {
                        "volume_id": "e7bca1a2-d3ed-434f-86f4-a1f11aa80072"
                    }, 
                    "job_id": "21917a8d52a19b040152a9f2f2f60042", 
                    "job_type": "createVolume", 
                    "begin_time": "2016-02-04T01:43:37.462Z", 
                    "end_time": "2016-02-04T01:44:02.245Z", 
                    "error_code": null, 
                    "fail_reason": null
                }
            ]
        }, 
        "job_id": "21917a8d52a19b040152a9f2f1eb003e", 
        "job_type": "batchCreateVolume", 
        "begin_time": "2016-02-04T01:43:37.193Z", 
        "end_time": "2016-02-04T01:44:08.283Z", 
        "error_code": null, 
        "fail_reason": null
    }

    or

    {
        "error": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

Returned Values

  • Normal

    200

Error Codes

For details, see Error Codes.