通用参数

接口参数

字段 类型 必选 描述
project_id int 项目ID
name string 任务名称
pipeline_tree dict 任务实例树,详细信息请见下面说明
flow_type string 任务流程类型,common: 常规流程,common_func:职能化流程,默认值为common
description string 任务描述
category string 任务分类,详细信息请见下面说明
scope string project_id 检索的作用域。默认为 cmdb_biz,此时检索的是绑定的 CMDB 业务 ID 为 bk_biz_id 的项目;当值为 project 时则检索项目 ID 为 project_id 的项目

category

描述
OpsTools 运维工具
MonitorAlarm 监控告警
ConfManage 配置管理
DevTools 开发工具
EnterpriseIT 企业IT
OfficeApp 办公应用
Other 其它

pipeline_tree

字段 类型 必选 描述
start_event dict 开始节点,详细信息请见下面说明
end_event dict 结束节点,详细信息请见下面说明
activities dict 任务节点(标准插件和子流程),详细信息请见下面说明
flows dict 顺序流(节点连线),详细信息请见下面说明
gateways dict 网关节点(并行网关、分支网关和汇聚网关),详细信息请见下面说明
constants dict 全局变量,详细信息请见下面说明
outputs list 输出参数,标记 constants 中的输出字段

pipeline_tree.start_event

pipeline_tree.end_event

字段 类型 必选 描述
id string 结束节点 ID,在 pipeline_tree 所有ID中全局唯一
type string 结束节点类型,当前只支持 EmptyEndEvent:空结束类
name string 结束节点名称,可为空
incoming string 入度顺序流 ID
outgoing string 出度顺序流 ID,必须为空字符串

pipeline_tree.activities KEY、pipeline_tree.flows KEY、pipeline_tree.gateways KEY

pipeline_tree.activities VALUE

字段 类型 必选 描述
id string 任务节点 ID,同 KEY 一致
type string 任务节点类型,当前只支持 ServiceActivity:标准插件节点
name string 任务节点名称
component dict 插件配置,详细信息请见下面说明
error_ignorable bool 节点失败是否自动忽略
retryable bool 节点失败后是否可以重试,error_ignorable 为 true 时该参数无效
skippable bool 节点失败后是否可以跳过,error_ignorable 为 true 时该参数无效
incoming string 入度顺序流 ID
outgoing string 出度顺序流 ID
stage_name string 步骤分组名称

pipeline_tree.activities VALUE.component

字段 类型 必选 描述
code string 标准插件编码
data dict 标准插件输入参数

pipeline_tree.flows VALUE

pipeline_tree.gateways VALUE

字段 类型 必选 描述
id string 网关节点 ID,同 KEY 一致
type string 网关类型,ParallelGateway:并行网关,ExclusiveGateway:分支网关,ConvergeGateway:汇聚网关
name string 网关节点名称,可为空
incoming string/list 入度顺序流 ID,type 为 ConvergeGateway 时是 list,否则是 string
outgoing string/list 出度顺序流 ID,type 为 ConvergeGateway 时是 string,否则是 list
conditions dict 分支条件,type 为 ExclusiveGateway 必填, 详细信息请见下面说明

pipeline_tree.gateways VALUE.conditions KEY

pipeline_tree.gateways VALUE.conditions VALUE

字段 类型 必选 描述
evaluate string 分支表达式,支持的语法请参考产品白皮书等文档

pipeline_tree.constants KEY

pipeline_tree.constants VALUE

字段 类型 必选 描述
key string 同 KEY 一致
name string 变量名字
index int 变量在任务中的显示顺序
desc string 变量说明
source_type string 变量来源, 取值范围 custom: 自定义变量,component_inputs: 从标准插件输入参数勾选,component_outputs:从标准插件输出结果中勾选
custom_type string source_type=custom 时有效,自定义变量类型, 取值范围 input: 输入框,textarea: 文本框,datetime: 日期时间,int: 整数
source_tag string source_type=component_inputs 或 component_outputs 时有效,变量的来源插件和 Tag
source_info dict source_type=component_inputs 或 component_outputs 时有效,变量的来源节点信息
  1. "result": true,
  2. "data": {
  3. "task_id": 10,
  4. "task_url": "http://bk_sops_host/taskflow/execute/3/?instance_id=10",
  5. "pipeline_tree": {
  6. "start_event": {
  7. "incoming": "",
  8. "outgoing": "line7ed74aa679d19063b6d7037ce6db",
  9. "type": "EmptyStartEvent",
  10. "id": "node20cbeaa5379d08e8d8ed7bb44fdc",
  11. "name": ""
  12. },
  13. "activities": {
  14. "node5310ec36c0364d3094d515f8f5ef": {
  15. "outgoing": "linec02d1e77e1076aa9c7c2c57238e4",
  16. "incoming": "line7ed74aa679d19063b6d7037ce6db",
  17. "name": "node1",
  18. "error_ignorable": false,
  19. "component": {
  20. "code": "sleep_timer",
  21. "data": {
  22. "bk_timing": {
  23. "hook": true,
  24. "value": "${bk_timing}"
  25. }
  26. }
  27. },
  28. "stage_name": "stage1",
  29. "retryable": true,
  30. "skippable": true,
  31. "type": "ServiceActivity",
  32. "id": "node5310ec36c0364d3094d515f8f5ef"
  33. },
  34. "node2bf42efcebe266706c3e21326dc4": {
  35. "outgoing": "linef0deadac69f769440a1b0e32587e",
  36. "incoming": "line7587c8804d34a091dae3d321f081",
  37. "name": "node2",
  38. "error_ignorable": false,
  39. "component": {
  40. "code": "sleep_timer",
  41. "data": {
  42. "bk_timing": {
  43. "hook": true,
  44. "value": "${bk_timing}"
  45. }
  46. }
  47. },
  48. "stage_name": "stage2",
  49. "retryable": true,
  50. "skippable": true,
  51. "type": "ServiceActivity",
  52. "id": "node2bf42efcebe266706c3e21326dc4"
  53. },
  54. "node3c7dcf31454c1e9bdc9cf1cdeacc": {
  55. "outgoing": "linebf8f91c96a8f4eb3794ca5eb9881",
  56. "incoming": "line429f64cdec5d20f368611e621ef5",
  57. "name": "node3",
  58. "error_ignorable": false,
  59. "component": {
  60. "code": "sleep_timer",
  61. "data": {
  62. "hook": false,
  63. "value": "3"
  64. }
  65. }
  66. },
  67. "stage_name": "stage3",
  68. "retryable": true,
  69. "skippable": true,
  70. "type": "ServiceActivity",
  71. "id": "node3c7dcf31454c1e9bdc9cf1cdeacc"
  72. },
  73. "nodedb1478a75c13f90cc400f5379949": {
  74. "outgoing": "line24d28a3f9f80e23e4a4fab7c4ffd",
  75. "name": "node4",
  76. "error_ignorable": false,
  77. "component": {
  78. "code": "sleep_timer",
  79. "data": {
  80. "bk_timing": {
  81. "hook": true,
  82. "value": "${bk_timing}"
  83. }
  84. }
  85. },
  86. "stage_name": "stage3",
  87. "retryable": true,
  88. "skippable": true,
  89. "type": "ServiceActivity",
  90. "id": "nodedb1478a75c13f90cc400f5379949"
  91. }
  92. },
  93. "end_event": {
  94. "incoming": "line6ea858554964a04d868cead4435a",
  95. "outgoing": "",
  96. "type": "EmptyEndEvent",
  97. "id": "nodebe0db4ad30cc1723c7ede37b4b5f",
  98. "name": ""
  99. },
  100. "flows": {
  101. "line24d28a3f9f80e23e4a4fab7c4ffd": {
  102. "is_default": false,
  103. "source": "nodedb1478a75c13f90cc400f5379949",
  104. "id": "line24d28a3f9f80e23e4a4fab7c4ffd",
  105. "target": "node947e423b22e49aeb77bc77528bc0"
  106. },
  107. "linebf8f91c96a8f4eb3794ca5eb9881": {
  108. "is_default": false,
  109. "source": "node3c7dcf31454c1e9bdc9cf1cdeacc",
  110. "id": "linebf8f91c96a8f4eb3794ca5eb9881",
  111. "target": "node947e423b22e49aeb77bc77528bc0"
  112. },
  113. "line7587c8804d34a091dae3d321f081": {
  114. "is_default": false,
  115. "source": "node0863aab8325b84cfa3e5db52dc61",
  116. "id": "line7587c8804d34a091dae3d321f081",
  117. "target": "node2bf42efcebe266706c3e21326dc4"
  118. },
  119. "line429f64cdec5d20f368611e621ef5": {
  120. "is_default": false,
  121. "source": "node7e97af0f55fb64276e067951dd9d",
  122. "id": "line429f64cdec5d20f368611e621ef5",
  123. "target": "node3c7dcf31454c1e9bdc9cf1cdeacc"
  124. },
  125. "line6ea858554964a04d868cead4435a": {
  126. "is_default": false,
  127. "source": "node2b6f3285cfb3961c72834bafbe1b",
  128. "id": "line6ea858554964a04d868cead4435a",
  129. "target": "nodebe0db4ad30cc1723c7ede37b4b5f"
  130. },
  131. "line9dd9c8dbbad90943f268442ab7e0": {
  132. "is_default": false,
  133. "source": "node0863aab8325b84cfa3e5db52dc61",
  134. "id": "line9dd9c8dbbad90943f268442ab7e0",
  135. "target": "node7e97af0f55fb64276e067951dd9d"
  136. },
  137. "lineabc279d9be88eb98285132ba5b75": {
  138. "is_default": false,
  139. "source": "node947e423b22e49aeb77bc77528bc0",
  140. "id": "lineabc279d9be88eb98285132ba5b75",
  141. "target": "node2b6f3285cfb3961c72834bafbe1b"
  142. },
  143. "linef0deadac69f769440a1b0e32587e": {
  144. "source": "node2bf42efcebe266706c3e21326dc4",
  145. "id": "linef0deadac69f769440a1b0e32587e",
  146. "target": "node2b6f3285cfb3961c72834bafbe1b"
  147. },
  148. "linec02d1e77e1076aa9c7c2c57238e4": {
  149. "source": "node5310ec36c0364d3094d515f8f5ef",
  150. "id": "linec02d1e77e1076aa9c7c2c57238e4",
  151. "target": "node0863aab8325b84cfa3e5db52dc61"
  152. },
  153. "line7ed74aa679d19063b6d7037ce6db": {
  154. "is_default": false,
  155. "source": "node20cbeaa5379d08e8d8ed7bb44fdc",
  156. "id": "line7ed74aa679d19063b6d7037ce6db",
  157. "target": "node5310ec36c0364d3094d515f8f5ef"
  158. },
  159. "linec43c77f26af408748a9c194dbcfe": {
  160. "is_default": false,
  161. "source": "node7e97af0f55fb64276e067951dd9d",
  162. "id": "linec43c77f26af408748a9c194dbcfe",
  163. "target": "nodedb1478a75c13f90cc400f5379949"
  164. }
  165. },
  166. "gateways": {
  167. "node2b6f3285cfb3961c72834bafbe1b": {
  168. "incoming": ["linef0deadac69f769440a1b0e32587e", "lineabc279d9be88eb98285132ba5b75"],
  169. "outgoing": "line6ea858554964a04d868cead4435a",
  170. "type": "ConvergeGateway",
  171. "id": "node2b6f3285cfb3961c72834bafbe1b",
  172. "name": ""
  173. },
  174. "node0863aab8325b84cfa3e5db52dc61": {
  175. "outgoing": ["line7587c8804d34a091dae3d321f081", "line9dd9c8dbbad90943f268442ab7e0"],
  176. "incoming": "linec02d1e77e1076aa9c7c2c57238e4",
  177. "name": "",
  178. "type": "ExclusiveGateway",
  179. "conditions": {
  180. "line9dd9c8dbbad90943f268442ab7e0": {
  181. "evaluate": "${bk_timing} <= 10"
  182. },
  183. "line7587c8804d34a091dae3d321f081": {
  184. "evaluate": "${bk_timing} > 10"
  185. }
  186. },
  187. "id": "node0863aab8325b84cfa3e5db52dc61"
  188. },
  189. "node947e423b22e49aeb77bc77528bc0": {
  190. "incoming": ["linebf8f91c96a8f4eb3794ca5eb9881", "line24d28a3f9f80e23e4a4fab7c4ffd"],
  191. "outgoing": "lineabc279d9be88eb98285132ba5b75",
  192. "type": "ConvergeGateway",
  193. "id": "node947e423b22e49aeb77bc77528bc0",
  194. "name": ""
  195. },
  196. "node7e97af0f55fb64276e067951dd9d": {
  197. "incoming": "line9dd9c8dbbad90943f268442ab7e0",
  198. "outgoing": ["line429f64cdec5d20f368611e621ef5", "linec43c77f26af408748a9c194dbcfe"],
  199. "type": "ParallelGateway",
  200. "id": "node7e97af0f55fb64276e067951dd9d",
  201. "name": ""
  202. }
  203. },
  204. "constants": {
  205. "${bk_timing}": {
  206. "source_tag": "sleep_timer.bk_timing",
  207. "source_info": {
  208. "node5310ec36c0364d3094d515f8f5ef": ["bk_timing"],
  209. "node2bf42efcebe266706c3e21326dc4": ["bk_timing"],
  210. "nodedb1478a75c13f90cc400f5379949": ["bk_timing"]
  211. },
  212. "name": "timing",
  213. "index": 0,
  214. "custom_type": "",
  215. "value": "1",
  216. "show_type": "show",
  217. "source_type": "component_inputs",
  218. "key": "${bk_timing}",
  219. "desc": ""
  220. }
  221. },
  222. "outputs": ["${bk_timing}"]
  223. }
  224. }

data

字段 类型 说明
task_id int 任务实例ID
task_url string 任务实例链接
pipeline_tree dict 任务实例树

data.pipeline_tree