通用参数

接口参数

字段 类型 必选 描述
template_id string 用于创建任务的模板ID
template_source string 流程模板来源,business:默认值,业务流程,common:公共流程
bk_biz_id string 任务所属业务ID
name string 要创建的周期任务名称
cron dict 要创建的周期任务调度策略
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

cron

  1. "message": "",
  2. "data": {
  3. "cron": "*/1 15 * * * (m/h/d/dM/MY)",
  4. "total_run_count": 0,
  5. "name": "from api 3",
  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": "100",
  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. "node76393dcfedcf73dbc726f1c4786d": {
  29. "outgoing": "linecf7b7f10c87187a88b72c5f91177",
  30. "incoming": "linecd597f19606c1455d661f71a582d",
  31. "name": "定时",
  32. "error_ignorable": false,
  33. "component": {
  34. "code": "sleep_timer",
  35. "data": {
  36. "bk_timing": {
  37. "hook": true,
  38. "value": "${bk_timing}"
  39. }
  40. }
  41. "stage_name": "步骤1",
  42. "optional": false,
  43. "type": "ServiceActivity",
  44. "id": "node76393dcfedcf73dbc726f1c4786d",
  45. "loop": {}
  46. }
  47. },
  48. "end_event": {
  49. "outgoing": "",
  50. "type": "EmptyEndEvent",
  51. "id": "node375320830be9c46cd89f4069857d",
  52. "name": ""
  53. },
  54. "outputs": [],
  55. "flows": {
  56. "linecd597f19606c1455d661f71a582d": {
  57. "is_default": false,
  58. "source": "node4e87796ddd76b0d59337b08f385d",
  59. "id": "linecd597f19606c1455d661f71a582d",
  60. "target": "node76393dcfedcf73dbc726f1c4786d"
  61. },
  62. "linecf7b7f10c87187a88b72c5f91177": {
  63. "is_default": false,
  64. "source": "node76393dcfedcf73dbc726f1c4786d",
  65. "id": "linecf7b7f10c87187a88b72c5f91177",
  66. "target": "node375320830be9c46cd89f4069857d"
  67. }
  68. },
  69. "gateways": {},
  70. "line": [
  71. {
  72. "source": {
  73. "id": "node4e87796ddd76b0d59337b08f385d",
  74. "arrow": "Right"
  75. },
  76. "id": "linecd597f19606c1455d661f71a582d",
  77. "target": {
  78. "id": "node76393dcfedcf73dbc726f1c4786d",
  79. "arrow": "Left"
  80. }
  81. },
  82. {
  83. "source": {
  84. "id": "node76393dcfedcf73dbc726f1c4786d",
  85. "arrow": "Right"
  86. },
  87. "target": {
  88. "id": "node375320830be9c46cd89f4069857d",
  89. "arrow": "Left"
  90. },
  91. "id": "linecf7b7f10c87187a88b72c5f91177"
  92. }
  93. ],
  94. "incoming": "",
  95. "outgoing": "linecd597f19606c1455d661f71a582d",
  96. "type": "EmptyStartEvent",
  97. "name": ""
  98. },
  99. "constants": {
  100. "${bk_timing}": {
  101. "source_tag": "sleep_timer.bk_timing",
  102. "source_info": {
  103. "node76393dcfedcf73dbc726f1c4786d": [
  104. "bk_timing"
  105. ]
  106. },
  107. "name": "定时时间",
  108. "index": 0,
  109. "custom_type": "",
  110. "value": "100",
  111. "show_type": "show",
  112. "source_type": "component_inputs",
  113. "key": "${bk_timing}",
  114. "validation": "",
  115. "desc": ""
  116. }
  117. },
  118. "location": [
  119. {
  120. "y": 150,
  121. "x": 80,
  122. "type": "startpoint",
  123. "id": "node4e87796ddd76b0d59337b08f385d"
  124. },
  125. {
  126. "y": 149,
  127. "x": 1092,
  128. "type": "endpoint",
  129. "id": "node375320830be9c46cd89f4069857d"
  130. },
  131. {
  132. "stage_name": "步骤1",
  133. "name": "定时",
  134. "y": 133,
  135. "x": 300,
  136. "type": "tasknode",
  137. "id": "node76393dcfedcf73dbc726f1c4786d"
  138. }
  139. ]
  140. },
  141. "last_run_at": "",
  142. "enabled": false,
  143. "id": 11,
  144. "template_id": 2
  145. },
名称 类型 说明
result bool true/false 操作是否成功
data dict result=true 时成功数据,详细信息请见下面说明
message string result=false 时错误信息

data

data.pipeline_tree

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

data.form KEY, data.pipeline_tree.constants KEY

data.form VALUE, data.pipeline_tree.constants VALUE