工作流节点管理列表

说明

  • 管理工作流节点管理

1、工作流节点管理列表、新增工作流节点管理、批量删除工作流节点管理 API

请求方式: GET(查询) POST(新增) DELETE(批量删除)

请求地址: /api/template/workflow/node/

Content-Type:

新增数据的时候需要指定Content-Type,以下对Content-Type进行说明:

application/x-www-form-urlencoded —— 表示通过表单方式提交
application/json —— 表示传入数据为json格式字符串

查询参数:

参数 数据类型 是否必须 说明
offset int 数据起始位置
limit int 查询条数
name string 项目名称
search string 模糊查询,查询字段为name和description

输入参数(新增):

参数 数据类型 是否必须 说明
name string 节点名称
template int 模版id
template_name string 模版id中文名称
top int 纵坐标
left int 横坐标
type string 节点类型
is_start_node int 是否开始节点
bind_template int 绑定模版id
bind_template_name string 绑定模版id中文名称
forks string 并发数
limit string limit
tags string tags
skip_tags string skip_tags
verbosity int Debug级别
variables string 扩展参数
become_enabled int 是否允许切换用户
diff_mode int 是否使用diff模块
force_handlers int 是否强制允许handlers任务
start_at_task string 开始任务

输出参数:

参数 数据类型 是否必须 说明
id int workflow id
name string 节点名称
template int 模版id
template_name string 模版id中文名称
top int 纵坐标
left int 横坐标
type string 节点类型
is_start_node int 是否开始节点
bind_template int 绑定模版id
bind_template_name string 绑定模版id中文名称
forks string 并发数
limit string limit
tags string tags
skip_tags string skip_tags
verbosity int Debug级别
variables string 扩展参数
become_enabled int 是否允许切换用户
diff_mode int 是否使用diff模块
force_handlers int 是否强制允许handlers任务
start_at_task string 开始任务

批量删除参数:

参数 数据类型 是否必须 说明
pk string 与pk[]不能都为空 主键,多个主键用半角逗号隔开。通过http body传入
pk[] array 与pk不能都为空 主键数组。通过http body传入

排序:

参数 数据类型 是否必须 说明
ordering string
一般默认按id倒叙
  • ordering=id表示按id排序ordering=-id表示按id倒叙
  • 多个字段排序用半角逗号分隔

GET返回数据例子:

{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 21,
            "name": "处理节点",
            "template": 26,
            "template_name": "workflow",
            "left": 678,
            "top": 458,
            "type": "",
            "is_start_node": 0,
            "bind_template": null,
            "bind_template_name": null,
            "use_node_params": 0,
            "forks": 0,
            "limit": "",
            "tags": "",
            "skip_tags": "",
            "verbosity": 0,
            "become_enabled": 0,
            "diff_mode": 0,
            "force_handlers": 0,
            "start_at_task": "",
            "variables": ""
        },
        {
            "id": 20,
            "name": "处理节点",
            "template": 26,
            "template_name": "workflow",
            "left": 651,
            "top": 122,
            "type": "job",
            "is_start_node": 0,
            "bind_template": 23,
            "bind_template_name": "测试SVN",
            "use_node_params": 1,
            "forks": 0,
            "limit": "",
            "tags": "text",
            "skip_tags": "text",
            "verbosity": 0,
            "become_enabled": 0,
            "diff_mode": 0,
            "force_handlers": 0,
            "start_at_task": "",
            "variables": ""
            }
        ]
    }

新增工作流节点管理返回数据例子:

{
    "id": 21,
    "name": "处理节点",
    "template": 26,
    "template_name": "workflow",
    "left": 678,
    "top": 458,
    "type": "",
    "is_start_node": 0,
    "bind_template": null,
    "bind_template_name": null,
    "use_node_params": 0,
    "forks": 0,
    "limit": "",
    "tags": "",
    "skip_tags": "",
    "verbosity": 0,
    "become_enabled": 0,
    "diff_mode": 0,
    "force_handlers": 0,
    "start_at_task": "",
    "variables": ""
}

2、获取单个工作流节点管理,修改工作流节点管理、删除工作流节点管理 API

请求方式: GET(查询) PUT(修改) PATCH(修改) DELETE(删除)

请求地址: /api/template/workflow/node/1/

请求地址中1为工作流节点管理的id

输入/输出参数: 见章节1中输入和输出参数说明,修改数据时输入参数均为非必须

返回数据例子:

{
    "id": 1,
    "name": "开始",
    "template": 2,
    "template_name": "工作流测试模板",
    "left": 234,
    "top": 264,
    "type": "",
    "is_start_node": 1,
    "bind_template": null,
    "bind_template_name": null,
    "use_node_params": 0,
    "forks": 0,
    "limit": "",
    "tags": "",
    "skip_tags": "",
    "verbosity": 0,
    "become_enabled": 0,
    "diff_mode": 0,
    "force_handlers": 0,
    "start_at_task": "",
    "variables": ""
}