Querying Job Status

Function

This API is used to query job running status.

URI

  • URI format
    GET /v1.1/{project_id}/clusters/{cluster_id}/cdm/job/{job_name}/status
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Obtaining the Project ID, Account Name, and AK/SK.

    cluster_id

    Yes

    String

    Cluster ID. Obtain the value from the response for Creating a Cluster.

    job_name

    Yes

    String

    Job name

    To query the status of a subjob in an entire database job, set job_name to the subjob name. The format for naming a subjob is parent job name_source table name.

Request

Sample request
GET /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/6ec9a0a4-76be-4262-8697-e7af1fac7920/cdm/job/jdbc2hive/status

Response

  • Sample job running response
    {
      "submissions": [{
        "job-name": "jdbc2hive",
        "status": "BOOTING",
        "creation-date": 1536905778725,
        "creation-user": "cdm"
      }]
    }
  • Sample response of a successful job
    {
      "submissions": [{
      "job-name": "jdbc2hive",
        "status": "SUCCEEDED",
        "creation-date": 1536906582997,
        "creation-user": "cdm",
        "isStopingIncrement": "",
        "last-update-date": 1536916580005,
        "is-execute-auto": false,
        "last-udpate-user": "cdm",
        "isDeleteJob": false,
        "isIncrementing": false,
        "external-id": "job_local1127970451_0009",
        "counters": {
          "org.apache.sqoop.submission.counter.SqoopCounters": {
            "BYTES_WRITTEN": -1,
            "TOTAL_FILES": -1,
            "BYTES_READ": -1,
            "FILES_WRITTEN": -1,
            "TOTAL_SIZE": -1,
            "FILES_READ": -1,
            "ROWS_WRITTEN": 80,
            "ROWS_READ": 80
          }
        }
      }]
    }
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    submissions

    Yes

    List

    Job running information. For details, see Description of the submissions parameter.

  • Description of the submissions parameter

    Parameter

    Mandatory

    Type

    Description

    job-name

    Yes

    String

    Job name

    status

    Yes

    String

    Job status. The options are as follows:

    • NEW: The job has not been executed.
    • PENDING: The job is waiting for system scheduling.
    • BOOTING: The data to be migrated is being analyzed.
    • RUNNING: The job is running.
    • FAILED: The job failed.
    • SUCCEEDED: The job is executed successfully.

    creation-date

    Yes

    Timestamp

    Time when a job was executed

    creation-user

    Yes

    String

    User who created a job

    isStopingIncrement

    Yes

    Boolean

    Whether to stop incremental migration

    last-update-date

    Yes

    Timestamp

    Time when a job is updated

    is-execute-auto

    Yes

    Boolean

    Whether to execute a job at the scheduled time

    last-udpate-user

    Yes

    String

    Last user who updates the job status

    isDeleteJob

    Yes

    Boolean

    Whether to delete a job after the job is executed

    isIncrementing

    Yes

    Boolean

    Whether a job is an incremental migration job

    external-id

    Yes

    String

    Job ID

    counters

    No

    Dictionary

    Job running result statistics. This parameter is available only when status is SUCCEEDED. For details, see Description of the counters parameter.

    error-details

    No

    String

    Error details. This parameter is available only when status is FAILED.

    error-summary

    No

    String

    Error summary. This parameter is available only when status is FAILED.

  • Description of the counters parameter

    Parameter

    Mandatory

    Type

    Description

    org.apache.sqoop.submission.counter.SqoopCounters

    Yes

    List

    Job running result statistics. For details, see Description of org.apache.sqoop.submission.counter.SqoopCounters.

  • Description of org.apache.sqoop.submission.counter.SqoopCounters

    Parameter

    Mandatory

    Type

    Description

    ROWS_WRITTEN

    No

    Integer

    Number of rows that are written

    ROWS_READ

    No

    Integer

    Number of rows that are read

    BYTES_WRITTEN

    No

    Integer

    Number of bytes that are written

    BYTES_READ

    No

    Integer

    Number of bytes that are read

    TOTAL_SIZE

    No

    Integer

    Total number of bytes

    FILES_WRITTEN

    No

    Integer

    Number of files that are written

    FILES_READ

    No

    Integer

    Number of files that are read

    FILES_SKIPPED

    No

    Integer

    Number of files that are skipped

    TOTAL_FILES

    No

    Integer

    Total number of files

Return Value

  • Normal

    200

  • Abnormal

    Return Value

    Description

    400 Bad Request

    Request error. For details about the returned error code, see Error Code.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    No operation permission.

    404 Not Found

    The requested resource is not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.