Updated on 2024-03-27 GMT+08:00

Querying the Job Status

Function

This API is used to query the execution status of a job, such as VBS backup creation, VBS backup deletion, and VBS backup-based disk restoration.

URI

  • URI format

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

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID

    For details about how to obtain the project ID, see Obtaining a Project ID.

    job_id

    Yes

    Job ID

Request

None

Response

  • Parameter description

    Parameter

    Type

    Description

    status

    string

    Job status

    • SUCCESS: The job is successfully executed.
    • RUNNING: The job is in progress.
    • FAIL: The job failed.
    • INIT: The job is being initialized.

    entities

    map<string, string>

    Response to the job. Each type of job has different contents.

    job_id

    string

    Job ID

    job_type

    string

    Job type

    begin_time

    string

    Time when the job started

    end_time

    string

    Time when the job finished

    error_code

    string

    Error code returned after the job execution fails

    fail_reason

    string

    Cause of the execution failure

    message

    string

    Error message returned after an error occurs

    code

    string

    Error code returned after an error occurs

    For details about error codes, see Error Codes.

    sub_jobs

    list

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

  • Example response
    {
        "status": "SUCCESS",
        "entities": {
            "bks_create_volume_name": "autobk_volume",
            "backup_id": "ba5401a2-7cd2-4c01-8c0d-c936ab412d6d",
            "volume_id": "7e5fdc5a-5e36-4b22-8bcc-7f17037290cc",
            "snapshot_id": "a77a96bf-dd18-40bf-a446-fdcefc1719ec"
        },
        "job_id": "4010b39b5281d3590152874bfa3b1604",
        "job_type": "bksCreateBackup",
        "begin_time": "2016-01-28T16:14:09.466Z",
        "end_time": "2016-01-28T16:25:27.690Z",
        "error_code": null,
        "fail_reason": null
    }

    or

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

Status Codes

  • Normal

    200

  • Abnormal

    Status Code

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter the username and password to access the requested page.

    403 Forbidden

    You are forbidden to access the requested page.

    404 Not Found

    The server could not find the requested page.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication so that the request can be processed.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    501 Not Implemented

    Failed to complete the request because the server does not support the requested function.

    502 Bad Gateway

    Failed to complete the request because the request is invalid.

    503 Service Unavailable

    Failed to complete the request because the service is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.

Error Codes

For details, see Error Codes.