通用参数
接口参数
字段 |
类型 |
必选 |
描述 |
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
"message": "",
"data": {
"cron": "*/1 15 * * * (m/h/d/dM/MY)",
"total_run_count": 0,
"name": "from api 3",
"form": {
"${bk_timing}": {
"source_tag": "sleep_timer.bk_timing",
"source_info": {
"node76393dcfedcf73dbc726f1c4786d": [
"bk_timing"
]
},
"name": "定时时间",
"index": 0,
"custom_type": "",
"value": "100",
"show_type": "show",
"source_type": "component_inputs",
"key": "${bk_timing}",
"validation": "",
"desc": ""
}
},
"creator": "admin",
"pipeline_tree": {
"activities": {
"node76393dcfedcf73dbc726f1c4786d": {
"outgoing": "linecf7b7f10c87187a88b72c5f91177",
"incoming": "linecd597f19606c1455d661f71a582d",
"name": "定时",
"error_ignorable": false,
"component": {
"code": "sleep_timer",
"data": {
"bk_timing": {
"hook": true,
"value": "${bk_timing}"
}
}
"stage_name": "步骤1",
"optional": false,
"type": "ServiceActivity",
"id": "node76393dcfedcf73dbc726f1c4786d",
"loop": {}
}
},
"end_event": {
"outgoing": "",
"type": "EmptyEndEvent",
"id": "node375320830be9c46cd89f4069857d",
"name": ""
},
"outputs": [],
"flows": {
"linecd597f19606c1455d661f71a582d": {
"is_default": false,
"source": "node4e87796ddd76b0d59337b08f385d",
"id": "linecd597f19606c1455d661f71a582d",
"target": "node76393dcfedcf73dbc726f1c4786d"
},
"linecf7b7f10c87187a88b72c5f91177": {
"is_default": false,
"source": "node76393dcfedcf73dbc726f1c4786d",
"id": "linecf7b7f10c87187a88b72c5f91177",
"target": "node375320830be9c46cd89f4069857d"
}
},
"gateways": {},
"line": [
{
"source": {
"id": "node4e87796ddd76b0d59337b08f385d",
"arrow": "Right"
},
"id": "linecd597f19606c1455d661f71a582d",
"target": {
"id": "node76393dcfedcf73dbc726f1c4786d",
"arrow": "Left"
}
},
{
"source": {
"id": "node76393dcfedcf73dbc726f1c4786d",
"arrow": "Right"
},
"target": {
"id": "node375320830be9c46cd89f4069857d",
"arrow": "Left"
},
"id": "linecf7b7f10c87187a88b72c5f91177"
}
],
"incoming": "",
"outgoing": "linecd597f19606c1455d661f71a582d",
"type": "EmptyStartEvent",
"name": ""
},
"constants": {
"${bk_timing}": {
"source_tag": "sleep_timer.bk_timing",
"source_info": {
"node76393dcfedcf73dbc726f1c4786d": [
"bk_timing"
]
},
"name": "定时时间",
"index": 0,
"custom_type": "",
"value": "100",
"show_type": "show",
"source_type": "component_inputs",
"key": "${bk_timing}",
"validation": "",
"desc": ""
}
},
"location": [
{
"y": 150,
"x": 80,
"type": "startpoint",
"id": "node4e87796ddd76b0d59337b08f385d"
},
{
"y": 149,
"x": 1092,
"type": "endpoint",
"id": "node375320830be9c46cd89f4069857d"
},
{
"stage_name": "步骤1",
"name": "定时",
"y": 133,
"x": 300,
"type": "tasknode",
"id": "node76393dcfedcf73dbc726f1c4786d"
}
]
},
"last_run_at": "",
"enabled": false,
"id": 11,
"template_id": 2
},
名称 |
类型 |
说明 |
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 中的输出字段 |