{
    "swagger": "2.0",
    "info": {
        "description": "运维脚本自动化",
        "title": "ISMP Automation API",
        "contact": {},
        "version": "1.0"
    },
    "basePath": "/automation/boltdog/openapi/v2",
    "paths": {
        "/dangerousRule/add": {
            "post": {
                "description": "创建一条新的危险规则",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "新增危险规则",
                "parameters": [
                    {
                        "description": "危险规则信息",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.DangerousRuleCreateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/dangerousRule/changeStatus": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "启用或禁用指定的危险规则",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "修改危险规则状态",
                "parameters": [
                    {
                        "description": "规则状态修改参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.DangerousRuleStatusUpdateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/dangerousRule/delete": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据规则 ID 列表批量删除危险规则",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "删除危险规则",
                "parameters": [
                    {
                        "description": "删除规则 ID 列表",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.DangerousRuleDeleteReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/dangerousRule/detectRule": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "对提交的脚本内容进行实时危险规则检测并返回命中规则",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "实时脚本危险规则检测",
                "parameters": [
                    {
                        "description": "实时检测请求参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.DetectRealtimeReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/dangerousRule/list": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "分页查询危险规则列表,支持关键字搜索",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "获取危险规则列表(分页)",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "每页条数",
                        "name": "page_size",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "当前页",
                        "name": "current_page",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "搜索关键字",
                        "name": "search",
                        "in": "query"
                    }
                ],
                "responses": {}
            }
        },
        "/dangerousRule/update": {
            "put": {
                "description": "更新已存在的危险规则",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "更新危险规则",
                "parameters": [
                    {
                        "description": "危险规则信息",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.DangerousRuleUpdateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/enum/ruleAction": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回平台内置的危险规则动作类型枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "危险规则检测"
                ],
                "summary": "获取危险规则动作类型列表",
                "responses": {}
            }
        },
        "/enum/scriptStatus": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回脚本状态的枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "获取脚本状态的列表",
                "responses": {}
            }
        },
        "/enum/scriptType": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回平台支持的脚本类型枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "获取平台支持的脚本类型列表",
                "responses": {}
            }
        },
        "/enum/scriptUsageType": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回平台管控脚本使用类型枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "获取脚本使用类型列表",
                "responses": {}
            }
        },
        "/enum/workflowNodeType": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回脚本编排步骤类型枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "获取脚本编排步骤类型列表",
                "responses": {}
            }
        },
        "/enum/workflowStatus": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回平台脚本编排发布状态类型枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "获取脚本编排发布状态类型列表",
                "responses": {}
            }
        },
        "/enum/workflowUsageType": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "返回脚本编排使用类型枚举,用于前端下拉框展示",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "获取脚本编排使用类型列表",
                "responses": {}
            }
        },
        "/jobs/execute": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "创建并执行一个作业",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业管理"
                ],
                "summary": "创建并执行一个作业",
                "parameters": [
                    {
                        "description": "作业执行参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.CreateWorkflowExecJobReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/jobs/list": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "分页查询作业列表",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业管理"
                ],
                "summary": "获取作业列表",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "当前页",
                        "name": "current_page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "分页大小",
                        "name": "page_size",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "作业类型",
                        "name": "job_type",
                        "in": "query"
                    }
                ],
                "responses": {}
            }
        },
        "/jobs/list/{job_id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据 job_id 获取作业信息",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业管理"
                ],
                "summary": "获取作业详情",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业ID",
                        "name": "job_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/jobs/result/{job_id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据 job_id 获取作业整体执行结果",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业管理"
                ],
                "summary": "获取作业执行结果",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业ID",
                        "name": "job_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/jobs/result/{job_id}/{ip}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据 job_id 和 IP 获取子任务执行结果",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业管理"
                ],
                "summary": "获取子任务执行结果",
                "parameters": [
                    {
                        "type": "string",
                        "description": "作业ID",
                        "name": "job_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "目标主机IP",
                        "name": "ip",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/jobs/resume": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "手动恢复暂停或失败的作业",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "作业管理"
                ],
                "summary": "人工恢复作业",
                "parameters": [
                    {
                        "description": "恢复作业参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.TaskResumeReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/add": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "创建脚本并生成初始版本",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "新增脚本",
                "parameters": [
                    {
                        "description": "新增脚本参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptAddReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/delete": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据脚本 ID 删除脚本",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "删除脚本",
                "parameters": [
                    {
                        "description": "脚本删除参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptDeleteReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/list": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "分页查询脚本列表,支持按名称、脚本类型、标签、业务类型筛选",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "获取脚本列表",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "每页数量",
                        "name": "page_size",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "当前页码",
                        "name": "current_page",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "搜索关键字",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "脚本名称(模糊匹配)",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "脚本类型,如 Shell / Python",
                        "name": "script_type",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "场景标签",
                        "name": "tag",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "业务类型,如 变更 / 预校验",
                        "name": "usage_type",
                        "in": "query"
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/update": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "更新脚本基本信息",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "更新脚本基本信息",
                "parameters": [
                    {
                        "description": "更新脚本参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptUpdateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/upload": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "上传脚本文件并读取脚本内容",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库"
                ],
                "summary": "上传脚本文件",
                "parameters": [
                    {
                        "type": "file",
                        "description": "脚本文件(如 .sh / .py)",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/{script_id}/scriptVersion/add": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "为指定脚本新增一个版本",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库-版本管理"
                ],
                "summary": "新增脚本版本",
                "parameters": [
                    {
                        "type": "string",
                        "description": "脚本 ID",
                        "name": "script_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "脚本版本信息",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptVersionAddReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/{script_id}/scriptVersion/delete": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "删除指定脚本下的某个版本",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库-版本管理"
                ],
                "summary": "删除脚本版本",
                "parameters": [
                    {
                        "type": "string",
                        "description": "脚本 ID",
                        "name": "script_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "版本 ID",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptVersionDeleteReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/{script_id}/scriptVersion/list": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据脚本 ID 获取所有版本信息",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库-版本管理"
                ],
                "summary": "获取脚本版本列表",
                "parameters": [
                    {
                        "type": "string",
                        "description": "脚本 ID",
                        "name": "script_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/{script_id}/scriptVersion/publish": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "修改脚本版本状态(如发布 / 下线)",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库-版本管理"
                ],
                "summary": "发布或下线脚本版本",
                "parameters": [
                    {
                        "type": "string",
                        "description": "脚本 ID",
                        "name": "script_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "版本状态修改参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptVersionPublisheReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/scriptlibrary/{script_id}/scriptVersion/update": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "更新指定脚本的某个版本信息",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本库-版本管理"
                ],
                "summary": "更新脚本版本",
                "parameters": [
                    {
                        "type": "string",
                        "description": "脚本 ID",
                        "name": "script_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "脚本版本信息",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.ScriptVersionUpdateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/tag/create": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "创建新的脚本使用场景标签",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本使用场景标签"
                ],
                "summary": "创建脚本使用场景标签",
                "parameters": [
                    {
                        "description": "场景标签创建参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.TagCreateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/tag/delete": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "删除使用场景标签",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本使用场景标签"
                ],
                "summary": "删除场景标签",
                "parameters": [
                    {
                        "description": "场景标签删除参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.TagDeleteReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/tag/list": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "获取脚本使用场景标签",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本使用场景标签"
                ],
                "summary": "获取脚本使用场景标签列表",
                "responses": {}
            }
        },
        "/tag/update": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "更新新的脚本使用场景标签",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本使用场景标签"
                ],
                "summary": "更新脚本使用场景标签",
                "parameters": [
                    {
                        "description": "场景标签更新参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.TagUpdateReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/audit": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "任务编排发布审批",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "任务编排审批",
                "parameters": [
                    {
                        "description": "发布状态参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.WorkflowPubReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/auditlist": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "支持分页或获取全部任务编排审批状态",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "查询任务编排审批状态列表",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "当前页",
                        "name": "current_page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页数量",
                        "name": "page_size",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "关键字搜索",
                        "name": "search",
                        "in": "query"
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/create": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "创建一个新的任务工作流",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "创建任务编排",
                "parameters": [
                    {
                        "description": "任务编排创建参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.WorkflowReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/delete": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据ID批量删除任务编排",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "删除任务编排",
                "parameters": [
                    {
                        "description": "任务编排ID列表",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.WorkflowDelReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/get": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "根据ID获取任务编排详细信息",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "获取任务编排详情",
                "parameters": [
                    {
                        "type": "string",
                        "description": "任务编排ID",
                        "name": "id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/query": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "支持分页或获取全部任务编排",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "查询任务编排列表",
                "parameters": [
                    {
                        "type": "string",
                        "description": "是否分页(true/false)",
                        "name": "paged",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "发布状态",
                        "name": "publish_status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "使用场景标签",
                        "name": "tag",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "当前页",
                        "name": "current_page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页数量",
                        "name": "page_size",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "关键字搜索",
                        "name": "search",
                        "in": "query"
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/submit": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "提交发布任务编排申请",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "提交发布任务编排",
                "parameters": [
                    {
                        "description": "发布状态参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.WorkflowPubReq"
                        }
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/sync": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "触发任务编排与关联脚本、编排的同步",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "同步关联脚本或编排",
                "parameters": [
                    {
                        "type": "string",
                        "description": "任务编排ID",
                        "name": "id",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/workflows/update": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "更新已有的任务工作流",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "脚本编排管理"
                ],
                "summary": "更新任务编排",
                "parameters": [
                    {
                        "description": "任务编排更新参数",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.WorkflowReq"
                        }
                    }
                ],
                "responses": {}
            }
        }
    },
    "definitions": {
        "model.CreateWorkflowExecJobReq": {
            "type": "object",
            "properties": {
                "exec_user": {
                    "description": "执行人",
                    "type": "string"
                },
                "input_params": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "description": "输入参数名称 key",
                                "type": "string"
                            },
                            "type": {
                                "description": "参数类型 string、json、int等",
                                "type": "string"
                            },
                            "value": {
                                "description": "参数值",
                                "type": "string"
                            }
                        }
                    }
                },
                "job": {
                    "type": "object",
                    "properties": {
                        "delay": {
                            "description": "延迟执行",
                            "type": "string"
                        },
                        "hosts": {
                            "description": "执行主机",
                            "type": "object",
                            "properties": {
                                "ips": {
                                    "description": "主机IP列表,逗号间隔",
                                    "type": "string"
                                }
                            }
                        },
                        "workflow_id": {
                            "description": "作业编排ID",
                            "type": "string"
                        }
                    }
                },
                "output_params": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "description": "输出参数名称 key",
                                "type": "string"
                            },
                            "type": {
                                "description": "参数类型 string、json、int等",
                                "type": "string"
                            },
                            "value": {
                                "description": "参数值",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "model.DangerousRuleCreateReq": {
            "type": "object",
            "properties": {
                "action": {
                    "description": "危险规则命中操作状态",
                    "type": "string"
                },
                "description": {
                    "description": "危险规则描述",
                    "type": "string"
                },
                "expression": {
                    "description": "危险规则表达式",
                    "type": "string"
                },
                "script_types": {
                    "description": "检测的脚本类型,逗号间隔",
                    "type": "string"
                },
                "status": {
                    "description": "危险规则启用/禁用状态",
                    "type": "boolean"
                }
            }
        },
        "model.DangerousRuleDeleteReq": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "删除数据对应的id数组",
                    "type": "array",
                    "items": {
                        "type": "integer"
                    }
                }
            }
        },
        "model.DangerousRuleStatusUpdateReq": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "status": {
                    "description": "危险规则新状态",
                    "type": "boolean"
                }
            }
        },
        "model.DangerousRuleUpdateReq": {
            "type": "object",
            "properties": {
                "action": {
                    "description": "危险规则命中操作状态",
                    "type": "string"
                },
                "description": {
                    "description": "危险规则描述",
                    "type": "string"
                },
                "expression": {
                    "description": "危险规则表达式",
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "script_types": {
                    "description": "检测的脚本类型,逗号间隔",
                    "type": "string"
                },
                "status": {
                    "description": "危险规则启用/禁用状态",
                    "type": "boolean"
                }
            }
        },
        "model.DetectRealtimeReq": {
            "type": "object",
            "properties": {
                "script": {
                    "description": "脚本内容",
                    "type": "string"
                },
                "script_type": {
                    "description": "脚本类型",
                    "type": "string"
                }
            }
        },
        "model.ScriptAddReq": {
            "type": "object",
            "properties": {
                "content": {
                    "description": "脚本内容",
                    "type": "string"
                },
                "description": {
                    "description": "脚本描述",
                    "type": "string"
                },
                "name": {
                    "description": "脚本名称",
                    "type": "string"
                },
                "params": {
                    "description": "脚本参数\nexample: [{\"name\": \"table\", \"type\": \"string\", \"default\": \"\", \"required\": true, \"description\": \"创建用户组变更输入参数\"}]",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "default": {
                                "description": "默认值",
                                "type": "string"
                            },
                            "description": {
                                "description": "参数描述",
                                "type": "string"
                            },
                            "name": {
                                "description": "参数名称",
                                "type": "string"
                            },
                            "required": {
                                "description": "是否必填",
                                "type": "boolean"
                            },
                            "type": {
                                "description": "参数类型",
                                "type": "string"
                            }
                        }
                    }
                },
                "script_type": {
                    "description": "脚本类型",
                    "type": "string"
                },
                "tag": {
                    "description": "脚本使用场景标签",
                    "type": "string"
                },
                "usage_type": {
                    "description": "脚本业务使用类型",
                    "type": "string"
                },
                "version_desc": {
                    "description": "版本描述(内置、用户自定义)",
                    "type": "string"
                }
            }
        },
        "model.ScriptDeleteReq": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "删除数据对应的id",
                    "type": "string"
                }
            }
        },
        "model.ScriptUpdateReq": {
            "type": "object",
            "properties": {
                "description": {
                    "description": "脚本描述",
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "description": "脚本名称",
                    "type": "string"
                },
                "tag": {
                    "description": "脚本使用场景标签",
                    "type": "string"
                },
                "usage_type": {
                    "description": "脚本业务使用类型",
                    "type": "string"
                }
            }
        },
        "model.ScriptVersionAddReq": {
            "type": "object",
            "properties": {
                "content": {
                    "description": "脚本内容",
                    "type": "string"
                },
                "params": {
                    "description": "脚本参数\nexample: [{\"name\": \"table\", \"type\": \"string\", \"default\": \"\", \"required\": true, \"description\": \"创建用户组变更输入参数\"}]",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "default": {
                                "description": "默认值",
                                "type": "string"
                            },
                            "description": {
                                "description": "参数描述",
                                "type": "string"
                            },
                            "name": {
                                "description": "参数名称",
                                "type": "string"
                            },
                            "required": {
                                "description": "是否必填",
                                "type": "boolean"
                            },
                            "type": {
                                "description": "参数类型",
                                "type": "string"
                            }
                        }
                    }
                },
                "script_id": {
                    "description": "脚本ID",
                    "type": "string"
                },
                "version_desc": {
                    "description": "版本描述(内置、用户自定义)",
                    "type": "string"
                }
            }
        },
        "model.ScriptVersionDeleteReq": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "删除数据对应的id",
                    "type": "integer"
                }
            }
        },
        "model.ScriptVersionPublisheReq": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "new_status": {
                    "type": "string"
                }
            }
        },
        "model.ScriptVersionUpdateReq": {
            "type": "object",
            "properties": {
                "content": {
                    "description": "脚本内容",
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "params": {
                    "description": "脚本参数\nexample: [{\"name\": \"table\", \"type\": \"string\", \"default\": \"\", \"required\": true, \"description\": \"创建用户组变更输入参数\"}]",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "default": {
                                "description": "默认值",
                                "type": "string"
                            },
                            "description": {
                                "description": "参数描述",
                                "type": "string"
                            },
                            "name": {
                                "description": "参数名称",
                                "type": "string"
                            },
                            "required": {
                                "description": "是否必填",
                                "type": "boolean"
                            },
                            "type": {
                                "description": "参数类型",
                                "type": "string"
                            }
                        }
                    }
                },
                "version_desc": {
                    "description": "版本描述(内置、用户自定义)",
                    "type": "string"
                }
            }
        },
        "model.TagCreateReq": {
            "type": "object",
            "properties": {
                "description": {
                    "description": "场景标签描述",
                    "type": "string"
                },
                "en_name": {
                    "description": "场景标签英文标识",
                    "type": "string"
                },
                "name": {
                    "description": "场景标签名称",
                    "type": "string"
                }
            }
        },
        "model.TagDeleteReq": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "删除数据对应的id",
                    "type": "integer"
                }
            }
        },
        "model.TagUpdateReq": {
            "type": "object",
            "properties": {
                "description": {
                    "description": "场景标签描述",
                    "type": "string"
                },
                "en_name": {
                    "description": "场景标签英文标识",
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "场景标签名称",
                    "type": "string"
                }
            }
        },
        "model.TaskResumeReq": {
            "type": "object",
            "properties": {
                "action": {
                    "description": "当前步骤执行操作",
                    "type": "string"
                },
                "ip": {
                    "description": "执行对象ip",
                    "type": "string"
                },
                "job_id": {
                    "description": "任务Id",
                    "type": "string"
                },
                "step_num": {
                    "description": "当前执行步骤",
                    "type": "integer"
                }
            }
        },
        "model.WorkflowDelReq": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "编排id",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "model.WorkflowPubReq": {
            "type": "object",
            "properties": {
                "apply_user": {
                    "description": "发布申请人",
                    "type": "string"
                },
                "auditor_user": {
                    "description": "审核人",
                    "type": "string"
                },
                "comment": {
                    "description": "审核意见",
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "new_status": {
                    "description": "变更的状态",
                    "type": "string"
                },
                "workflow_name": {
                    "type": "string"
                }
            }
        },
        "model.WorkflowReq": {
            "type": "object",
            "properties": {
                "description": {
                    "description": "作业描述",
                    "type": "string"
                },
                "edges": {
                    "description": "节点指向边",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "condition": {
                                "description": "流传条件",
                                "type": "string"
                            },
                            "id": {
                                "description": "编排元素id",
                                "type": "integer"
                            },
                            "source_node_id": {
                                "description": "编排元素起始节点Id",
                                "type": "integer"
                            },
                            "target_node_id": {
                                "description": "编排元素目标节点Id",
                                "type": "integer"
                            }
                        }
                    }
                },
                "id": {
                    "description": "作业编排唯一id",
                    "type": "string"
                },
                "input_params": {
                    "description": "编排输入参数",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "description": {
                                "description": "参数描述",
                                "type": "string"
                            },
                            "name": {
                                "description": "输入参数 key",
                                "type": "string"
                            },
                            "required": {
                                "description": "是否必填",
                                "type": "boolean"
                            },
                            "type": {
                                "description": "参数类型\nexample: string、number、host、json",
                                "type": "string"
                            }
                        }
                    }
                },
                "name": {
                    "description": "作业编排名称",
                    "type": "string"
                },
                "nodes": {
                    "description": "节点",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "expression": {
                                "description": "流程控制表达式",
                                "type": "string"
                            },
                            "id": {
                                "description": "编排元素id",
                                "type": "integer"
                            },
                            "join_mode": {
                                "description": "分支聚合模式\nexample: or and",
                                "allOf": [
                                    {
                                        "$ref": "#/definitions/workflow.JoinMode"
                                    }
                                ]
                            },
                            "name": {
                                "description": "节点功能名称",
                                "type": "string"
                            },
                            "node_script": {
                                "type": "object",
                                "properties": {
                                    "node_id": {
                                        "description": "编排元素id",
                                        "type": "integer"
                                    },
                                    "script_id": {
                                        "description": "引用脚本Id",
                                        "type": "string"
                                    },
                                    "script_intput_param": {
                                        "description": "脚本输入参数key",
                                        "type": "string"
                                    },
                                    "script_output_param": {
                                        "description": "脚本输出参数key",
                                        "type": "string"
                                    },
                                    "script_timeout": {
                                        "description": "脚本超时时间",
                                        "type": "integer"
                                    }
                                }
                            },
                            "type": {
                                "description": "编排节点类型\nexample: START END TASK MANUAL CONTROL JOIN",
                                "type": "string"
                            }
                        }
                    }
                },
                "operation_type": {
                    "description": "操作类型",
                    "type": "string"
                },
                "orchestration_mode": {
                    "description": "编排模式\nexample: LIST、GRAPH",
                    "type": "string"
                },
                "output_params": {
                    "description": "编排输出参数",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "description": {
                                "description": "参数描述",
                                "type": "string"
                            },
                            "name": {
                                "description": "输出参数 key",
                                "type": "string"
                            },
                            "required": {
                                "description": "是否必填",
                                "type": "boolean"
                            },
                            "type": {
                                "description": "参数类型",
                                "type": "string"
                            }
                        }
                    }
                },
                "runtime_mode": {
                    "description": "运行模式\nexample: AGENT_BASED、AGENTLESS",
                    "type": "string"
                },
                "tag": {
                    "description": "场景标签",
                    "type": "string"
                },
                "usage_type": {
                    "description": "编排业务类型",
                    "type": "string"
                }
            }
        },
        "workflow.JoinMode": {
            "type": "string",
            "enum": [
                "AND",
                "OR"
            ],
            "x-enum-varnames": [
                "JoinAND",
                "JoinOR"
            ]
        }
    }
}