通用参数

接口参数

字段 类型 必选 描述
bk_biz_id string 所属业务ID
task_id string 任务ID
scope string bk_biz_id 检索的作用域。默认为 cmdb_biz,此时检索的是绑定的 CMDB 业务 ID 为 bk_biz_id 的项目;当值为 project 时则检索项目 ID 为 bk_biz_id 的项目
  1. "data": {
  2. "creator": "admin",
  3. "outputs": [
  4. {
  5. "value": "1",
  6. "key": "${job_script_type}",
  7. "name": "脚本类型"
  8. },
  9. {
  10. "value": "127.0.0.1",
  11. "key": "${IP}",
  12. "name": "IP"
  13. },
  14. {
  15. "value": "0",
  16. "key": "${EXIT}",
  17. "name": "EXIT"
  18. }
  19. ],
  20. "start_time": "2019-01-17 04:13:08",
  21. "business_id": 2,
  22. "create_time": "2019-01-17 04:13:03",
  23. "business_name": "蓝鲸",
  24. "id": 10,
  25. "constants": {
  26. "${IP}": {
  27. "source_tag": "var_ip_picker.ip_picker",
  28. "source_info": {},
  29. "name": "IP",
  30. "index": 2,
  31. "custom_type": "ip",
  32. "value": {
  33. "var_ip_custom_value": "127.0.0.1",
  34. "var_ip_method": "custom",
  35. "var_ip_tree": []
  36. },
  37. "show_type": "show",
  38. "source_type": "custom",
  39. "validator": [],
  40. "key": "${IP}",
  41. "desc": "",
  42. "validation": "",
  43. "is_meta": false
  44. },
  45. "${job_script_type}": {
  46. "source_tag": "job_fast_execute_script.job_script_type",
  47. "source_info": {
  48. "node554316ea019a341f8c28cc6a7da9": [
  49. "job_script_type"
  50. ]
  51. },
  52. "name": "脚本类型",
  53. "index": 0,
  54. "custom_type": "",
  55. "value": "1",
  56. "show_type": "show",
  57. "source_type": "component_inputs",
  58. "key": "${job_script_type}",
  59. "validation": "",
  60. "desc": ""
  61. },
  62. "${EXIT}": {
  63. "source_tag": "",
  64. "source_info": {},
  65. "name": "EXIT",
  66. "index": 1,
  67. "custom_type": "input",
  68. "value": "0",
  69. "show_type": "show",
  70. "validator": [],
  71. "key": "${EXIT}",
  72. "validation": "^.+$",
  73. "desc": ""
  74. }
  75. },
  76. "create_method": "app",
  77. "ex_data": "",
  78. "instance_name": "job输出变量测试_20190117121300",
  79. "end_time": "2019-01-17 04:13:15",
  80. "executor": "admin",
  81. "template_id": "266",
  82. "task_url": "http://bk_sops_host/taskflow/execute/3/?instance_id=15364",
  83. "pipeline_tree": {
  84. "activities": {
  85. "node9b5ae13799d63e179f0ce3088b62": {
  86. "outgoing": "line27bc7b4ccbcf37ddb9d1f6572a04",
  87. "incoming": "line490caa49d2a03e64829693281032",
  88. "name": "timing",
  89. "error_ignorable": false,
  90. "component": {
  91. "code": "sleep_timer",
  92. "data": {
  93. "bk_timing": {
  94. "hook": false,
  95. "value": "2"
  96. }
  97. }
  98. },
  99. "stage_name": "步骤1",
  100. "retryable": true,
  101. "skippable": true,
  102. "type": "ServiceActivity",
  103. "optional": false,
  104. "id": "node9b5ae13799d63e179f0ce3088b62",
  105. "loop": null
  106. },
  107. "node880ded556c6c3c269be3cedc64b6": {
  108. "outgoing": "line490caa49d2a03e64829693281032",
  109. "incoming": "lineb83161d6e0593ad68d9ec73a961b",
  110. "name": "暂停",
  111. "error_ignorable": false,
  112. "component": {
  113. "code": "pause_node",
  114. "data": {}
  115. },
  116. "stage_name": "步骤1",
  117. "retryable": true,
  118. "skippable": true,
  119. "type": "ServiceActivity",
  120. "optional": true,
  121. "id": "node880ded556c6c3c269be3cedc64b6",
  122. "loop": null
  123. }
  124. },
  125. "end_event": {
  126. "type": "EmptyEndEvent",
  127. "outgoing": "",
  128. "incoming": "line27bc7b4ccbcf37ddb9d1f6572a04",
  129. "id": "node5c48f37aa9f0351e8b43ab6a2295",
  130. "name": ""
  131. },
  132. "outputs": [],
  133. "flows": {
  134. "line490caa49d2a03e64829693281032": {
  135. "is_default": false,
  136. "source": "node880ded556c6c3c269be3cedc64b6",
  137. "id": "line490caa49d2a03e64829693281032",
  138. "target": "node9b5ae13799d63e179f0ce3088b62"
  139. },
  140. "lineb83161d6e0593ad68d9ec73a961b": {
  141. "is_default": false,
  142. "source": "noded383bc1d7387391f889c6bab18b8",
  143. "id": "lineb83161d6e0593ad68d9ec73a961b",
  144. "target": "node880ded556c6c3c269be3cedc64b6"
  145. },
  146. "line27bc7b4ccbcf37ddb9d1f6572a04": {
  147. "is_default": false,
  148. "source": "node9b5ae13799d63e179f0ce3088b62",
  149. "id": "line27bc7b4ccbcf37ddb9d1f6572a04",
  150. }
  151. },
  152. "gateways": {},
  153. {
  154. "source": {
  155. "id": "node9b5ae13799d63e179f0ce3088b62",
  156. "arrow": "Right"
  157. },
  158. "target": {
  159. "id": "node5c48f37aa9f0351e8b43ab6a2295",
  160. "arrow": "Left"
  161. },
  162. "id": "line27bc7b4ccbcf37ddb9d1f6572a04"
  163. },
  164. {
  165. "source": {
  166. "id": "node880ded556c6c3c269be3cedc64b6",
  167. "arrow": "Right"
  168. },
  169. "target": {
  170. "id": "node9b5ae13799d63e179f0ce3088b62",
  171. "arrow": "Left"
  172. },
  173. "id": "line490caa49d2a03e64829693281032"
  174. },
  175. {
  176. "source": {
  177. "id": "noded383bc1d7387391f889c6bab18b8",
  178. "arrow": "Right"
  179. },
  180. "id": "lineb83161d6e0593ad68d9ec73a961b",
  181. "target": {
  182. "id": "node880ded556c6c3c269be3cedc64b6",
  183. "arrow": "Left"
  184. }
  185. }
  186. ],
  187. "start_event": {
  188. "type": "EmptyStartEvent",
  189. "outgoing": "lineb83161d6e0593ad68d9ec73a961b",
  190. "incoming": "",
  191. "id": "noded383bc1d7387391f889c6bab18b8",
  192. "name": ""
  193. },
  194. "id": "node7ef6970d06ad3bc092594cb5ec5f",
  195. "constants": {},
  196. "location": [
  197. {
  198. "stage_name": "步骤1",
  199. "name": "暂停",
  200. "y": 135,
  201. "x": 300,
  202. "type": "tasknode",
  203. "id": "node880ded556c6c3c269be3cedc64b6"
  204. },
  205. {
  206. "y": 150,
  207. "x": 1000,
  208. "type": "endpoint",
  209. "id": "node5c48f37aa9f0351e8b43ab6a2295"
  210. },
  211. {
  212. "stage_name": "步骤1",
  213. "name": "timing",
  214. "y": 135,
  215. "x": 595,
  216. "type": "tasknode",
  217. "id": "node9b5ae13799d63e179f0ce3088b62"
  218. },
  219. {
  220. "y": 150,
  221. "x": 80,
  222. "type": "startpoint",
  223. "id": "noded383bc1d7387391f889c6bab18b8"
  224. }
  225. ]
  226. }
  227. },
  228. "result": true
  229. }

data

字段 类型 描述
id int 任务 ID,即 task_id
name string 任务名称
business_id int 所属业务 ID
business_name string 所属业务名称
template_id int 创建任务所用的流程模板 ID
create_time string 任务创建时间
create_method string 任务创建方式
start_time string 任务执行时间
finish_time string 任务完成时间
elapsed_time int 任务执行耗时(秒)
creator string 任务创建人
executor string 任务执行人
constants dict 输入的全局变量,详情见下面说明
outputs list 任务输出参数,详情见下面说明
task_url str 任务实例链接
pipeline_tree dict 任务实例树

data.constants KEY

全局变量 KEY,${key} 格式

data.constants VALUE

data.outputs[]

字段 类型 描述
name string 输出参数名称
value string、int、bool、dict、list 输出参数值
key string 输出参数 KEY
preset bool 是否是标准插件定义中预设输出变量

data.pipeline_tree