通用参数

接口参数

字段 类型 必选 描述
bk_biz_id string 模板所属业务ID
template_id string 模板ID
template_source string 流程模板来源,business:默认值,业务流程,common:公共流程
name string 任务名称
flow_type string 任务流程类型,common: 常规流程,common_func:职能化流程
constants dict 任务全局参数,详细信息见下面说明
exclude_task_nodes_id list 跳过执行的节点ID列表
scope string bk_biz_id 检索的作用域。默认为 cmdb_biz,此时检索的是绑定的 CMDB 业务 ID 为 bk_biz_id 的项目;当值为 project 时则检索项目 ID 为 bk_biz_id 的项目

constants KEY

constants VALUE

  1. "result": true,
  2. "data": {
  3. "task_id": 10,
  4. "task_url": "http://bk_sops_host/taskflow/execute/3/?instance_id=15364",
  5. "pipeline_tree": {
  6. "activities": {
  7. "node9b5ae13799d63e179f0ce3088b62": {
  8. "outgoing": "line27bc7b4ccbcf37ddb9d1f6572a04",
  9. "incoming": "line490caa49d2a03e64829693281032",
  10. "name": "timing",
  11. "error_ignorable": false,
  12. "component": {
  13. "code": "sleep_timer",
  14. "data": {
  15. "bk_timing": {
  16. "hook": false,
  17. "value": "2"
  18. }
  19. }
  20. },
  21. "stage_name": "步骤1",
  22. "retryable": true,
  23. "skippable": true,
  24. "type": "ServiceActivity",
  25. "optional": false,
  26. "id": "node9b5ae13799d63e179f0ce3088b62",
  27. "loop": null
  28. },
  29. "node880ded556c6c3c269be3cedc64b6": {
  30. "outgoing": "line490caa49d2a03e64829693281032",
  31. "incoming": "lineb83161d6e0593ad68d9ec73a961b",
  32. "name": "暂停",
  33. "error_ignorable": false,
  34. "component": {
  35. "code": "pause_node",
  36. "data": {}
  37. },
  38. "stage_name": "步骤1",
  39. "retryable": true,
  40. "skippable": true,
  41. "type": "ServiceActivity",
  42. "id": "node880ded556c6c3c269be3cedc64b6",
  43. "loop": null
  44. }
  45. },
  46. "end_event": {
  47. "type": "EmptyEndEvent",
  48. "outgoing": "",
  49. "incoming": "line27bc7b4ccbcf37ddb9d1f6572a04",
  50. "name": ""
  51. },
  52. "outputs": [],
  53. "flows": {
  54. "line490caa49d2a03e64829693281032": {
  55. "is_default": false,
  56. "source": "node880ded556c6c3c269be3cedc64b6",
  57. "id": "line490caa49d2a03e64829693281032",
  58. "target": "node9b5ae13799d63e179f0ce3088b62"
  59. },
  60. "lineb83161d6e0593ad68d9ec73a961b": {
  61. "is_default": false,
  62. "source": "noded383bc1d7387391f889c6bab18b8",
  63. "id": "lineb83161d6e0593ad68d9ec73a961b",
  64. "target": "node880ded556c6c3c269be3cedc64b6"
  65. },
  66. "line27bc7b4ccbcf37ddb9d1f6572a04": {
  67. "is_default": false,
  68. "source": "node9b5ae13799d63e179f0ce3088b62",
  69. "id": "line27bc7b4ccbcf37ddb9d1f6572a04",
  70. "target": "node5c48f37aa9f0351e8b43ab6a2295"
  71. }
  72. },
  73. "gateways": {},
  74. "line": [
  75. {
  76. "source": {
  77. "id": "node9b5ae13799d63e179f0ce3088b62",
  78. "arrow": "Right"
  79. },
  80. "target": {
  81. "id": "node5c48f37aa9f0351e8b43ab6a2295",
  82. "arrow": "Left"
  83. },
  84. "id": "line27bc7b4ccbcf37ddb9d1f6572a04"
  85. },
  86. {
  87. "source": {
  88. "id": "node880ded556c6c3c269be3cedc64b6",
  89. "arrow": "Right"
  90. },
  91. "target": {
  92. "id": "node9b5ae13799d63e179f0ce3088b62",
  93. "arrow": "Left"
  94. },
  95. },
  96. {
  97. "source": {
  98. "id": "noded383bc1d7387391f889c6bab18b8",
  99. },
  100. "id": "lineb83161d6e0593ad68d9ec73a961b",
  101. "target": {
  102. "id": "node880ded556c6c3c269be3cedc64b6",
  103. "arrow": "Left"
  104. }
  105. }
  106. ],
  107. "start_event": {
  108. "type": "EmptyStartEvent",
  109. "outgoing": "lineb83161d6e0593ad68d9ec73a961b",
  110. "incoming": "",
  111. "id": "noded383bc1d7387391f889c6bab18b8",
  112. "name": ""
  113. },
  114. "id": "node7ef6970d06ad3bc092594cb5ec5f",
  115. "constants": {},
  116. "location": [
  117. {
  118. "stage_name": "步骤1",
  119. "name": "暂停",
  120. "y": 135,
  121. "x": 300,
  122. "type": "tasknode",
  123. "id": "node880ded556c6c3c269be3cedc64b6"
  124. },
  125. {
  126. "y": 150,
  127. "x": 1000,
  128. "type": "endpoint",
  129. "id": "node5c48f37aa9f0351e8b43ab6a2295"
  130. },
  131. {
  132. "stage_name": "步骤1",
  133. "name": "timing",
  134. "y": 135,
  135. "x": 595,
  136. "type": "tasknode",
  137. "id": "node9b5ae13799d63e179f0ce3088b62"
  138. },
  139. {
  140. "y": 150,
  141. "x": 80,
  142. "type": "startpoint",
  143. "id": "noded383bc1d7387391f889c6bab18b8"
  144. }
  145. ]
  146. }
  147. }

data

字段 类型 描述
task_id int 任务实例ID
task_url str 任务实例链接
pipeline_tree dict 任务实例树

data.pipeline_tree

data.pipeline_tree.constants KEY

data.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 时有效,变量的来源标准插件
source_info dict source_type=component_inputs/component_outputs 时有效,变量的来源节点信息