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. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListFlowJobHistory

The operation that you want to perform. This parameter is required for API requests that you create by piecing together HTTP or HTTPS URLs. Set the value to ListFlowJobHistory.

ProjectId String Yes FP-257A173659F5****

The ID of the project. You can call ListFlowProject View the ID of the project.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call DescribeRegions To view the latest list of Alibaba Cloud regions.

Id String No FJ-BCCAE48B90CC****

The ID of the job. You can call ListFlowJob View data on the Member Management page.

StatusList.N RepeatList No ["FAILED"]

The status of the job instance. Valid values:

  • SUBMITTED: SUBMITTED
  • RUNNING
  • SUCCESS: execution successful
  • FAILED: execution FAILED
  • KILL_FAILED: termination failed
  • KILL_SUCCESS: termination succeeded
JobType String No SHELL

The type of the job. Valid values: 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 ECS instance that is added to the ACK cluster. You can call ListFlowNodeInstance View the ID of the node instance.

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

The time range parameter for the query. List of parameters:

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

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

PageSize Integer No 20

The number of entries returned per page.

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****

Of the initiator application ID.

ExternalInfo String empty

The external information. For example, the error diagnosis information of running jobs.

ExternalStatus String SUCCESS

The status of the Container corresponding to the instance:

  • SUBMITTED: SUBMITTED
  • RUNNING
  • SUCCESS: execution successful
  • FAIL: execution failed
  • KILL_FAIL: termination failed
  • KILL_SUCCESS: termination succeeded
FailAct String STOP

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

  • STOP: terminates the workflow.
  • CONTINUE: Skip
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 run. You can log on to the host to 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: execution successful
  • FAILED: execution FAILED
  • KILLED: Terminated
  • KILL_FAILED: termination failed
  • START_RETRY: retries started.
Type String JOB

The type of the node. Valid values:

  • JOB: JOB
  • CLUSTER: CLUSTER
  • START: START
  • END: END
pending Boolean false

End or not:

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

The number of the returned page.

PageSize Integer 20

The number of automatic snapshot tasks returned per page.

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 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 Syntax

{
    "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****"
            }
        ]
    }
}