You can call this 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-257A173659F59685

The ID of the project.

RegionId String Yes cn-hangzhou

The ID of the region where your project resides.

Id String No FJ-BCCAE48B90CCB37B

The ID of the job.

InstanceId String No FJI-BCCAE48B90CCB37B

The ID of the job instance.

JobType String No SHELL

The type of the job.

PageNumber Integer No 1

The number of the page to return.

PageSize Integer No 20

The number of entries to return on each page.

StatusList.N RepeatList No ["FAILED"]

The status of the job instance. Valid values:

  • FAILED
  • KILLED
  • KILL_FAILED
  • PREP
  • SUBMITTING
  • RUNNING
  • START_RETRY
  • OK
  • DONE
  • TIMEOUT
TimeRange String No {"type":"range","from":1564416000000,"to":1567008000000}

The time range for querying the job instance.

Response parameters

Parameter Type Example Description
NodeInstances

The list of job instances.

NodeInstance

The information of the job instance.

ClusterId String C-A6C9F4F1E9EC88D9

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_34027

The ID of the launcher application.

ExternalInfo String empty

The external information of the job instance, such as the error diagnosis information of the job instance.

ExternalStatus String SUCCESS

The external status of the job instance. Valid values:

  • SUBMITTED: The job instance is submitted.
  • RUNNING: The job instance is running.
  • SUCCESS: The execution of the job instance succeeded.
  • FAIL: The execution of the job instance failed.
  • KILL_FAIL: The termination of the job instance failed.
  • KILL_SUCCESS: The termination of the job instance succeeded.
FailAct String STOP

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

  • STOP: stops the workflow instanceCONTINUE: skips the node instance)
GmtCreate Long 1540796236000

The creation time of the job.

GmtModified Long 1540796247000

The modification time of the job.

HostName String emr-header-1.cluster-12345

The name of the host on which the job instance is running. The host can be a master host or a gateway host. The format of the hostname is emr-header-1.cluster-12345. You can use the hostname command to view this parameter value.

Id String FNI-9D14A7CCF2687B84

The ID of the job instance.

JobId String FJ-A23BD131A862F184

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 retries of running the node instance when a failure occurs.

NodeName String Empty

The name of the node.

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

The configuration parameters of the job.

ProjectId String FP-3535FE0BE5224A47

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 of running the node instance.

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 submitted 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 status of the job instance. Valid values:

  • PREP: The job instance is being prepared.
  • SUBMITTING: The job instance is being submitted.
  • RUNNING: The job instance is running.
  • DONE: The execution of the job instance completed.
  • OK: The execution of the job instance succeeded.
  • FAILED: The execution of the job instance failed.
  • KILLED: The job instance is terminated.
  • KILL_FAILED: The termination of the job instance failed.
  • START_RETRY: The job instance is restarting.
Type String JOB

The type of the node. Valid values:

  • JOB: job node
  • CLUSTER: cluster node
  • START: start node
  • END: end node
pending Boolean false

Indicates whether the job instance execution ended.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 20

The number of entries returned per page.

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

The ID of the request.

Total Integer 12

The total number of entries returned.

Examples

Sample requests


http(s)://[Endpoint]/? Action=ListFlowJobHistory
&Id=FJ-BCCAE48B90CCB37B
&ProjectId=FP-257A173659F59685
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<ListFlowJobHistoryResponse>
  <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_0003</ExternalId>
			      <pending>false</pending>
			      <JobName>success</JobName>
			      <GmtModified>1542957514000</GmtModified>
			      <StartTime>1542957499000</StartTime>
			      <ProjectId>FP-17AB3389E1AD9A34</ProjectId>
			      <MaxRetry>0</MaxRetry>
			      <ParamConf>{"cyctime":"2018-11-23 15:18:19"}</ParamConf>
			      <ExternalStatus>SUCCESS</ExternalStatus>
			      <GmtCreate>1542957499000</GmtCreate>
			      <JobType>SHELL</JobType>
			      <ExternalInfo></ExternalInfo>
			      <Retries>0</Retries>
			      <RetryInterval>0</RetryInterval>
			      <Id>FJI-F4FC53D7207E****</Id>
			      <HostName>emr-header-2.cluster-50016****</HostName>
			      <JobId>FJ-31BD66C7BC502815</JobId>
		    </NodeInstance>
	  </NodeInstances>
	

</ListFlowJobHistoryResponse>

JSON format

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

Error codes

For a list of error codes, visit the API Error Center.