Get Flow Instance¶
获取指定的任务流实例信息。
前提条件¶
用户必须为EnOS用户。
请求格式¶
GET https://{apigw-address}/dataflow-batch-service/v2.0/flowInstances
请求参数(URI)¶
名称 | 位置(Path/Query) | 必需/可选 | 数据类型 | 描述 |
---|---|---|---|---|
flowInstId | Query | 必需 | String | 任务流实例ID(ID可通过 List Flow Instances 接口获取)。 |
userId | Query | 必需 | String | 用户ID。如何获取userId信息>> |
orgId | Query | 必需 | String | 用户所属的组织ID。如何获取orgId信息>> |
action | Query | 必需 | String | 固定值:get |
响应参数¶
名称 | 数据类型 | 描述 |
---|---|---|
data | List<JSONObject> | 包含任务流实例的所有信息。详见 FlowInstance结构体 |
FlowInstance结构体¶
示例¶
{
"instanceId": "2438-201907261239",
"flowId": 2438,
"flowName": "rew",
"freq": "0 1/1 * * * ? *",
"cycle": "mi",
"parameters": "[]",
"doAs": "your_bd_account",
"graph": "{\"creator\":\"yourCreator\",\"freq\":\"0 1/1 * * * ? *\",\"alertMode\":3,\"owners\":\"yourOwners\",\"cycle\":\"mi\",\"do_as\":\"yourDoAs\",\"flows\":[],\"alertTo\":\"\",\"name\":\"rew\",\"instId\":\"2438-201907261239\",\"id\":2438,\"relations\":[],\"parameters\":\"[]\",\"app_id\":\"\",\"tasks\":[{\"taskName\":\"fr\",\"taskInstId\":\"104452-201907261239\",\"x\":0.0198,\"y\":0.0045,\"taskId\":104452,\"nodeId\":\"t_104452\",\"status\":\"SUCCESS\"}]}",
"status": 0,
"statusDesc": "INIT",
"triggerTime": "2019-07-26 20:39:00",
"startTime": "2019-07-26 12:39:37",
"endTime": "2019-07-26 12:39:42",
"timestamp": "2019-07-26 12:38:30.0",
"virtual": false,
"owner": "yourOwners",
"alertMode": 3,
"calDt": "2019-07-25",
"hasEditPri": false,
"hasReadPri": true
}
参数¶
名称 | 数据类型 | 描述 |
---|---|---|
instanceId | String | 任务流实例ID。 |
flowId | Integer | 任务流ID。 |
flowName | String | 任务流名称。 |
freq | String | 任务流调度周期。调度中使用的是七位的Crontab,概括而言,Crontab可以指定某个事件在其指定的时间点被触发,比如:c1 (0 1 * * * ? *) 定义了事件在每个小时的1分0秒触发,c2 (59 59 23 * * ? *) 定义了事件在每天的23时59分59秒触发。有关Crontab的更多配置,详见 http://cron.qqe2.com/ |
cycle | String | 调度周期(M:月;W:周;D:天;H:小时;mi:分钟)。 |
parameters | List<Map<key,value>> | 调度参数。作为统一配置的全局参数,可以在节点内使用这些参数,以使任务运行时能动态适配环境变化(参数需要以 key-value 的格式表达,例如:[{"key":"env","value":"product"},{"key":"task_id","value":"123456"}] )。 |
doAs | String | 任务流所属组织的大数据账号。 |
graph | List<JSONObject> | 任务流实例中的任务依赖关系信息,详见 InstanceGraph结构体 |
status | Integer | 任务运行状态。 |
statusDesc | String | 任务运行状态描述。 |
triggerTime | String | 计划触发时间。 |
startTime | String | 开始运行时间。 |
endTime | String | 结束运行时间。 |
timestamp | String | 时间戳。 |
virtual | Boolean | 是否为虚任务流实例。 |
owner | String | 任务流实例负责人。 |
alertMode | Integer | 告警模式(0:无, 1:仅邮件告警, 2:仅短信告警, 3:邮件与短信告警)。 |
calDt | String | 业务日期。 |
hasEditPri | Boolean | 是否具有编辑权限。 |
hasReadPri | Boolean | 是否具有读取权限。 |
InstanceGraph结构体¶
示例¶
{
"creator":"creator_id",
"freq":"0 0 0 * * ? *",
"alertMode":3,
"owners":"owner_id",
"cycle":"D",
"doAs":"your_bd_account",
"flows":[],
"alertTo":"",
"name":"21",
"instId":"2809-20190812080700",
"id":2809,
"relations":[],
"parameters":"[]",
"appId":"",
"tasks":
[{
"taskName":"tass",
"taskInstId":"104890-20190812080700",
"x":0.002,
"y":0.002,
"taskId":104890,
"nodeId":"t_104890",
"status":"CANCEL"}]
}
参数¶
名称 | 数据类型 | 描述 |
---|---|---|
creator | String | 任务流实例创建者名称。 |
freq | String | 任务流调度周期。调度中使用的是七位的Crontab,概括而言,Crontab可以指定某个事件在其指定的时间点被触发,比如:c1 (0 1 * * * ? *) 定义了事件在每个小时的1分0秒触发,c2 (59 59 23 * * ? *) 定义了事件在每天的23时59分59秒触发。有关Crontab的更多配置,详见 http://cron.qqe2.com/ |
alertMode | Integer | 告警模式(0:无, 1:仅邮件告警, 2:仅短信告警, 3:邮件与短信告警)。 |
owners | String | 任务流实例所有者(负责人)的用户名(多个owner之间以 ; 分开,例如owners=“userNameA;userNameB”)。 |
cycle | String | 调度周期(M:月;W:周;D:天;H:小时;mi:分钟)。 |
doAs | String | 任务流所属组织的大数据账号。 |
flows | JSONObject | 任务流实例中依赖的其他任务流实例信息。详见 FlowInstanceGraph结构体 |
alertTo | String | 告警目标。 |
name | String | 任务流名称。 |
instId | String | 任务流实例ID。 |
id | Integer | 任务流ID。 |
relations | List<Relation> | 任务关连线集合,集合中每个元素表示任务流中两个任务具有上下游数据关系。详见 Relation结构体 |
parameters | List<Map<key,value>> | 调度参数。作为统一配置的全局参数,可以在节点内使用这些参数,以使任务运行时能动态适配环境变化(参数需要以 key-value 的格式表达,例如:[{"key":"env","value":"product"},{"key":"task_id","value":"123456"}] )。 |
appId | String | N/A,通常为空字符串。 |
tasks | JSONObject | 任务流实例中所有任务实例信息。详见 TaskInstanceGraph结构体 |
FlowInstanceGraph结构体¶
示例¶
{
"flowId": "2809",
"flowName": "21",
"nodeId": "f_2809",
"isVirtual": false,
"x": 0.0125,
"y": 0.0015,
"flowInstId": "2809-20190812101300",
"status": "NONE"
}
参数¶
名称 | 数据类型 | 描述 |
---|---|---|
flowId | Integer | 任务流ID。 |
flowName | String | 任务流名称。 |
nodeId | String | 作为其他任务流节点的节点ID。 |
isVirtual | Boolean | 是否为虚任务流。 |
x | Double | 作为节点在当前任务流配置面板中的位置,x坐标。 |
y | Double | 作为节点在当前任务流配置面板中的位置,y坐标。 |
flowInstId | String | 任务流实例ID。 |
TaskInstanceGraph结构体¶
示例¶
{
"taskName": "tass",
"taskInstId": "105048-20190812101300",
"x": 0.0132,
"y": 0.008100000381469727,
"taskId": "104575",
"nodeId": "t_104575",
"status": "INIT"
}
参数¶
名称 | 数据类型 | 描述 |
---|---|---|
taskName | String | 任务名称。 |
taskInstId | String | 任务实例ID。 |
x | Double | 任务在面板中的位置信息,x坐标。 |
y | Double | 任务在面板中的位置信息,y坐标。 |
taskId | String | 任务ID。 |
nodeId | String | 节点ID(注意:不同于任务ID。任务流中既可以有任务节点,也可以有相依赖的任务流节点,都作为该任务流的一个节点,具有唯一的节点ID)。 |
status | String | 任务实例状态。 |
示例¶
请求示例¶
url: https://{apigw-address}/dataflow-batch-service/v2.0/flowInstances?action=get&flowInstId=2809-20190808093200&userId={}&orgId={}
method: GET
返回示例¶
{
"status": 0,
"msg": "SUCCESS",
"data": {
"instanceId": "2809-20190808093200",
"flowId": 2809,
"flowName": "21",
"freq": "0 0 0 * * ? *",
"cycle": "D",
"parameters": "[]",
"doAs": "your_bd_account",
"graph": "{\"creator\":\"yourCreator\",\"freq\":\"0 1/1 * * * ? *\",\"alertMode\":3,\"owners\":\"yourOwners\",\"cycle\":\"mi\",\"do_as\":\"yourDoAs\",\"flows\":[],\"alertTo\":\"\",\"name\":\"rew\",\"instId\":\"2438-201907261239\",\"id\":2438,\"relations\":[],\"parameters\":\"[]\",\"app_id\":\"\",\"tasks\":[{\"taskName\":\"fr\",\"taskInstId\":\"104452-201907261239\",\"x\":0.0198,\"y\":0.0045,\"taskId\":104452,\"nodeId\":\"t_104452\",\"status\":\"SUCCESS\"}]}",
"status": 1,
"statusDesc": "SUCCESS",
"triggerTime": "2019-08-08 09:32:12",
"startTime": "2019-08-08 09:32:30",
"endTime": "2019-08-08 09:32:32",
"timestamp": "2019-08-08 09:34:36.0",
"virtual": false,
"owner": "yourOwners",
"alertMode": 3,
"calDt": "2019-08-07",
"hasEditPri": true,
"hasReadPri": true
}
}