通用参数

接口参数

字段 类型 必选 描述
task_id string 周期任务ID
bk_biz_id string 模板所属业务ID
scope string bk_biz_id 检索的作用域。默认为 cmdb_biz,此时检索的是绑定的 CMDB 业务 ID 为 bk_biz_id 的项目;当值为 project 时则检索项目 ID 为 bk_biz_id 的项目
  1. "message": "",
  2. "data": {
  3. "cron": "1,2,3-19/2 2 3 4 5 (m/h/d/dM/MY)",
  4. "total_run_count": 0,
  5. "name": "定时2",
  6. "form": {
  7. "${bk_timing}": {
  8. "source_tag": "sleep_timer.bk_timing",
  9. "source_info": {
  10. "node76393dcfedcf73dbc726f1c4786d": [
  11. "bk_timing"
  12. ]
  13. },
  14. "name": "定时时间",
  15. "index": 0,
  16. "custom_type": "",
  17. "value": "2",
  18. "show_type": "show",
  19. "source_type": "component_inputs",
  20. "key": "${bk_timing}",
  21. "validation": "",
  22. "desc": ""
  23. }
  24. },
  25. "creator": "admin",
  26. "pipeline_tree": {
  27. "activities": {
  28. "nodea5c396a3ef0f9f3cd7d4d7695f78": {
  29. "outgoing": "linef69b59d165fb8c0061b46588c515",
  30. "incoming": "linecf7b7f10c87187a88b72c5f91177",
  31. "name": "暂停",
  32. "error_ignorable": false,
  33. "component": {
  34. "code": "pause_node",
  35. "data": {}
  36. },
  37. "stage_name": "步骤1",
  38. "optional": false,
  39. "type": "ServiceActivity",
  40. "id": "nodea5c396a3ef0f9f3cd7d4d7695f78",
  41. "loop": {}
  42. },
  43. "node76393dcfedcf73dbc726f1c4786d": {
  44. "outgoing": "linecf7b7f10c87187a88b72c5f91177",
  45. "incoming": "linecd597f19606c1455d661f71a582d",
  46. "name": "定时",
  47. "error_ignorable": false,
  48. "component": {
  49. "code": "sleep_timer",
  50. "data": {
  51. "bk_timing": {
  52. "hook": true,
  53. "value": "${bk_timing}"
  54. }
  55. }
  56. "stage_name": "步骤1",
  57. "optional": false,
  58. "type": "ServiceActivity",
  59. "id": "node76393dcfedcf73dbc726f1c4786d",
  60. "loop": {}
  61. }
  62. },
  63. "incoming": "linef69b59d165fb8c0061b46588c515",
  64. "outgoing": "",
  65. "type": "EmptyEndEvent",
  66. "id": "node375320830be9c46cd89f4069857d",
  67. "name": ""
  68. },
  69. "outputs": [],
  70. "flows": {
  71. "linef69b59d165fb8c0061b46588c515": {
  72. "is_default": false,
  73. "source": "nodea5c396a3ef0f9f3cd7d4d7695f78",
  74. "id": "linef69b59d165fb8c0061b46588c515",
  75. "target": "node375320830be9c46cd89f4069857d"
  76. },
  77. "linecd597f19606c1455d661f71a582d": {
  78. "is_default": false,
  79. "source": "node4e87796ddd76b0d59337b08f385d",
  80. "id": "linecd597f19606c1455d661f71a582d",
  81. "target": "node76393dcfedcf73dbc726f1c4786d"
  82. },
  83. "linecf7b7f10c87187a88b72c5f91177": {
  84. "is_default": false,
  85. "source": "node76393dcfedcf73dbc726f1c4786d",
  86. "id": "linecf7b7f10c87187a88b72c5f91177",
  87. "target": "nodea5c396a3ef0f9f3cd7d4d7695f78"
  88. }
  89. },
  90. "gateways": {},
  91. "line": [
  92. {
  93. "source": {
  94. "id": "nodea5c396a3ef0f9f3cd7d4d7695f78",
  95. "arrow": "Right"
  96. },
  97. "target": {
  98. "id": "node375320830be9c46cd89f4069857d",
  99. "arrow": "Left"
  100. },
  101. "id": "linef69b59d165fb8c0061b46588c515"
  102. },
  103. {
  104. "source": {
  105. "id": "node4e87796ddd76b0d59337b08f385d",
  106. "arrow": "Right"
  107. },
  108. "id": "linecd597f19606c1455d661f71a582d",
  109. "target": {
  110. "id": "node76393dcfedcf73dbc726f1c4786d",
  111. "arrow": "Left"
  112. }
  113. },
  114. {
  115. "source": {
  116. "id": "node76393dcfedcf73dbc726f1c4786d",
  117. "arrow": "Right"
  118. },
  119. "target": {
  120. "id": "nodea5c396a3ef0f9f3cd7d4d7695f78",
  121. },
  122. "id": "linecf7b7f10c87187a88b72c5f91177"
  123. }
  124. ],
  125. "incoming": "",
  126. "outgoing": "linecd597f19606c1455d661f71a582d",
  127. "type": "EmptyStartEvent",
  128. "id": "node4e87796ddd76b0d59337b08f385d",
  129. "name": ""
  130. },
  131. "constants": {
  132. "${bk_timing}": {
  133. "source_tag": "sleep_timer.bk_timing",
  134. "source_info": {
  135. "node76393dcfedcf73dbc726f1c4786d": [
  136. "bk_timing"
  137. ]
  138. },
  139. "name": "定时时间",
  140. "index": 0,
  141. "custom_type": "",
  142. "value": "2",
  143. "show_type": "show",
  144. "source_type": "component_inputs",
  145. "key": "${bk_timing}",
  146. "validation": "",
  147. "desc": ""
  148. }
  149. },
  150. "location": [
  151. {
  152. "stage_name": "步骤1",
  153. "name": "暂停",
  154. "y": 133,
  155. "x": 631,
  156. "type": "tasknode",
  157. "id": "nodea5c396a3ef0f9f3cd7d4d7695f78"
  158. },
  159. {
  160. "y": 150,
  161. "x": 80,
  162. "type": "startpoint",
  163. "id": "node4e87796ddd76b0d59337b08f385d"
  164. },
  165. {
  166. "y": 149,
  167. "x": 1092,
  168. "type": "endpoint",
  169. "id": "node375320830be9c46cd89f4069857d"
  170. },
  171. {
  172. "stage_name": "步骤1",
  173. "name": "定时",
  174. "y": 133,
  175. "x": 300,
  176. "type": "tasknode",
  177. "id": "node76393dcfedcf73dbc726f1c4786d"
  178. }
  179. ]
  180. },
  181. "last_run_at": "",
  182. "enabled": true,
  183. "id": 5,
  184. "template_id": "2"
  185. },
  186. }

data

名称 类型 说明
cron string 周期调度表达式
total_run_count int 周期任务运行次数
name string 周期任务名
creator string 创建者
last_run_at string 上次运行时间
enabled bool 是否激活
id int 周期任务 ID
template_id string 用于创建该任务的模板 ID
form dict 该周期任务的参数表单对象
pipeline_tree dict 该周期任务的实例树

data.pipeline_tree

data.form KEY, data.pipeline_tree.constants KEY

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

data.form VALUE, 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 时有效,变量的来源节点信息