You can call the ListFlowJob operation to query jobs.

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 ListFlowJob

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 ListFlowJob.

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

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

Name String No my_shell_job

The name of the job.

Type String No SHELL

The type of the job. Valid values: MR, SPARK, HIVE_SQL, HIVE, PIG, SQOOP, SPARK_SQL, SPARK_STREAMING, and SHELL.

Adhoc Boolean No false

Indicates whether the job is a temporary query job.

PageNumber Integer No 1

The page number of the returned page.

PageSize Integer No 20

The page number of the returned page.

Response parameters

Parameter Type Example Description
JobList Array of Job

The list of jobs.

Job
Adhoc String false

Indicates whether the job is a temporary query job.

AlertConf String "{\"items\":[{\"enable\":true,\"eventId\":\"EMR-210401001\",\"alertUserGroupIdList\":[\"AUG-52dabfbbca654b52aae05ac5acd9a0f0\"],\"alertDingDingGroupList\":[\"ADG-2c411c452e6b467b9a59fadf21d195ad\"]}]}"

The alert settings for the job instance.

CategoryId String FC-5BD9575E34623940

The directory ID of the job.

CustomVariables String "{\"scope\":\"PROJECT\",\"entityId\":\"FP-80C2FDDBF35D9CC5\",\"variables\":[{\"name\":\"v1\",\"value\":\"1\",\"properties\":{\"password\":true}}]}"

The custom variables configured for the job.

Description String This is the description of a job

The description of the job.

EnvConf String {"key":"value"}

The environment variables configured for the job.

FailAct String STOP

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

  • CONTINUE: skips the node instance
  • STOP: stops the workflow instance
GmtCreate Long 1538017814000

The creation time of the job.

GmtModified Long 1538017814000

The modification time of the job.

Id String FJ-BCCAE48B90CCB37B

The ID of the job.

LastInstanceDetail String ""

A deprecated parameter.

MaxRetry Integer 5

The maximum number of retries of running the node instance when a failure occurs.

MonitorConf String {"inputs":[{"type":"KAFKA","clusterId":"C-1234567","topics":"kafka_topic","consumer.group":"kafka_consumer_group"}],"outputs":[{"type":"KAFKA","clusterId":"C-1234567","topics":"kafka_topic"}]}

Monitoring configuration, only SPARK_STREAMING Type job support.

Name String my_shell_job

The name of the job.

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

The configuration parameters of the job.

Params String ls -l

The content of the job.

ResourceList Array of Resource

The resources configured for the job.

Resource
Alias String demo.jar

The alias of the resource.

Path String oss://path/demo.jar

The storage path of the resource.

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.

Type String SHELL

The type of the job. Valid values: MR, SPARK, HIVE_SQL, HIVE, PIG, SQOOP, SPARK_SQL, SPARK_STREAMING, and SHELL.

mode String YARN

The submission mode of the job. Valid values: YARN and LOCAL.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 20

The page number of the returned page.

RequestId String 7D2B1B2E-8D89-49C1-8D31-097C83879D20

The ID of the request.

Total Integer 11

The total number of returned entries.

Examples

Sample requests

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

Sample success responses

XML format

<PageSize>2</PageSize>
<RequestId>B83F5335-C8BF-47E9-9DE2-AC1C5E1B3D39</RequestId>
<PageNumber>1</PageNumber>
<Total>6</Total>
<JobList>
    <Job>
        <FailAct>STOP</FailAct>
        <CategoryId>FC-BF013F34DE39****</CategoryId>
        <Description>success</Description>
        <GmtModified>1542957519000</GmtModified>
        <Params>sleep 10;
exit 0;</Params>
        <MaxRetry>0</MaxRetry>
        <Name>success</Name>
        <ResourceList>
        </ResourceList>
        <Type>SHELL</Type>
        <GmtCreate>1542957478000</GmtCreate>
        <Adhoc>false</Adhoc>
        <RetryInterval>15</RetryInterval>
        <Id>FJ-31BD66C7BC50****</Id>
    </Job>
    <Job>
        <FailAct>STOP</FailAct>
        <CategoryId>FC-54C10B119442****</CategoryId>
        <Description>fail</Description>
        <GmtModified>1542958715000</GmtModified>
        <Params>sleep 10;
exit 1;</Params>
        <MaxRetry>0</MaxRetry>
        <Name>fail</Name>
        <ResourceList>
        </ResourceList>
        <Type>SHELL</Type>
        <GmtCreate>1542957560000</GmtCreate>
        <Adhoc>false</Adhoc>
        <RetryInterval>15</RetryInterval>
        <Id>FJ-A200F16108CA****</Id>
    </Job>
</JobList>

JSON Syntax

{
    "PageSize": 2,
    "RequestId": "B83F5335-C8BF-47E9-9DE2-AC1C5E1B3D39",
    "PageNumber": 1,
    "Total": 6,
    "JobList": {
        "Job": [
            {
                "FailAct": "STOP",
                "CategoryId": "FC-BF013F34DE39****",
                "Description": "success",
                "GmtModified": 1542957519000,
                "Params": "sleep 10;\nexit 0;",
                "MaxRetry": 0,
                "Name": "success",
                "ResourceList": {
                    "Resource": []
                },
                "Type": "SHELL",
                "GmtCreate": 1542957478000,
                "Adhoc": false,
                "RetryInterval": 15,
                "Id": "FJ-31BD66C7BC50****"
            },
            {
                "FailAct": "STOP",
                "CategoryId": "FC-54C10B119442****",
                "Description": "fail",
                "GmtModified": 1542958715000,
                "Params": "sleep 10;\nexit 1;",
                "MaxRetry": 0,
                "Name": "fail",
                "ResourceList": {
                    "Resource": []
                },
                "Type": "SHELL",
                "GmtCreate": 1542957560000,
                "Adhoc": false,
                "RetryInterval": 15,
                "Id": "FJ-A200F16108CA****"
            }
        ]
    }
}