• MapReduce Service

mrs
  1. Help Center
  2. MapReduce Service
  3. API Reference
  4. APIs
  5. Job Object APIs
  6. Querying the exe Object List of Jobs

Querying the exe Object List of Jobs

Function

This API is used to query the exe object list of all jobs. This API is incompatible with Sahara.

URI

  • Format:

    GET /v1.1/{project_id}/job-exes

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory or Not

    Description

    project_id

    Yes

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

    cluster_id

    No

    Cluster ID

    id

    No

    Job ID

    page_size

    No

    Maximum number of jobs displayed on a page

    The value ranges from 1 to 100.

    current_page

    No

    Current page number

    job_name

    No

    Job name

    state

    No

    Job status code

    • -1: Terminated
    • 2: Running
    • 3: Completed
    • 4: Abnormal

Request

  • Example:

    GET/v1.1/{project_id}/job-exes?page_size=10&current_page=1&state=3&job_name=myfirstjob

  • Parameter description

    None.

Response

  • Example:
    {
        "totalRecord": 14, 
        "job_executions": [
            {
                "id": "669476bd-89d2-45aa-8f1a-872d16de377e", 
                "create_at": 1484641003707, 
                "update_at": 1484641003707, 
                "tenant_id": "3f99e3319a8943ceb15c584f3325d064", 
                "job_id": "669476bd-89d2-45aa-8f1a-872d16de377e", 
                "job_name": "myfirstjob", 
                "start_time": 1484641003707, 
                "end_time": null, 
                "cluster_id": "2b460e01-3351-4170-b0a7-57b9dd5ffef3", 
                "group_id": "669476bd-89d2-45aa-8f1a-872d16de377e", 
                "jar_path": "s3a://jp-test1/program/hadoop-mapreduce-examples-2.4.1.jar", 
                "input": "s3a://jp-test1/input/", 
                "output": "s3a://jp-test1/output/", 
                "job_log": "s3a://jp-test1/joblogs/", 
                "job_type": 1, 
                "file_action": "", 
                "arguments": "wordcount", 
                "hql": "", 
                "job_state": 2, 
                "job_final_status": 1, 
                "hive_script_path": null, 
                "create_by": "3f99e3319a8943ceb15c584f3325d064", 
                "finished_step": 0, 
                "job_main_id": "", 
                "job_step_id": "", 
                "postpone_at": 1484641003174, 
                "step_name": "", 
                "step_num": 0, 
                "task_num": 0, 
                "update_by": "3f99e3319a8943ceb15c584f3325d064", 
                "spend_time": null, 
                "step_seq": 222, 
                "progress": "first progress"
            }
        ]
    }
  • Parameter description
    Table 2 Response parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    totalRecord

    Yes

    Integer

    Total number of jobs in a list

    job_executions

    Yes

    Array

    Job list parameter

    For details, see Table 3.

    Table 3 job_executions parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    id

    Yes

    String

    Job ID

    create_at

    Yes

    Integer

    Creation time, which is a 13-bit timestamp.

    update_at

    Yes

    Integer

    Update time, which is a 13-bit timestamp.

    tenant_id

    Yes

    String

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

    job_id

    Yes

    String

    Job ID of the YARN

    job_name

    Yes

    String

    Job name

    start_time

    Yes

    Integer

    Start time of job execution, which is a 13-bit timestamp.

    end_time

    Yes

    Integer

    End time of job execution, which is a 13-bit timestamp.

    cluster_id

    Yes

    String

    Cluster ID of a job

    group_id

    No

    String

    Group ID of a job

    jar_path

    No

    String

    Path of the .jar file or .sql file for program execution

    input

    No

    String

    Address for inputting data

    output

    No

    String

    Address for outputting data

    job_log

    No

    String

    Address for storing job logs

    job_type

    No

    Integer

    Job type code

    • 1: MapReduce
    • 2: Spark
    • 3: Hive Script
    • 4: HiveQL (not supported temporarily)
    • 5: DistCp
    • 6: Spark Script
    • 7: Spark SQL (Not supported in this API currently)

    file_action

    No

    String

    Data import and export

    arguments

    No

    String

    Key parameter for program execution. The parameter is specified by the function of the user's internal program. MRS is only responsible for loading the parameter. This parameter can be empty.

    hql

    No

    String

    HiveQL statement

    job_state

    Yes

    Integer

    Job status code

    • -1: Terminated
    • 2: Running
    • 3: Completed
    • 4: Abnormal

    job_final_status

    Yes

    Integer

    Job final status

    • 0: unfinished
    • 1: terminated due to an execution error
    • 2: executed successfully
    • 3: canceled

    hive_script_path

    Yes

    String

    Address of the Hive script

    create_by

    No

    String

    User ID for creating jobs

    finished_step

    No

    Integer

    Number of completed steps

    job_main_id

    No

    String

    Main ID of a job

    job_step_id

    No

    String

    Step ID of a job

    postpone_at

    No

    Integer

    Delay time, which is a 13-bit timestamp.

    step_name

    No

    String

    Step name of a job

    step_num

    No

    Integer

    Number of steps

    task_num

    No

    Integer

    Number of tasks

    update_by

    No

    String

    User ID for updating jobs

    spend_time

    No

    Integer

    Duration of job execution (unit: s)

    step_seq

    No

    Integer

    Step sequence of a job

    progress

    No

    String

    Job execution progress

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status Code

Description

200

The exe object list of jobs is queried successfully.

For the description about error status codes, see section Status Codes.