通用参数

接口参数

字段 类型 必选 描述
bk_biz_id string 模板所属业务ID
template_id string 模板ID
template_source string 流程模板来源,business:默认值,业务流程,common:公共流程
scope string bk_biz_id 检索的作用域。默认为 cmdb_biz,此时检索的是绑定的 CMDB 业务 ID 为 bk_biz_id 的项目;当值为 project 时则检索项目 ID 为 bk_biz_id 的项目
  1. "result": true,
  2. "data": {
  3. "category": "Other",
  4. "edit_time": "2018-04-27 16:24:24 +0800",
  5. "create_time": "2018-04-16 21:43:15 +0800",
  6. "name": "new20180416213944",
  7. "bk_biz_id": "2",
  8. "creator": "admin",
  9. "pipeline_tree": {
  10. "activities": {
  11. "631b6576cc5dfbdcaa4f510ce88a7e67": {
  12. "outgoing": "44ab36ebf4cf119edaf2d20401da87e4",
  13. "incoming": "fb2f3a8b533ca5c67e2440b4164f7632",
  14. "name": "节点_1",
  15. "error_ignorable": false,
  16. "component": {
  17. "code": "job_fast_execute_script",
  18. "data": {
  19. "account": {
  20. "hook": false,
  21. "value": "root"
  22. },
  23. "ip_list": {
  24. "hook": false,
  25. "value": "127.0.0.1"
  26. },
  27. "script_timeout": {
  28. "hook": true,
  29. "value": "${script_timeout}"
  30. },
  31. "content": {
  32. "hook": false,
  33. "value": "${content}"
  34. },
  35. "script_param": {
  36. "hook": false,
  37. "value": "${params}"
  38. },
  39. "script_type": {
  40. "hook": true,
  41. }
  42. }
  43. },
  44. "optional": false,
  45. "type": "ServiceActivity",
  46. "id": "631b6576cc5dfbdcaa4f510ce88a7e67",
  47. "loop": null
  48. },
  49. "end_event": {
  50. "type": "EmptyEndEvent",
  51. "outgoing": "",
  52. "incoming": "44ab36ebf4cf119edaf2d20401da87e4",
  53. "id": "60c81e383d048d8a3c574d3436e1b82c",
  54. "name": ""
  55. },
  56. "outputs": [],
  57. "flows": {
  58. "fb2f3a8b533ca5c67e2440b4164f7632": {
  59. "is_default": false,
  60. "source": "48afea1016ab70ee37179fa0eb1e1a14",
  61. "id": "fb2f3a8b533ca5c67e2440b4164f7632",
  62. "target": "631b6576cc5dfbdcaa4f510ce88a7e67"
  63. },
  64. "44ab36ebf4cf119edaf2d20401da87e4": {
  65. "is_default": false,
  66. "source": "631b6576cc5dfbdcaa4f510ce88a7e67",
  67. "id": "44ab36ebf4cf119edaf2d20401da87e4",
  68. "target": "60c81e383d048d8a3c574d3436e1b82c"
  69. }
  70. },
  71. "start_event": {
  72. "type": "EmptyStartEvent",
  73. "outgoing": "fb2f3a8b533ca5c67e2440b4164f7632",
  74. "incoming": "",
  75. "id": "48afea1016ab70ee37179fa0eb1e1a14",
  76. "name": ""
  77. },
  78. "constants": {
  79. "${script_type}": {
  80. "source_tag": "job_fast_execute_script.script_type",
  81. "source_info": {
  82. "631b6576cc5dfbdcaa4f510ce88a7e67": [
  83. "script_type"
  84. ]
  85. },
  86. "name": "脚本类型",
  87. "index": 0,
  88. "custom_type": "radio",
  89. "value": "4",
  90. "show_type": "show",
  91. "source_type": "component_inputs",
  92. "validation": "^.*$",
  93. "desc": ""
  94. },
  95. "source_tag": "",
  96. "source_info": {},
  97. "name": "内容",
  98. "index": 2,
  99. "custom_type": "textarea",
  100. "value": "",
  101. "show_type": "show",
  102. "source_type": "custom",
  103. "key": "${content}",
  104. "desc": ""
  105. },
  106. "${script_timeout}": {
  107. "source_tag": "job_fast_execute_script.script_timeout",
  108. "source_info": {
  109. "631b6576cc5dfbdcaa4f510ce88a7e67": [
  110. "script_timeout"
  111. ]
  112. },
  113. "name": "超时时间",
  114. "index": 1,
  115. "custom_type": "input",
  116. "value": "",
  117. "show_type": "show",
  118. "source_type": "component_inputs",
  119. "key": "${script_timeout}",
  120. "validation": "^.*$",
  121. "desc": ""
  122. },
  123. "${params}": {
  124. "source_tag": "",
  125. "source_info": {},
  126. "name": "参数",
  127. "index": 3,
  128. "custom_type": "input",
  129. "value": "",
  130. "show_type": "show",
  131. "source_type": "custom",
  132. "key": "${params}",
  133. "desc": ""
  134. }
  135. },
  136. "gateways": {}
  137. },
  138. "bk_biz_name": "蓝鲸",
  139. "id": 30,
  140. "editor": "admin"
  141. },
  142. }

data

字段 类型 描述
bk_biz_id string 模板所属业务ID
bk_biz_name string 模板所属业务名称
id int 模板ID
name string 模板名称
category string 模板分类,分类信息见下面说明
creator string 模板创建人
create_time string 模板创建时间
editor string 或者 null 模板编辑人
edit_time string 模板最新编辑时间
pipeline_tree dict 模板任务树信息,详细信息见下面说明

data.category

data.pipeline_tree

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

data.pipeline_tree.constants KEY

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

data.pipeline_tree.constants VALUE