You can call the ListFlowJobHistory operation to query job instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListFlowJobHistory

The operation that you want to perform. Set the value to ListFlowJobHistory.

ProjectId String Yes FP-257A173659F5****

The ID of the project. You can call the ListFlowProject to view the ID of the project.

RegionId String Yes cn-hangzhou

The ID of the region. You can call the DescribeRegions operation to query the most recent region list.

Id String No FJ-BCCAE48B90CC****

The ID of the job. You can call the ListFlowJob view.

StatusList.N RepeatList No ["FAILED"]

status list. Valid values:

  • SUBMITTED: Submitted
  • RUNNING
  • SUCCESS: The execution is successful.
  • FAILED: Execution failed
  • KILL_FAILED: The termination failed.
  • KILL_SUCCESS: The termination is successful.
JobType String No SHELL

The type of the job. Supported: SPARK_SQL, SPARK_STREAMING, MR, SQOOP, PIG, FLINK, STREAMING_SQL, IMPALA_SQL, PRESTO_SQL, SPARK, Hive_SQL, Hive, SHELL, and SPARK_SHELL.

InstanceId String No FJI-BCCAE48B90CC****

The ID of the job instance. You can call the DescribeFlowJob to view the job instance ID.

TimeRange String No {"type":"range","from":1564416000000,"to":1567008000000}

The time range parameter to query. Parameter list:

  • type:range
  • from: start time (long)
  • to: end time (long)
PageNumber Integer No 1

The number of the page to return. Pages start from page 1.

PageSize Integer No 20

The number of rows to return on each page for a paged query.

Response parameters

Parameter Type Example Description
NodeInstances Array of NodeInstance

The list of job instances.

NodeInstance
ClusterId String C-A6C9F4F1E9EC****

The ID of the cluster.

EndTime Long 1540796248000

The time when the execution of the job instance ended.

EnvConf String {"key":"value"}

The environment variables configured for the job.

ExternalId String application_1541559535023_3****

The application ID of the initiator.

ExternalInfo String empty

External information. For example, error diagnostic information for running a job.

ExternalStatus String SUCCESS

The status of the container corresponding to the instance. Valid values:

  • SUBMITTED: Submitted
  • RUNNING
  • SUCCESS: The execution is successful.
  • FAIL: The execution failed.
  • KILL_FAIL: The termination failed.
  • KILL_SUCCESS: The termination is successful.
FailAct String STOP

The action to take upon an operation failure of the node instance. Valid values:

  • STOP: Terminates the current workflow upon failure.
  • CONTINUE: skips the current workflow if it fails.
GmtCreate Long 1540796236000

The creation time of the project.

GmtModified Long 1540796247000

The time when the workflow node instance was modified.

HostName String emr-header-1.cluster-12345

The name of the host where the node instance is running. You can log on to the host and use the hostname command to view the hostname.

Id String FJI-F4FC53D7207E****

The ID of the job instance.

JobId String FJ-A23BD131A862****

The ID of the job.

JobName String myJob

The name of the job.

JobParams String ls -l

The content of the job.

JobType String HIVE_SQL

The type of the job.

MaxRetry Integer 0

The maximum number of times the job can be retried.

NodeName String Empty

The name of the node.

ParamConf String {"date":"${yyyy-MM-dd}"}

The configuration parameters of the job.

ProjectId String FP-3535FE0BE522****

The ID of the project.

Retries Integer 0

The number of retries of running the node instance.

RetryInterval Long 200

The interval between successive retries to run the node instance. Valid values: 0 to 300. Unit: seconds.

RunConf String {"priority":1,"userName":"hadoop","memory":2048,"cores":1}

The scheduling parameters configured for the job.

  • priority: the priority of the job.
  • userName: the name of the Linux user who summits the job.
  • memory: the memory allocated to the job. Unit: MB.
  • cores: the number of vCPUs allocated to the job.
StartTime Long 1540796237000

The time when the execution of the job instance started.

Status String OK

The execution status of the instance. Valid values:

  • PREP: waiting to start
  • SUBMITTING: Submitting
  • RUNNING
  • DONE: completed
  • OK: The execution is successful
  • FAILED: Execution failed
  • KILLED: terminated
  • KILL_FAILED: The termination failed
  • START_RETRY: starts to retry
Type String JOB

The type of the node. Valid values:

  • JOB: job
  • CLUSTER: cluster
  • START: Start
  • END: End
pending Boolean false

Whether to end:

  • true: End
  • false: does not end
PageNumber Integer 1

The page number of the returned page.

PageSize Integer 20

The number of rows to return on each page for a paged query.

RequestId String F5540D8F-06E8-4E3C-B47A-D75CED72A795

The ID of the request.

Total Integer 12

The total number of returned entries.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListFlowJobHistory
&ProjectId=FP-257A173659F5****
&RegionId=cn-hangzhou
&<Common request parameters>|

Sample success responses

XML format

<PageSize>10</PageSize>
<RequestId>BCF52B64-007F-4883-BAEA-0499106D07C2</RequestId>
<PageNumber>1</PageNumber>
<Total>1</Total>
<NodeInstances>
    <NodeInstance>
        <FailAct>STOP</FailAct>
        <Status>OK</Status>
        <EndTime>1542957514000</EndTime>
        <ClusterId>C-A6C9F4F1E9EC****</ClusterId>
        <ExternalId>application_1542955685866_****</ExternalId>
        <pending>false</pending>
        <JobName>success</JobName>
        <GmtModified>1542957514000</GmtModified>
        <StartTime>1542957499000</StartTime>
        <ProjectId>FP-17AB3389E1AD****</ProjectId>
        <MaxRetry>0</MaxRetry>
        <ParamConf>{"cyctime":"2018-11-23 15:18:19"}</ParamConf>
        <ExternalStatus>SUCCESS</ExternalStatus>
        <GmtCreate>1542957499000</GmtCreate>
        <JobType>SHELL</JobType>
        <ExternalInfo/>
        <Retries>0</Retries>
        <RetryInterval>0</RetryInterval>
        <Id>FJI-F4FC53D7207E****</Id>
        <HostName>emr-header-2.cluster-50016****</HostName>
        <JobId>FJ-31BD66C7BC50****</JobId>
    </NodeInstance>
</NodeInstances>

JSON format

{
    "PageSize": 10,
    "RequestId": "BCF52B64-007F-4883-BAEA-0499106D07C2",
    "PageNumber": 1,
    "Total": 1,
    "NodeInstances": {
        "NodeInstance": [
            {
                "FailAct": "STOP",
                "Status": "OK",
                "EndTime": 1542957514000,
                "ClusterId": "C-A6C9F4F1E9EC****",
                "ExternalId": "application_1542955685866_****",
                "pending": false,
                "JobName": "success",
                "GmtModified": 1542957514000,
                "StartTime": 1542957499000,
                "ProjectId": "FP-17AB3389E1AD****",
                "MaxRetry": 0,
                "ParamConf": "{\"cyctime\":\"2018-11-23 15:18:19\"}",
                "ExternalStatus": "SUCCESS",
                "GmtCreate": 1542957499000,
                "JobType": "SHELL",
                "ExternalInfo": "",
                "Retries": 0,
                "RetryInterval": 0,
                "Id": "FJI-F4FC53D7207E****",
                "HostName": "emr-header-2.cluster-50016****",
                "JobId": "FJ-31BD66C7BC50****"
            }
        ]
    }
}