功能描述

查询某个周期任务的详情

请求参数

通用参数

字段 类型 必选 描述
bk_app_code string 应用ID
bk_app_secret string 安全密钥(应用 TOKEN),可以通过 蓝鲸智云开发者中心 -> 点击应用ID -> 基本信息 获取
bk_token string 当前用户登录态,bk_token与bk_username必须一个有效,bk_token可以通过Cookie获取
bk_username string 当前用户用户名,应用免登录态验证白名单中的应用,用此字段指定当前用户

接口参数

字段 类型 必选 描述
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. {
  2. "bk_app_code": "esb_test",
  3. "bk_app_secret": "xxx",
  4. "bk_token": "xxx",
  5. "bk_biz_id": "2",
  6. "task_id": "8"
  7. }

返回结果示例

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

返回结果参数说明

名称 类型 说明
result bool true/false 操作是否成功
data dict result=true 时成功数据,详细信息请见下面说明
message string result=false 时错误信息

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

名称 类型 说明
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

全局变量 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 时有效,变量的来源节点信息