diff --git a/dodevops-api/.gitignore b/dodevops-api/.gitignore new file mode 100644 index 0000000..dd736a1 --- /dev/null +++ b/dodevops-api/.gitignore @@ -0,0 +1,8 @@ +.vscode +.idea +task +logs +config.yaml +*.log +*.tmp +*.bak \ No newline at end of file diff --git a/dodevops-api/api/task/controller/taskansible.go b/dodevops-api/api/task/controller/taskansible.go index 6352d0a..9e4794d 100644 --- a/dodevops-api/api/task/controller/taskansible.go +++ b/dodevops-api/api/task/controller/taskansible.go @@ -2,6 +2,7 @@ package controller import ( "encoding/json" + "fmt" "io" "mime/multipart" "net/http" @@ -28,63 +29,6 @@ func NewTaskAnsibleController(service service.ITaskAnsibleService) *TaskAnsibleC return &TaskAnsibleController{service: service} } -// GetJobLog 获取任务日志(SSE实现) -// @Summary 获取Ansible任务日志(SSE) -// @Description 通过SSE协议实时获取Ansible任务执行日志 -// @Tags 任务作业 -// @Accept json -// @Produce text/event-stream -// @Param id path int true "任务ID" -// @Param work_id path int true "子任务ID" -// @Success 200 {object} string "SSE格式的实时日志" -// @Router /api/v1/task/ansible/{id}/log/{work_id} [get] -// @Security ApiKeyAuth -func (c *TaskAnsibleController) GetJobLog(ctx *gin.Context) { - // 先设置SSE响应头,确保正确的Content-Type - ctx.Header("Content-Type", "text/event-stream") - ctx.Header("Cache-Control", "no-cache") - ctx.Header("Connection", "keep-alive") - ctx.Header("Access-Control-Allow-Origin", "*") - - taskID, err := strconv.ParseUint(ctx.Param("id"), 10, 64) - if err != nil { - // SSE格式的错误响应 - ctx.Writer.WriteString("event: error\n") - ctx.Writer.WriteString("data: 无效的任务ID\n\n") - ctx.Writer.Flush() - return - } - - workID, err := strconv.ParseUint(ctx.Param("work_id"), 10, 64) - if err != nil { - // SSE格式的错误响应 - ctx.Writer.WriteString("event: error\n") - ctx.Writer.WriteString("data: 无效的子任务ID\n\n") - ctx.Writer.Flush() - return - } - - c.service.GetJobLog(ctx, uint(taskID), uint(workID)) -} - -// List 获取任务列表 -// @Summary 获取Ansible任务列表 -// @Description 获取Ansible任务列表 -// @Tags 任务作业 -// @Accept json -// @Produce json -// @Param page query int false "页码" default(1) -// @Param size query int false "每页数量" default(10) -// @Success 200 {object} result.Result{data=ListResponse} -// @Router /api/v1/task/ansiblelist [get] -// @Security ApiKeyAuth -func (c *TaskAnsibleController) List(ctx *gin.Context) { - page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1")) - size, _ := strconv.Atoi(ctx.DefaultQuery("size", "10")) - - c.service.List(ctx, page, size) -} - // CreateTask 创建Ansible任务 // @Summary 创建Ansible任务 // @Description 创建Ansible任务(1=手动,2=Git导入)。K8s部署任务请使用专门的K8s创建接口 @@ -98,6 +42,17 @@ func (c *TaskAnsibleController) List(ctx *gin.Context) { // @Param variables formData string false "全局变量JSON" // @Param playbooks formData file false "playbook文件(type=1时上传)" // @Param roles formData file false "roles目录(type=1时上传)" +// @Param extra_vars formData string false "额外变量(JSON/YAML字符串)" +// @Param cli_args formData string false "命令行参数" +// @Param use_config formData int false "是否使用配置中心(0=否,1=是)" +// @Param inventory_config_id formData int false "Inventory配置ID" +// @Param global_vars_config_id formData int false "全局变量配置ID" +// @Param extra_vars_config_id formData int false "额外变量配置ID" +// @Param cli_args_config_id formData int false "命令行参数配置ID" +// @Param cron_expr formData string false "Cron表达式(周期任务必填)" +// @Param is_recurring formData int false "是否为周期任务(0=否, 1=是)" +// @Param playbook_paths formData string false "Playbook文件路径列表(JSON数组字符串, type=2时可选)" +// @Param view_id formData int false "视图ID" // @Success 200 {object} result.Result{data=model.TaskAnsible} // @Router /api/v1/task/ansible [post] // @Security ApiKeyAuth @@ -151,6 +106,52 @@ func (c *TaskAnsibleController) CreateTask(ctx *gin.Context) { } } + // 解析Playbook Paths (type=2) + playbookPathsJSON := ctx.PostForm("playbook_paths") + var playbookPaths []string + if playbookPathsJSON != "" { + if err := json.Unmarshal([]byte(playbookPathsJSON), &playbookPaths); err != nil { + result.Failed(ctx, http.StatusBadRequest, "playbook_paths参数格式错误") + return + } + } + + // 获取其他新增参数 + extraVars := ctx.PostForm("extra_vars") + cliArgs := ctx.PostForm("cli_args") + useConfig, _ := strconv.Atoi(ctx.PostForm("use_config")) + cronExpr := ctx.PostForm("cron_expr") + isRecurring, _ := strconv.Atoi(ctx.PostForm("is_recurring")) + + // 解析ID字段 + var inventoryConfigID, globalVarsConfigID, extraVarsConfigID, cliArgsConfigID, viewID *uint + + if val := ctx.PostForm("inventory_config_id"); val != "" { + id, _ := strconv.ParseUint(val, 10, 64) + uid := uint(id) + inventoryConfigID = &uid + } + if val := ctx.PostForm("global_vars_config_id"); val != "" { + id, _ := strconv.ParseUint(val, 10, 64) + uid := uint(id) + globalVarsConfigID = &uid + } + if val := ctx.PostForm("extra_vars_config_id"); val != "" { + id, _ := strconv.ParseUint(val, 10, 64) + uid := uint(id) + extraVarsConfigID = &uid + } + if val := ctx.PostForm("cli_args_config_id"); val != "" { + id, _ := strconv.ParseUint(val, 10, 64) + uid := uint(id) + cliArgsConfigID = &uid + } + if val := ctx.PostForm("view_id"); val != "" { + id, _ := strconv.ParseUint(val, 10, 64) + uid := uint(id) + viewID = &uid + } + // 处理文件上传 var rolesFile *multipart.FileHeader var playbookFiles []*multipart.FileHeader @@ -197,46 +198,75 @@ func (c *TaskAnsibleController) CreateTask(ctx *gin.Context) { // 构建请求参数 req := &service.CreateTaskRequest{ - TaskType: taskType, - Name: name, - HostGroups: hostGroups, - GitRepo: gitRepo, - RolesContent: rolesContent, - PlaybookContents: playbookContents, - Variables: variables, + TaskType: taskType, + Name: name, + HostGroups: hostGroups, + GitRepo: gitRepo, + RolesContent: rolesContent, + PlaybookContents: playbookContents, + Variables: variables, + PlaybookPaths: playbookPaths, + ExtraVars: extraVars, + CliArgs: cliArgs, + UseConfig: useConfig, + InventoryConfigID: inventoryConfigID, + GlobalVarsConfigID: globalVarsConfigID, + ExtraVarsConfigID: extraVarsConfigID, + CliArgsConfigID: cliArgsConfigID, + CronExpr: cronExpr, + IsRecurring: isRecurring, + ViewID: viewID, } // 调用服务层 c.service.CreateTask(ctx, req) } -// AnsibleTaskRequest 创建Ansible任务请求 -// AnsibleTaskRequest 创建任务请求参数 -type AnsibleTaskRequest struct { - Type int `json:"type" form:"type" binding:"required,oneof=1 2"` // 任务类型(1=手动,2=Git导入) - Name string `json:"name" form:"name" binding:"required"` // 任务名称 - HostGroups map[string][]uint `json:"hostGroups" form:"hostGroups" binding:"required"` // 主机分组 - GitRepo string `json:"gitRepo,omitempty" form:"gitRepo"` // Git仓库地址(类型为2时必填) +// UpdateTask 修改Ansible任务 +// @Summary 修改Ansible任务 +// @Description 修改Ansible任务基本信息和配置(运行中任务不可修改) +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param id path int true "任务ID" +// @Param request body service.UpdateTaskRequest true "修改任务请求" +// @Success 200 {object} result.Result{data=model.TaskAnsible} +// @Router /api/v1/task/ansible/{id} [put] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) UpdateTask(ctx *gin.Context) { + id, err := strconv.Atoi(ctx.Param("id")) + if err != nil { + result.Failed(ctx, http.StatusBadRequest, "无效的任务ID") + return + } + + var req service.UpdateTaskRequest + if err := ctx.ShouldBindJSON(&req); err != nil { + result.Failed(ctx, http.StatusBadRequest, fmt.Sprintf("参数错误: %v", err)) + return + } + + c.service.UpdateTask(ctx, uint(id), &req) } -// GetTask 获取任务详情 -// @Summary 获取Ansible任务详情 -// @Description 获取Ansible任务详情 +// DeleteTask 删除Ansible任务 +// @Summary 删除Ansible任务 +// @Description 删除指定的Ansible任务(级联删除关联的子任务) // @Tags 任务作业 // @Accept json // @Produce json // @Param id path int true "任务ID" -// @Success 200 {object} result.Result{data=model.TaskAnsible} -// @Router /api/v1/task/ansible/{id} [get] +// @Success 200 {object} result.Result +// @Router /api/v1/task/ansible/{id} [delete] // @Security ApiKeyAuth -func (c *TaskAnsibleController) GetTask(ctx *gin.Context) { +func (c *TaskAnsibleController) DeleteTask(ctx *gin.Context) { id, err := strconv.Atoi(ctx.Param("id")) if err != nil { result.Failed(ctx, http.StatusBadRequest, "无效的任务ID") return } - c.service.GetTaskDetail(ctx, uint(id)) + c.service.DeleteTask(ctx, uint(id)) } // StartTask 启动Ansible任务 @@ -259,24 +289,81 @@ func (c *TaskAnsibleController) StartTask(ctx *gin.Context) { c.service.StartJob(ctx, uint(id)) } -// DeleteTask 删除Ansible任务 -// @Summary 删除Ansible任务 -// @Description 删除指定的Ansible任务(级联删除关联的子任务) +// GetJobLog 获取任务日志(SSE实现) +// @Summary 获取Ansible任务日志(SSE) +// @Description 通过SSE协议实时获取Ansible任务执行日志 +// @Tags 任务作业 +// @Accept json +// @Produce text/event-stream +// @Param id path int true "任务ID" +// @Param work_id path int true "子任务ID" +// @Success 200 {object} string "SSE格式的实时日志" +// @Router /api/v1/task/ansible/{id}/log/{work_id} [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) GetJobLog(ctx *gin.Context) { + // 先设置SSE响应头,确保正确的Content-Type + ctx.Header("Content-Type", "text/event-stream") + ctx.Header("Cache-Control", "no-cache") + ctx.Header("Connection", "keep-alive") + ctx.Header("Access-Control-Allow-Origin", "*") + + taskID, err := strconv.ParseUint(ctx.Param("id"), 10, 64) + if err != nil { + // SSE格式的错误响应 + ctx.Writer.WriteString("event: error\n") + ctx.Writer.WriteString("data: 无效的任务ID\n\n") + ctx.Writer.Flush() + return + } + + workID, err := strconv.ParseUint(ctx.Param("work_id"), 10, 64) + if err != nil { + // SSE格式的错误响应 + ctx.Writer.WriteString("event: error\n") + ctx.Writer.WriteString("data: 无效的子任务ID\n\n") + ctx.Writer.Flush() + return + } + + c.service.GetJobLog(ctx, uint(taskID), uint(workID)) +} + +// List 获取任务列表 +// @Summary 获取Ansible任务列表 +// @Description 获取Ansible任务列表 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param page query int false "页码" default(1) +// @Param size query int false "每页数量" default(10) +// @Success 200 {object} result.Result{data=ListResponse} +// @Router /api/v1/task/ansiblelist [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) List(ctx *gin.Context) { + page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1")) + size, _ := strconv.Atoi(ctx.DefaultQuery("size", "10")) + + c.service.List(ctx, page, size) +} + +// GetTask 获取任务详情 +// @Summary 获取Ansible任务详情 +// @Description 获取Ansible任务详情 // @Tags 任务作业 // @Accept json // @Produce json // @Param id path int true "任务ID" -// @Success 200 {object} result.Result -// @Router /api/v1/task/ansible/{id} [delete] +// @Success 200 {object} result.Result{data=model.TaskAnsible} +// @Router /api/v1/task/ansible/{id} [get] // @Security ApiKeyAuth -func (c *TaskAnsibleController) DeleteTask(ctx *gin.Context) { +func (c *TaskAnsibleController) GetTask(ctx *gin.Context) { id, err := strconv.Atoi(ctx.Param("id")) if err != nil { result.Failed(ctx, http.StatusBadRequest, "无效的任务ID") return } - c.service.DeleteTask(ctx, uint(id)) + c.service.GetTaskDetail(ctx, uint(id)) } // GetTasksByName 根据名称模糊查询任务 @@ -325,6 +412,29 @@ func (c *TaskAnsibleController) GetTasksByType(ctx *gin.Context) { c.service.GetTasksByType(ctx, taskType) } +// GetTasks 查询任务列表 (多条件) +// @Summary 查询任务列表 +// @Description 支持任务名称、类型、视图名称的多条件查询和分页 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param name query string false "任务名称(模糊)" +// @Param type query int false "任务类型" +// @Param viewName query string false "视图名称" +// @Param page query int false "页码" default(1) +// @Param size query int false "每页数量" default(10) +// @Success 200 {object} result.Result{data=ListResponse} +// @Router /api/v1/task/ansible/query [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) GetTasks(ctx *gin.Context) { + page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1")) + size, _ := strconv.Atoi(ctx.DefaultQuery("size", "10")) + name := ctx.Query("name") + taskType, _ := strconv.Atoi(ctx.Query("type")) + viewName := ctx.Query("viewName") + + c.service.GetTasks(ctx, name, taskType, viewName, page, size) +} // CreateK8sTask 创建K8s部署任务 // @Summary 创建K8s部署任务 @@ -390,19 +500,19 @@ func (c *TaskAnsibleController) CreateK8sTask(ctx *gin.Context) { // 解析主机ID数组 var masterHostIDs, workerHostIDs, etcdHostIDs []uint - + if err := json.Unmarshal([]byte(masterHostIDsJSON), &masterHostIDs); err != nil { result.Failed(ctx, http.StatusBadRequest, "Master节点主机ID格式错误") return } - + if workerHostIDsJSON != "" { if err := json.Unmarshal([]byte(workerHostIDsJSON), &workerHostIDs); err != nil { result.Failed(ctx, http.StatusBadRequest, "Worker节点主机ID格式错误") return } } - + if err := json.Unmarshal([]byte(etcdHostIDsJSON), &etcdHostIDs); err != nil { result.Failed(ctx, http.StatusBadRequest, "ETCD节点主机ID格式错误") return @@ -422,20 +532,137 @@ func (c *TaskAnsibleController) CreateK8sTask(ctx *gin.Context) { // 构建K8s任务请求 req := &service.CreateK8sTaskRequest{ - Name: name, - Description: description, - ClusterName: clusterName, - ClusterVersion: clusterVersion, - DeploymentMode: deploymentMode, - MasterHostIDs: masterHostIDs, - WorkerHostIDs: workerHostIDs, - EtcdHostIDs: etcdHostIDs, + Name: name, + Description: description, + ClusterName: clusterName, + ClusterVersion: clusterVersion, + DeploymentMode: deploymentMode, + MasterHostIDs: masterHostIDs, + WorkerHostIDs: workerHostIDs, + EtcdHostIDs: etcdHostIDs, EnabledComponents: enabledComponents, - PrivateRegistry: privateRegistry, - RegistryUsername: registryUsername, - RegistryPassword: registryPassword, + PrivateRegistry: privateRegistry, + RegistryUsername: registryUsername, + RegistryPassword: registryPassword, } // 调用服务层 c.service.CreateK8sTask(ctx, req) } + +// GetTaskHistoryList 获取任务历史记录列表 +// @Summary 获取任务历史记录列表 +// @Description 获取任务的历史执行记录列表,支持分页 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param id path int true "任务ID" +// @Param page query int false "页码" default(1) +// @Param limit query int false "每页数量" default(10) +// @Success 200 {object} result.Result{data=map[string]interface{}} +// @Router /api/v1/task/ansible/{id}/history [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) GetTaskHistoryList(ctx *gin.Context) { + taskID, err := strconv.ParseUint(ctx.Param("id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的任务ID") + return + } + page, _ := strconv.Atoi(ctx.DefaultQuery("page", "1")) + limit, _ := strconv.Atoi(ctx.DefaultQuery("limit", "10")) + + c.service.GetTaskHistoryList(ctx, uint(taskID), page, limit) +} + +// GetTaskHistoryDetail 获取任务历史记录详情 +// @Summary 获取任务历史记录详情 +// @Description 获取任务的历史执行详情,包含每个主机的执行日志 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param history_id path int true "历史记录ID" +// @Success 200 {object} result.Result{data=model.TaskAnsibleHistory} +// @Router /api/v1/task/ansible/history/{history_id} [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) GetTaskHistoryDetail(ctx *gin.Context) { + historyID, err := strconv.ParseUint(ctx.Param("history_id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的历史ID") + return + } + + c.service.GetTaskHistoryDetail(ctx, uint(historyID)) +} + +// GetTaskHistoryLog 获取历史记录日志内容 +// @Summary 获取历史记录日志内容 +// @Description 获取指定子任务历史记录的日志内容 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param work_history_id path int true "子任务历史记录ID" +// @Success 200 {object} result.Result{data=string} +// @Router /api/v1/task/ansible/history/work/{work_history_id}/log [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) GetTaskHistoryLog(ctx *gin.Context) { + workHistoryID, err := strconv.ParseUint(ctx.Param("work_history_id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的ID") + return + } + + c.service.GetTaskHistoryLog(ctx, uint(workHistoryID)) +} + +// GetTaskHistoryLogByDetails 获取历史记录日志内容(通过详细信息) +// @Summary 获取历史记录日志内容(通过详细信息) +// @Description 根据任务ID、WORKID和HistoryID获取历史任务日志 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param task_id path int true "任务ID" +// @Param work_id path int true "子任务ID" +// @Param history_id path int true "历史记录ID" +// @Success 200 {object} result.Result{data=string} +// @Router /api/v1/task/ansible/history/detail/task/{task_id}/work/{work_id}/history/{history_id}/log [get] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) GetTaskHistoryLogByDetails(ctx *gin.Context) { + taskID, err := strconv.ParseUint(ctx.Param("task_id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的任务ID") + return + } + workID, err := strconv.ParseUint(ctx.Param("work_id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的子任务ID") + return + } + historyID, err := strconv.ParseUint(ctx.Param("history_id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的历史记录ID") + return + } + + c.service.GetTaskHistoryLogByDetails(ctx, uint(taskID), uint(workID), uint(historyID)) +} + +// DeleteTaskHistory 删除任务历史记录 +// @Summary 删除任务历史记录 +// @Description 删除指定的任务历史记录及关联的日志文件 +// @Tags 任务作业 +// @Accept json +// @Produce json +// @Param id path int true "任务ID" +// @Param history_id path int true "历史记录ID" +// @Success 200 {object} result.Result +// @Router /api/v1/task/ansible/{id}/history/{history_id} [delete] +// @Security ApiKeyAuth +func (c *TaskAnsibleController) DeleteTaskHistory(ctx *gin.Context) { + historyID, err := strconv.ParseUint(ctx.Param("history_id"), 10, 64) + if err != nil { + result.Failed(ctx, 400, "无效的历史记录ID") + return + } + + c.service.DeleteTaskHistory(ctx, uint(historyID)) +} diff --git a/dodevops-api/api/task/dao/taskansible.go b/dodevops-api/api/task/dao/taskansible.go index e615cc8..7d489eb 100644 --- a/dodevops-api/api/task/dao/taskansible.go +++ b/dodevops-api/api/task/dao/taskansible.go @@ -1,8 +1,11 @@ package dao import ( - "fmt" "dodevops-api/api/task/model" + "fmt" + "os" + "path/filepath" + "strings" "sync" "time" @@ -34,24 +37,24 @@ const cacheTTL = 5 * time.Second // 5秒缓存TTL func (d *TaskAnsibleDao) getFromCache(key string) (interface{}, bool) { d.mutex.RLock() defer d.mutex.RUnlock() - + item, exists := d.cache[key] if !exists { return nil, false } - + // 检查是否过期 if time.Since(item.timestamp) > cacheTTL { return nil, false } - + return item.data, true } func (d *TaskAnsibleDao) setCache(key string, data interface{}) { d.mutex.Lock() defer d.mutex.Unlock() - + d.cache[key] = &cacheItem{ data: data, timestamp: time.Now(), @@ -61,7 +64,7 @@ func (d *TaskAnsibleDao) setCache(key string, data interface{}) { func (d *TaskAnsibleDao) clearCache(pattern string) { d.mutex.Lock() defer d.mutex.Unlock() - + // 简单实现:清空所有缓存 d.cache = make(map[string]*cacheItem) } @@ -149,7 +152,7 @@ func (d *TaskAnsibleDao) GetWorkByID(taskID, workID uint) (*model.TaskAnsibleWor return work, nil } } - + var work model.TaskAnsibleWork // 只查询必要的字段,减少数据传输 err := d.DB.Select("id, task_id, entry_file_name, log_path, status, start_time, end_time"). @@ -157,7 +160,7 @@ func (d *TaskAnsibleDao) GetWorkByID(taskID, workID uint) (*model.TaskAnsibleWor if err != nil { return nil, err } - + // 存入缓存 d.setCache(cacheKey, &work) return &work, nil @@ -195,18 +198,18 @@ func (d *TaskAnsibleDao) GetTaskDetail(taskID uint) (*model.TaskAnsible, error) return task, nil } } - + var task model.TaskAnsible // 只预加载Works的关键字段,减少数据传输 err := d.DB.Preload("Works", func(db *gorm.DB) *gorm.DB { return db.Select("id, task_id, entry_file_name, status, start_time, end_time, duration") }).Where("id = ?", taskID).First(&task).Error - + if err == nil { // 存入缓存 d.setCache(cacheKey, &task) } - + return &task, err } @@ -219,18 +222,18 @@ func (d *TaskAnsibleDao) GetWorkStatus(taskID, workID uint) (int, error) { return status, nil } } - + var status int err := d.DB.Model(&model.TaskAnsibleWork{}). Select("status"). Where("task_id = ? AND id = ?", taskID, workID). Scan(&status).Error - + if err == nil { // 存入缓存 d.setCache(cacheKey, status) } - + return status, err } @@ -239,12 +242,12 @@ func (d *TaskAnsibleDao) StartJob(taskID uint) error { err := d.DB.Model(&model.TaskAnsible{}). Where("id = ?", taskID). Update("status", 2).Error // 2表示运行中 - + if err == nil { // 清空相关缓存 d.clearCache("") } - + return err } @@ -257,3 +260,156 @@ func (d *TaskAnsibleDao) StopJob(taskID, workID uint) error { "end_time": gorm.Expr("NOW()"), }).Error } + +// CreateTaskAnsibleHistory 创建任务历史记录 +func (d *TaskAnsibleDao) CreateTaskAnsibleHistory(history *model.TaskAnsibleHistory) error { + return d.DB.Create(history).Error +} + +// CreateTaskAnsibleworkHistories 批量创建子任务历史详情 +func (d *TaskAnsibleDao) CreateTaskAnsibleworkHistories(items []model.TaskAnsibleworkHistory) error { + return d.DB.Create(&items).Error +} + +// UpdateTaskAnsibleHistory 更新任务历史记录 +func (d *TaskAnsibleDao) UpdateTaskAnsibleHistory(history *model.TaskAnsibleHistory) error { + return d.DB.Save(history).Error +} + +// GetTaskAnsibleHistoryList 获取任务历史记录列表 +func (d *TaskAnsibleDao) GetTaskAnsibleHistoryList(taskID uint, page, limit int) ([]model.TaskAnsibleHistory, int64, error) { + var histories []model.TaskAnsibleHistory + var total int64 + + db := d.DB.Model(&model.TaskAnsibleHistory{}).Where("task_id = ?", taskID) + if err := db.Count(&total).Error; err != nil { + return nil, 0, err + } + + err := db.Order("created_at desc").Offset((page - 1) * limit).Limit(limit).Find(&histories).Error + return histories, total, err +} + +// GetTaskAnsibleHistoryDetail 获取任务历史记录详情(包含WorkLogs) +func (d *TaskAnsibleDao) GetTaskAnsibleHistoryDetail(historyID uint) (*model.TaskAnsibleHistory, error) { + var history model.TaskAnsibleHistory + err := d.DB.Preload("WorkHistories").First(&history, historyID).Error + return &history, err +} + +// DeleteOldHistory 删除旧的历史记录,保留最近 N 条 +func (d *TaskAnsibleDao) DeleteOldHistory(taskID uint, maxKeep int) error { + var count int64 + d.DB.Model(&model.TaskAnsibleHistory{}).Where("task_id = ?", taskID).Count(&count) + + if count > int64(maxKeep) { + // 找出要删除的ID + var historyIDs []uint + // MySQL requires LIMIT when using OFFSET. We use count as a safe upper bound. + err := d.DB.Model(&model.TaskAnsibleHistory{}). + Select("id"). + Where("task_id = ?", taskID). + Order("created_at desc"). + Offset(maxKeep). + Limit(int(count)). + Find(&historyIDs).Error + + if err != nil { + return err + } + + if len(historyIDs) > 0 { + // 删除关联的日志文件目录 + var workHistories []model.TaskAnsibleworkHistory + if err := d.DB.Select("log_path").Where("history_id IN ?", historyIDs).Find(&workHistories).Error; err == nil { + for _, work := range workHistories { + if work.LogPath != "" { + // work.LogPath example: logs/ansible/103/102/20260128205209/deploy.log + // 计算需要删除的目录 (run_id目录) + dirToDelete := filepath.Dir(work.LogPath) + + // 安全检查:确保要删除的目录在 logs/ansible 之下,且长度合理 + if len(dirToDelete) > 12 && strings.HasPrefix(dirToDelete, "logs/ansible") { + // 删除该目录及其内容 + // 使用相对路径,假设程序运行在项目根目录 + os.RemoveAll(dirToDelete) + } + } + } + } + + // 删除子表 + if err := d.DB.Where("history_id IN ?", historyIDs).Delete(&model.TaskAnsibleworkHistory{}).Error; err != nil { + return err + } + + // 删除主表 + if err := d.DB.Where("id IN ?", historyIDs).Delete(&model.TaskAnsibleHistory{}).Error; err != nil { + return err + } + } + } + return nil +} + +// DeleteHistory 删除历史记录 +func (d *TaskAnsibleDao) DeleteHistory(historyID uint) error { + // 开启事务 + tx := d.DB.Begin() + defer func() { + if r := recover(); r != nil { + tx.Rollback() + } + }() + + // 1. 删除子表 TaskAnsibleworkHistory + if err := tx.Where("history_id = ?", historyID).Delete(&model.TaskAnsibleworkHistory{}).Error; err != nil { + tx.Rollback() + return err + } + + // 2. 删除主表 TaskAnsibleHistory + if err := tx.Where("id = ?", historyID).Delete(&model.TaskAnsibleHistory{}).Error; err != nil { + tx.Rollback() + return err + } + + return tx.Commit().Error +} + +// GetTasks 查询任务列表 (多条件) +func (d *TaskAnsibleDao) GetTasks(name string, taskType int, viewName string, page, size int) ([]model.TaskAnsible, int64, error) { + var tasks []model.TaskAnsible + var total int64 + + // 基础查询 + query := d.DB.Model(&model.TaskAnsible{}).Preload("View") + + // 关联查询视图表,以便按视图名称筛选 + if viewName != "" { + query = query.Joins("JOIN task_ansible_view ON task_ansible.view_id = task_ansible_view.id"). + Where("task_ansible_view.name = ?", viewName) + } + + // 任务名称模糊查询 + if name != "" { + query = query.Where("task_ansible.name LIKE ?", "%"+name+"%") + } + + // 任务类型查询 + if taskType != 0 { + query = query.Where("task_ansible.type = ?", taskType) + } + + // 计算总数 + if err := query.Count(&total).Error; err != nil { + return nil, 0, err + } + + // 分页查询 + if err := query.Order("task_ansible.id DESC").Offset((page - 1) * size).Limit(size).Find(&tasks).Error; err != nil { + return nil, 0, err + } + + return tasks, total, nil +} diff --git a/dodevops-api/api/task/model/taskansible.go b/dodevops-api/api/task/model/taskansible.go index ac661a1..a1efbc0 100644 --- a/dodevops-api/api/task/model/taskansible.go +++ b/dodevops-api/api/task/model/taskansible.go @@ -4,21 +4,37 @@ import "time" // TaskAnsible Ansible任务主表 type TaskAnsible struct { - ID uint `gorm:"primaryKey;comment:'主键ID'"` - Name string `gorm:"size:100;not null;uniqueIndex;comment:'任务名称'"` - Description string `gorm:"type:text;comment:'任务描述'"` - Type int `gorm:"not null;default:1;comment:'任务类型:1-手动,2-Git,3-K8s'"` - GitRepo string `gorm:"size:255;comment:'Git仓库地址'"` - HostGroups string `gorm:"type:text;not null;comment:'主机分组JSON'"` - AllHostIDs string `gorm:"type:text;not null;comment:'所有主机ID JSON数组'"` - GlobalVars string `gorm:"type:text;comment:'全局变量JSON'"` - Status int `json:"status" gorm:"not null;default:1;index:idx_task_status;comment:'任务状态:1-等待中,2-运行中,3-成功,4-异常'"` - ErrorMsg string `gorm:"type:text;comment:'错误信息'"` - TaskCount int `gorm:"not null;default:0;comment:'任务数量(Type=1时为上传文件数,Type=2时为解析的playbook数,Type=3时固定为1)'"` - TotalDuration int `gorm:"not null;default:0;comment:'任务执行总耗时(秒,所有子任务耗时总和)'"` - CreatedAt time.Time `gorm:"not null;comment:'创建时间'"` - UpdatedAt time.Time `gorm:"not null;comment:'更新时间'"` - Works []TaskAnsibleWork `gorm:"foreignKey:TaskID;comment:'子任务列表'"` + ID uint `gorm:"primaryKey;comment:'主键ID'"` + Name string `gorm:"size:100;not null;uniqueIndex;comment:'任务名称'"` + Description string `gorm:"type:text;comment:'任务描述'"` + Type int `gorm:"not null;default:1;comment:'任务类型:1-手动,2-Git,3-K8s'"` + GitRepo string `gorm:"size:255;comment:'Git仓库地址'"` + HostGroups string `gorm:"type:text;not null;comment:'主机分组JSON'"` + AllHostIDs string `gorm:"type:text;not null;comment:'所有主机ID JSON数组'"` + GlobalVars string `gorm:"type:text;comment:'全局变量JSON'"` + ExtraVars string `gorm:"type:text;comment:'额外参数YAML/JSON'"` + CliArgs string `gorm:"type:text;comment:'cli命令行参数'"` + Status int `json:"status" gorm:"not null;default:1;index:idx_task_status;comment:'任务状态:1-等待中,2-运行中,3-成功,4-异常'"` + ErrorMsg string `gorm:"type:text;comment:'错误信息'"` + TaskCount int `gorm:"not null;default:0;comment:'任务数量(Type=1时为上传文件数,Type=2时为解析的playbook数,Type=3时固定为1)'"` + TotalDuration int `gorm:"not null;default:0;comment:'任务执行总耗时(秒,所有子任务耗时总和)'"` + UseConfig int `gorm:"not null;default:0;comment:'是否使用配置管理中的参数 0-不使用,1-使用'"` + InventoryConfigID *uint `gorm:"comment:'选用的inventory配置ID'"` + GlobalVarsConfigID *uint `gorm:"comment:'选用的global_vars配置ID'"` + ExtraVarsConfigID *uint `gorm:"comment:'选用的extra_vars配置ID'"` + CliArgsConfigID *uint `gorm:"comment:'选用的cli_args配置ID'"` + MaxHistoryKeep int `gorm:"default:3;comment:'最大保留历史记录数'"` + CreatedAt time.Time `gorm:"not null;comment:'创建时间'"` + UpdatedAt time.Time `gorm:"not null;comment:'更新时间'"` + Works []TaskAnsibleWork `gorm:"foreignKey:TaskID;comment:'子任务列表'"` + CronExpr string `gorm:"size:64;comment:'定时表达式'"` + IsRecurring int `gorm:"not null;default:0;comment:'是否周期性任务:0-否,1-是'"` + ViewID *uint `gorm:"comment:'视图ID'"` + View *TaskAnsibleView `gorm:"foreignKey:ViewID"` + InventoryConfig *ConfigAnsible `gorm:"foreignKey:InventoryConfigID"` + GlobalVarsConfig *ConfigAnsible `gorm:"foreignKey:GlobalVarsConfigID"` + ExtraVarsConfig *ConfigAnsible `gorm:"foreignKey:ExtraVarsConfigID"` + CliArgsConfig *ConfigAnsible `gorm:"foreignKey:CliArgsConfigID"` } func (TaskAnsible) TableName() string { diff --git a/dodevops-api/api/task/service/taskansible.go b/dodevops-api/api/task/service/taskansible.go index e5067c6..8601f0c 100644 --- a/dodevops-api/api/task/service/taskansible.go +++ b/dodevops-api/api/task/service/taskansible.go @@ -27,69 +27,96 @@ import ( "gorm.io/gorm" ) -// RealTimeLogWriter 实时日志写入器,支持立即刷新到磁盘 -type RealTimeLogWriter struct { - file *os.File +// ITaskAnsibleService 定义Ansible任务服务接口 +type ITaskAnsibleService interface { + CreateTask(c *gin.Context, req *CreateTaskRequest) // 创建任务 + CreateK8sTask(c *gin.Context, req *CreateK8sTaskRequest) // 创建K8s任务 + List(c *gin.Context, page, size int) // 获取任务列表 + StartJob(c *gin.Context, taskID uint) // 启动任务 + StopJob(c *gin.Context, taskID, workID uint) // 停止任务 + GetJobLog(c *gin.Context, taskID, workID uint) // 实时获取任务日志(SSE) + GetJobStatus(c *gin.Context, taskID, workID uint) // 获取任务状态 + GetTaskDetail(c *gin.Context, taskID uint) // 获取任务详情 + GetWorkByID(taskID, workID uint) (*model.TaskAnsibleWork, error) // 获取子任务详情 + DeleteTask(c *gin.Context, taskID uint) // 删除任务 + GetTasksByName(c *gin.Context, name string) // 根据名称模糊查询任务 + GetTasksByType(c *gin.Context, taskType int) // 根据类型查询任务 + GetTasks(c *gin.Context, name string, taskType int, viewName string, page, size int) // 综合查询任务列表 + UpdateTask(c *gin.Context, taskID uint, req *UpdateTaskRequest) // 修改任务 + GetTaskHistoryList(c *gin.Context, taskID uint, page, limit int) // 获取任务历史记录列表 + GetTaskHistoryDetail(c *gin.Context, historyID uint) // 获取任务历史记录详情 + GetTaskHistoryLog(c *gin.Context, historyWorkID uint) // 获取历史任务日志 + GetTaskHistoryLogByDetails(c *gin.Context, taskID, workID, historyID uint) // 获取历史任务日志(通过详细信息) + DeleteTaskHistory(c *gin.Context, historyID uint) // 删除任务历史记录 + ExecuteTask(taskID uint) error // 执行任务 } -// Write 实现io.Writer接口,每次写入后立即刷新到磁盘 -func (w *RealTimeLogWriter) Write(p []byte) (n int, err error) { - n, err = w.file.Write(p) - if err != nil { - return n, err +func NewTaskAnsibleService(db *gorm.DB) ITaskAnsibleService { + return &TaskAnsibleServiceImpl{ + dao: dao.NewTaskAnsibleDao(db), } - // 立即刷新到磁盘,确保SSE能实时读取 - w.file.Sync() - return n, nil -} - -// WriteWithTime 带时间戳的写入 -func (w *RealTimeLogWriter) WriteWithTime(content string) error { - _, err := w.Write([]byte(content)) - return err } -// ITaskAnsibleService 定义Ansible任务服务接口 -type ITaskAnsibleService interface { - CreateTask(c *gin.Context, req *CreateTaskRequest) // 创建任务 - CreateK8sTask(c *gin.Context, req *CreateK8sTaskRequest) // 创建K8s任务 - List(c *gin.Context, page, size int) // 获取任务列表 - StartJob(c *gin.Context, taskID uint) // 启动任务 - StopJob(c *gin.Context, taskID, workID uint) // 停止任务 - GetJobLog(c *gin.Context, taskID, workID uint) // 实时获取任务日志(SSE) - GetJobStatus(c *gin.Context, taskID, workID uint) // 获取任务状态 - GetTaskDetail(c *gin.Context, taskID uint) // 获取任务详情 - GetWorkByID(taskID, workID uint) (*model.TaskAnsibleWork, error) // 获取子任务详情 - DeleteTask(c *gin.Context, taskID uint) // 删除任务 - GetTasksByName(c *gin.Context, name string) // 根据名称模糊查询任务 - GetTasksByType(c *gin.Context, taskType int) // 根据类型查询任务 +// TaskAnsibleServiceImpl 实现Ansible任务服务 +type TaskAnsibleServiceImpl struct { + dao *dao.TaskAnsibleDao } // CreateTaskRequest 创建任务请求参数 type CreateTaskRequest struct { - TaskType int `json:"taskType"` - Name string `json:"name"` - HostGroups map[string][]uint `json:"hostGroups"` - GitRepo string `json:"gitRepo"` - RolesContent []byte `json:"rolesContent"` - PlaybookContents [][]byte `json:"playbookContents"` - Variables map[string]string `json:"variables"` + TaskType int `json:"taskType"` + Name string `json:"name"` + HostGroups map[string][]uint `json:"hostGroups"` + GitRepo string `json:"gitRepo"` + RolesContent []byte `json:"rolesContent"` + PlaybookContents [][]byte `json:"playbookContents"` + PlaybookPaths []string `json:"playbookPaths"` // type=2: 指定多个playbook路径 + Variables map[string]string `json:"variables"` + ExtraVars string `json:"extraVars"` + CliArgs string `json:"cliArgs"` + UseConfig int `json:"useConfig"` + InventoryConfigID *uint `json:"inventoryConfigId"` + GlobalVarsConfigID *uint `json:"globalVarsConfigId"` + ExtraVarsConfigID *uint `json:"extraVarsConfigId"` + CliArgsConfigID *uint `json:"cliArgsConfigId"` + CronExpr string `json:"cronExpr"` + IsRecurring int `json:"isRecurring"` + ViewID *uint `json:"viewId"` +} + +// UpdateTaskRequest 修改任务请求参数 +type UpdateTaskRequest struct { + Name string `json:"name"` + HostGroups map[string][]uint `json:"hostGroups"` + GitRepo string `json:"gitRepo"` + PlaybookPaths []string `json:"playbookPaths"` + Variables map[string]string `json:"variables"` + ExtraVars string `json:"extraVars"` + CliArgs string `json:"cliArgs"` + UseConfig int `json:"useConfig"` + InventoryConfigID *uint `json:"inventoryConfigId"` + GlobalVarsConfigID *uint `json:"globalVarsConfigId"` + ExtraVarsConfigID *uint `json:"extraVarsConfigId"` + CliArgsConfigID *uint `json:"cliArgsConfigId"` + CronExpr string `json:"cronExpr"` + IsRecurring *int `json:"isRecurring"` + ViewID *uint `json:"viewId"` } // CreateK8sTaskRequest 创建K8s任务请求参数 type CreateK8sTaskRequest struct { - Name string `json:"name"` - Description string `json:"description"` - ClusterName string `json:"cluster_name"` - ClusterVersion string `json:"cluster_version"` - DeploymentMode int `json:"deployment_mode"` - MasterHostIDs []uint `json:"master_host_ids"` - WorkerHostIDs []uint `json:"worker_host_ids"` - EtcdHostIDs []uint `json:"etcd_host_ids"` - EnabledComponents []string `json:"enabled_components"` - PrivateRegistry string `json:"private_registry"` - RegistryUsername string `json:"registry_username"` - RegistryPassword string `json:"registry_password"` + Name string `json:"name"` + Description string `json:"description"` + ClusterName string `json:"cluster_name"` + ClusterVersion string `json:"cluster_version"` + DeploymentMode int `json:"deployment_mode"` + MasterHostIDs []uint `json:"master_host_ids"` + WorkerHostIDs []uint `json:"worker_host_ids"` + EtcdHostIDs []uint `json:"etcd_host_ids"` + EnabledComponents []string `json:"enabled_components"` + PrivateRegistry string `json:"private_registry"` + RegistryUsername string `json:"registry_username"` + RegistryPassword string `json:"registry_password"` RegistryConfig *RegistryConfig `json:"registry_config"` // 新的嵌套配置格式 } @@ -131,17 +158,6 @@ type K8sConfigJSON struct { } `json:"registry,omitempty"` } -// TaskAnsibleServiceImpl 实现Ansible任务服务 -type TaskAnsibleServiceImpl struct { - dao *dao.TaskAnsibleDao -} - -func NewTaskAnsibleService(db *gorm.DB) ITaskAnsibleService { - return &TaskAnsibleServiceImpl{ - dao: dao.NewTaskAnsibleDao(db), - } -} - // HostSSHInfo 主机SSH连接信息 type HostSSHInfo struct { ID uint @@ -150,7 +166,7 @@ type HostSSHInfo struct { User string Password string Key string - AuthType int // 认证类型:1-密码,2-私钥,3-公钥免认证 + AuthType int // 认证类型:1-密码,2-私钥,3-公钥免认证 } // HostSSHInfoCollection 主机信息集合 @@ -159,6 +175,31 @@ type HostSSHInfoCollection struct { HostInfos map[uint]HostSSHInfo } +// RealTimeLogWriter 实时日志写入器,支持立即刷新到磁盘 +type RealTimeLogWriter struct { + file *os.File +} + +// OnTaskConfigChange 任务配置变更钩子 +var OnTaskConfigChange func(task *model.TaskAnsible) + +// Write 实现io.Writer接口,每次写入后立即刷新到磁盘 +func (w *RealTimeLogWriter) Write(p []byte) (n int, err error) { + n, err = w.file.Write(p) + if err != nil { + return n, err + } + // 立即刷新到磁盘,确保SSE能实时读取 + w.file.Sync() + return n, nil +} + +// WriteWithTime 带时间戳的写入 +func (w *RealTimeLogWriter) WriteWithTime(content string) error { + _, err := w.Write([]byte(content)) + return err +} + // GetHostSSHInfo 获取主机SSH信息 func (s *TaskAnsibleServiceImpl) GetHostSSHInfo(hostGroups map[string][]uint) (*HostSSHInfoCollection, error) { // 获取所有唯一主机ID @@ -257,7 +298,7 @@ func (c *HostSSHInfoCollection) GenerateInventory() string { } case 2: // 私钥认证 if host.Key != "" { - builder.WriteString(fmt.Sprintf(" ansible_ssh_private_key_file=%s", host.Key)) + // builder.WriteString(fmt.Sprintf(" ansible_ssh_private_key_file=%s", host.Key)) } case 3: // 公钥免认证 // 不添加额外的认证参数,使用系统默认SSH配置 @@ -304,6 +345,11 @@ func (s *TaskAnsibleServiceImpl) DeleteTask(c *gin.Context, taskID uint) { return } + // 触发任务配置变更钩子 (通知调度器移除任务) + if OnTaskConfigChange != nil { + OnTaskConfigChange(&model.TaskAnsible{ID: taskID, IsRecurring: 0}) + } + // 4. 删除任务相关的文件目录(异步处理,避免影响响应速度) go func() { defer func() { @@ -312,7 +358,7 @@ func (s *TaskAnsibleServiceImpl) DeleteTask(c *gin.Context, taskID uint) { }() // 删除任务目录: task/{taskID}/{taskName} - taskDir := fmt.Sprintf("task/%d/%s", taskID, task.Name) + taskDir := fmt.Sprintf("task/%d", taskID) if _, err := os.Stat(taskDir); err == nil { os.RemoveAll(taskDir) } @@ -340,25 +386,48 @@ func (s *TaskAnsibleServiceImpl) GetJobLog(c *gin.Context, taskID, workID uint) c.Header("Cache-Control", "no-cache") c.Header("Connection", "keep-alive") c.Header("Access-Control-Allow-Origin", "*") - + // 检查认证状态(调试信息) token := c.Query("token") if token == "" || token == "null" { // 对于已完成的任务,即使token为空也允许读取日志 - // sendSSEError(c, "认证失败:token为空") - // return } - // 获取任务记录(仅查询一次) - work, err := s.dao.GetWorkByID(taskID, workID) - if err != nil { - sendSSEError(c, fmt.Sprintf("获取任务记录失败: %v", err)) - return + // 循环尝试获取任务记录,等待 LogPath 生成(最多等待5秒) + var work *taskmodel.TaskAnsibleWork + var err error + maxRetries := 5 + + for i := 0; i < maxRetries; i++ { + work, err = s.dao.GetWorkByID(taskID, workID) + if err != nil { + sendSSEError(c, fmt.Sprintf("获取任务记录失败: %v", err)) + return + } + + // 如果 LogPath 存在,或者任务已经是完成/失败状态,停止等待 + if work.LogPath != "" || work.Status == 3 || work.Status == 4 { + break + } + time.Sleep(1 * time.Second) } // 检查日志路径 if work.LogPath == "" { - sendSSEError(c, "日志文件路径不存在") + // 如果 LogPath 为空,检查是否因为任务启动失败 + if work.Status == 4 { + // 如果子任务有错误信息,发送给前端 + if work.ErrorMsg != "" { + sendSSEError(c, fmt.Sprintf("任务执行失败: %s", work.ErrorMsg)) + } else { + // 获取父任务查看是否有全局错误 + task, _ := s.dao.GetTaskDetail(taskID) + // 假设父任务也没有详细信息 + sendSSEError(c, fmt.Sprintf("任务启动失败,详情请查看任务状态 (TaskStatus=%d)", task.Status)) + } + } else { + sendSSEError(c, "日志文件路径尚未生成,请稍后重试") + } return } @@ -370,13 +439,11 @@ func (s *TaskAnsibleServiceImpl) GetJobLog(c *gin.Context, taskID, workID uint) // 如果是相对路径,转换为绝对路径 // 获取当前工作目录 cwd, _ := os.Getwd() - // 检查是否在任务子目录中,如果是则返回到项目根目录 + // 检查是否在任务子目录中,如果是则返回到项目根目录(防御性编程) if strings.Contains(cwd, "/task/") { - // 切换到项目根目录计算绝对路径 projectRoot := strings.Split(cwd, "/task/")[0] logPath = filepath.Join(projectRoot, work.LogPath) } else { - // 已经在项目根目录 logPath = filepath.Join(cwd, work.LogPath) } } @@ -421,7 +488,7 @@ func (s *TaskAnsibleServiceImpl) GetJobLog(c *gin.Context, taskID, workID uint) // 读取完整的日志文件内容 lineCount := 0 batchSize := 10 // 每10行flush一次,平衡性能和实时性 - + for { line, err := reader.ReadString('\n') if err == io.EOF { @@ -432,7 +499,7 @@ func (s *TaskAnsibleServiceImpl) GetJobLog(c *gin.Context, taskID, workID uint) return } lineCount++ - + // 发送日志内容 (确保非空行才发送) trimmed := strings.TrimSpace(line) if trimmed != "" { @@ -441,7 +508,7 @@ func (s *TaskAnsibleServiceImpl) GetJobLog(c *gin.Context, taskID, workID uint) // 发送空行 fmt.Fprintf(c.Writer, "data: \n\n") } - + // 批量flush,减少网络开销 if lineCount%batchSize == 0 { if flusher, ok := c.Writer.(http.Flusher); ok { @@ -453,10 +520,10 @@ func (s *TaskAnsibleServiceImpl) GetJobLog(c *gin.Context, taskID, workID uint) return } } - + lastPos, _ = file.Seek(0, io.SeekCurrent) } - + // 最后flush剩余数据 if flusher, ok := c.Writer.(http.Flusher); ok { flusher.Flush() @@ -608,12 +675,36 @@ func (s *TaskAnsibleServiceImpl) GetTaskDetail(c *gin.Context, taskID uint) { } } - // 构建精简的任务信息 + // 解析HostGroups + var hostGroups map[string][]uint + json.Unmarshal([]byte(task.HostGroups), &hostGroups) + + // 解析GlobalVars + var variables map[string]string + json.Unmarshal([]byte(task.GlobalVars), &variables) + + // 构建完整的任务信息 taskInfo := gin.H{ - "ID": task.ID, // 父任务ID - "Name": task.Name, // 父任务名称 - "TaskCount": task.TaskCount, // 子任务数量 - "Works": works, // 子任务列表 + "ID": task.ID, + "Name": task.Name, + "Type": task.Type, + "Description": task.Description, + "GitRepo": task.GitRepo, + "HostGroups": hostGroups, + "GlobalVars": variables, + "ExtraVars": task.ExtraVars, + "CliArgs": task.CliArgs, + "Status": task.Status, + "TaskCount": task.TaskCount, + "TotalDuration": task.TotalDuration, + "UseConfig": task.UseConfig, + "InventoryConfigID": task.InventoryConfigID, + "GlobalVarsConfigID": task.GlobalVarsConfigID, + "ExtraVarsConfigID": task.ExtraVarsConfigID, + "CliArgsConfigID": task.CliArgsConfigID, + "CreatedAt": task.CreatedAt, + "UpdatedAt": task.UpdatedAt, + "Works": works, } result.Success(c, gin.H{ @@ -626,53 +717,142 @@ func (s *TaskAnsibleServiceImpl) GetWorkByID(taskID, workID uint) (*model.TaskAn return s.dao.GetWorkByID(taskID, workID) } +// GetTasks 查询任务列表 +func (s *TaskAnsibleServiceImpl) GetTasks(c *gin.Context, name string, taskType int, viewName string, page, size int) { + tasks, total, err := s.dao.GetTasks(name, taskType, viewName, page, size) + if err != nil { + result.Failed(c, 500, "查询任务列表失败: "+err.Error()) + return + } + result.Success(c, gin.H{"data": tasks, "total": total}) +} + // StartJob 启动任务 func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { + if err := s.ExecuteTask(taskID); err != nil { + c.JSON(500, gin.H{"error": err.Error()}) + return + } + c.JSON(200, gin.H{"message": "任务已开始执行"}) +} + +// ExecuteTask 执行任务 +func (s *TaskAnsibleServiceImpl) ExecuteTask(taskID uint) error { // 1. 获取任务详情(包含子任务) task, err := s.dao.GetTaskDetail(taskID) if err != nil { - c.JSON(500, gin.H{"error": fmt.Sprintf("获取任务失败: %v", err)}) - return + return fmt.Errorf("获取任务失败: %v", err) } // 检查任务是否存在子任务 if len(task.Works) == 0 { - c.JSON(400, gin.H{"error": "任务没有子任务,无法执行"}) - return + return fmt.Errorf("任务没有子任务,无法执行") } // 2. 更新任务状态为运行中(状态=2) if err := s.dao.DB.Model(&model.TaskAnsible{}).Where("id = ?", taskID).Update("status", 2).Error; err != nil { - c.JSON(500, gin.H{"error": fmt.Sprintf("更新任务状态失败: %v", err)}) - return + return fmt.Errorf("更新任务状态失败: %v", err) } - // 3. 异步执行Ansible任务(优化版本 - 直接执行,无需重复查询) + // 3. 异步执行Ansible任务 go func() { defer func() { if r := recover(); r != nil { - s.updateTaskErrorStatus(taskID, fmt.Errorf("任务执行异常: %v", r)) + errMsg := fmt.Sprintf("任务执行异常: %v", r) + s.updateTaskErrorStatus(taskID, fmt.Errorf("%s", errMsg)) + // 同时更新所有子任务状态为失败 + s.dao.DB.Model(&model.TaskAnsibleWork{}).Where("task_id = ?", taskID). + Updates(map[string]interface{}{"status": 4, "error_msg": errMsg}) } }() - // 构建任务目录路径:task/{taskID}/{taskName} - taskDir := fmt.Sprintf("task/%d/%s", taskID, task.Name) + // 获取当前工作目录 + workDir, _ := os.Getwd() + // 防御性处理:防止WD在task子目录中 + if strings.Contains(workDir, "/task/") { + workDir = strings.Split(workDir, "/task/")[0] + } + + // 构建任务目录相对路径 + taskRelDir := fmt.Sprintf("task/%d/%s", taskID, task.Name) + // 构建任务目录绝对路径 + absTaskDir := filepath.Join(workDir, taskRelDir) // 检查任务目录是否存在 - if _, err := os.Stat(taskDir); os.IsNotExist(err) { - s.updateTaskErrorStatus(taskID, fmt.Errorf("任务目录不存在: %s", taskDir)) + if _, err := os.Stat(absTaskDir); os.IsNotExist(err) { + errMsg := fmt.Sprintf("任务目录不存在: %s (请尝试删除并重新创建任务)", absTaskDir) + s.updateTaskErrorStatus(taskID, fmt.Errorf("%s", errMsg)) + s.dao.DB.Model(&model.TaskAnsibleWork{}).Where("task_id = ?", taskID). + Updates(map[string]interface{}{"status": 4, "error_msg": errMsg}) return } - // 获取当前工作目录 - originalDir, _ := os.Getwd() + // Inventory文件绝对路径 + inventoryPath := filepath.Join(absTaskDir, "hosts") + + // 如果启用配置中心且指定了inventory配置,则覆盖hosts文件 + if task.UseConfig == 1 && task.InventoryConfigID != nil { + var cfg taskmodel.ConfigAnsible + if err := s.dao.DB.First(&cfg, *task.InventoryConfigID).Error; err == nil { + // 写入配置中心的Inventory内容 + if err := os.WriteFile(inventoryPath, []byte(cfg.Content), 0644); err != nil { + errMsg := fmt.Sprintf("写入Inventory配置失败: %v", err) + s.updateTaskErrorStatus(taskID, fmt.Errorf("%s", errMsg)) + s.dao.DB.Model(&model.TaskAnsibleWork{}).Where("task_id = ?", taskID). + Updates(map[string]interface{}{"status": 4, "error_msg": errMsg}) + return + } + } + } + + // 如果启用配置中心且指定了GlobalVars配置,则覆盖vars/all.yml文件 + if task.UseConfig == 1 && task.GlobalVarsConfigID != nil { + var cfg taskmodel.ConfigAnsible + if err := s.dao.DB.First(&cfg, *task.GlobalVarsConfigID).Error; err == nil { + varsFile := filepath.Join(absTaskDir, "vars/all.yml") + if err := os.MkdirAll(filepath.Dir(varsFile), 0755); err != nil { + errMsg := fmt.Sprintf("创建变量目录失败: %v", err) + s.updateTaskErrorStatus(taskID, fmt.Errorf("%s", errMsg)) + s.dao.DB.Model(&model.TaskAnsibleWork{}).Where("task_id = ?", taskID). + Updates(map[string]interface{}{"status": 4, "error_msg": errMsg}) + return + } + if err := os.WriteFile(varsFile, []byte(cfg.Content), 0644); err != nil { + errMsg := fmt.Sprintf("写入GlobalVars配置失败: %v", err) + s.updateTaskErrorStatus(taskID, fmt.Errorf("%s", errMsg)) + s.dao.DB.Model(&model.TaskAnsibleWork{}).Where("task_id = ?", taskID). + Updates(map[string]interface{}{"status": 4, "error_msg": errMsg}) + return + } + } + } + + // 获取ExtraVars + extraVars := task.ExtraVars + if task.UseConfig == 1 && task.ExtraVarsConfigID != nil { + var cfg taskmodel.ConfigAnsible + if err := s.dao.DB.First(&cfg, *task.ExtraVarsConfigID).Error; err == nil { + extraVars = cfg.Content + } + } + + // 获取CliArgs + cliArgsStr := task.CliArgs + if task.UseConfig == 1 && task.CliArgsConfigID != nil { + var cfg taskmodel.ConfigAnsible + if err := s.dao.DB.First(&cfg, *task.CliArgsConfigID).Error; err == nil { + cliArgsStr = cfg.Content + } + } // 执行每个子任务 allSuccess := true for _, work := range task.Works { // 创建日志目录(使用绝对路径) - absLogDir := filepath.Join(originalDir, fmt.Sprintf("logs/ansible/%d/%d", taskID, work.ID)) + // 使用时间戳作为唯一ID,隔离每次执行的日志 + runID := time.Now().Format("20060102150405") + absLogDir := filepath.Join(workDir, fmt.Sprintf("logs/ansible/%d/%d/%s", taskID, work.ID, runID)) if err := os.MkdirAll(absLogDir, 0755); err != nil { s.updateTaskErrorStatus(taskID, fmt.Errorf("创建日志目录失败: %v", err)) return @@ -684,11 +864,12 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { if task.Type == 3 { logFileName = "deploy-simple.sh" } else { - logFileName = work.EntryFileName + // 使用Base获取文件名,防止EntryFileName包含路径导致日志创建目录失败 + logFileName = filepath.Base(work.EntryFileName) } absLogPath := filepath.Join(absLogDir, fmt.Sprintf("%s.log", logFileName)) // 用于数据库存储的相对路径 - relativeLogPath := fmt.Sprintf("logs/ansible/%d/%d/%s.log", taskID, work.ID, logFileName) + relativeLogPath := fmt.Sprintf("logs/ansible/%d/%d/%s/%s.log", taskID, work.ID, runID, logFileName) // 更新子任务状态为运行中,记录开始时间和日志路径 workStartTime := time.Now() @@ -700,20 +881,14 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { "log_path": relativeLogPath, // 使用相对路径存储到数据库 }) - // 切换到任务目录 - if err := os.Chdir(taskDir); err != nil { - s.updateWorkErrorStatus(work.ID, fmt.Errorf("切换到任务目录失败: %v", err)) - allSuccess = false - continue - } - // 检查playbook文件是否存在(K8s任务跳过此检查) var playbookPath string if task.Type != 3 { playbookPath = work.EntryFileName - if _, err := os.Stat(playbookPath); os.IsNotExist(err) { - os.Chdir(originalDir) - s.updateWorkErrorStatus(work.ID, fmt.Errorf("Playbook文件不存在: %s", playbookPath)) + // 检查绝对路径 + absPlaybookPath := filepath.Join(absTaskDir, playbookPath) + if _, err := os.Stat(absPlaybookPath); os.IsNotExist(err) { + s.updateWorkErrorStatus(work.ID, fmt.Errorf("Playbook文件不存在: %s", absPlaybookPath)) allSuccess = false continue } @@ -725,8 +900,7 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { var cmdArgs []string if task.Type == 3 { // K8s任务 // 检查config.json文件是否存在 - if _, err := os.Stat("config.json"); os.IsNotExist(err) { - os.Chdir(originalDir) + if _, err := os.Stat(filepath.Join(absTaskDir, "config.json")); os.IsNotExist(err) { s.updateWorkErrorStatus(work.ID, fmt.Errorf("config.json文件不存在,任务创建可能有问题")) allSuccess = false continue @@ -734,8 +908,7 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { // 检查部署脚本是否存在 scriptPath := filepath.Join("scripts", "deploy-simple.sh") - if _, err := os.Stat(scriptPath); os.IsNotExist(err) { - os.Chdir(originalDir) + if _, err := os.Stat(filepath.Join(absTaskDir, scriptPath)); os.IsNotExist(err) { s.updateWorkErrorStatus(work.ID, fmt.Errorf("K8s部署脚本不存在: %s", scriptPath)) allSuccess = false continue @@ -746,24 +919,43 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { } else { // Ansible任务 // 检查hosts文件是否存在(创建任务时已生成) - if _, err := os.Stat("hosts"); os.IsNotExist(err) { - os.Chdir(originalDir) + if _, err := os.Stat(filepath.Join(absTaskDir, "hosts")); os.IsNotExist(err) { s.updateWorkErrorStatus(work.ID, fmt.Errorf("hosts文件不存在,任务创建可能有问题")) allSuccess = false continue } // 构建Ansible命令 - cmdArgs = []string{"ansible-playbook", "-i", "hosts", playbookPath, "-v"} + cmdArgs = []string{"ansible-playbook", "-i", "hosts"} + + // 检查 vars/all.yml 是否存在,如果存在则显式加载 + // 用户反馈 vars/all.yml 未生效,通过 --extra-vars 强制加载 + varsFile := "vars/all.yml" + if _, err := os.Stat(filepath.Join(absTaskDir, varsFile)); err == nil { + cmdArgs = append(cmdArgs, "--extra-vars", "@"+varsFile) + } + + // 添加ExtraVars参数 + if extraVars != "" { + cmdArgs = append(cmdArgs, "--extra-vars", extraVars) + } + + // 添加CliArgs参数 + if cliArgsStr != "" { + cmdArgs = append(cmdArgs, strings.Fields(cliArgsStr)...) + } + + // 添加Playbook路径 + cmdArgs = append(cmdArgs, playbookPath, "-v") } // 执行命令 cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...) + cmd.Dir = absTaskDir // 设置命令执行目录,替代 os.Chdir // 创建日志文件用于实时写入(使用绝对路径) logFile, err := os.OpenFile(absLogPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) if err != nil { - os.Chdir(originalDir) s.updateWorkErrorStatus(work.ID, fmt.Errorf("创建日志文件失败: %v", err)) allSuccess = false continue @@ -772,7 +964,11 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { // 写入命令信息到日志文件 logFile.WriteString(fmt.Sprintf("[%s] 开始执行任务\n", time.Now().Format("2006-01-02 15:04:05"))) logFile.WriteString(fmt.Sprintf("命令: %s\n", strings.Join(cmdArgs, " "))) - logFile.WriteString(fmt.Sprintf("工作目录: %s\n", taskDir)) + logFile.WriteString(fmt.Sprintf("工作目录: %s\n", absTaskDir)) + logFile.WriteString(fmt.Sprintf("Inventory: %s\n", inventoryPath)) + if extraVars != "" { + logFile.WriteString(fmt.Sprintf("Extra Variables: %s\n", extraVars)) + } logFile.WriteString("==========================================\n") logFile.Sync() // 立即刷新到磁盘 @@ -797,9 +993,6 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { } logFile.Close() - // 切换回原目录 - os.Chdir(originalDir) - // 计算执行耗时 workEndTime := time.Now() duration := int(workEndTime.Sub(workStartTime).Seconds()) @@ -856,10 +1049,62 @@ func (s *TaskAnsibleServiceImpl) StartJob(c *gin.Context, taskID uint) { "total_duration": totalDuration, "updated_at": time.Now(), }) + + // --- 保存历史记录 --- + uniqId := fmt.Sprintf("%d-%d", taskID, time.Now().Unix()) + + // 创建主历史记录 + history := &model.TaskAnsibleHistory{ + TaskID: taskID, + UniqId: uniqId, + Status: finalStatus, + TotalDuration: int(totalDuration), + CreatedAt: time.Now(), + Trigger: 1, // 默认为手动 + } + s.dao.CreateTaskAnsibleHistory(history) + + // 创建子任务历史记录 + var workHistories []model.TaskAnsibleworkHistory + for _, w := range works { + // LogPath is relative, join with workDir to get absolute path check if needed, + // but here we just store the relative or whatever path we used for the active job. + // However, if we want to read it later, we need to know where it is. + // The previous logic used 'relativeLogPath' to store in DB. + // Let's verify what `w.LogPath` contains. It contains `logs/ansible/...`. + // To be safe and since we want to avoid DB size bloat, we store the path. + + workHistories = append(workHistories, model.TaskAnsibleworkHistory{ + HistoryID: history.ID, + TaskID: taskID, + WorkID: w.ID, + HostName: w.EntryFileName, // Playbook name + Status: w.Status, + LogPath: w.LogPath, // Save relative path: logs/ansible/taskID/workID/xxx.log + Duration: w.Duration, + CreatedAt: time.Now(), + }) + } + + if len(workHistories) > 0 { + s.dao.CreateTaskAnsibleworkHistories(workHistories) + } + + // 清理旧历史记录 + // 获取MaxHistoryKeep + var currentTask model.TaskAnsible + if err := s.dao.DB.First(¤tTask, taskID).Error; err == nil { + maxKeep := currentTask.MaxHistoryKeep + if maxKeep <= 0 { + maxKeep = 3 // 默认3条 + } + s.dao.DeleteOldHistory(taskID, maxKeep) + } + // --- 历史记录保存结束 --- } }() - c.JSON(200, gin.H{"message": "任务已开始执行"}) + return nil } // updateTaskErrorStatus 更新任务为错误状态 @@ -935,11 +1180,21 @@ func (s *TaskAnsibleServiceImpl) CreateTask(c *gin.Context, req *CreateTaskReque // 创建任务记录 task := &taskmodel.TaskAnsible{ - Name: name, - Type: taskType, // 1=手动,2=Git导入 - HostGroups: toJSON(hostGroups), - AllHostIDs: toJSON(allHostIDs), - Status: 1, // 1表示等待中 + Name: name, + Type: taskType, // 1=手动,2=Git导入 + HostGroups: toJSON(hostGroups), + AllHostIDs: toJSON(allHostIDs), + Status: 1, // 1表示等待中 + ExtraVars: req.ExtraVars, + CliArgs: req.CliArgs, + UseConfig: req.UseConfig, + InventoryConfigID: req.InventoryConfigID, + GlobalVarsConfigID: req.GlobalVarsConfigID, + ExtraVarsConfigID: req.ExtraVarsConfigID, + CliArgsConfigID: req.CliArgsConfigID, + CronExpr: req.CronExpr, + IsRecurring: req.IsRecurring, + ViewID: req.ViewID, } // 如果是Git任务,设置仓库地址 @@ -969,7 +1224,7 @@ func (s *TaskAnsibleServiceImpl) CreateTask(c *gin.Context, req *CreateTaskReque } } else if taskType == 2 { // Type=2: Git导入任务 - if err := s.handleGitTask(c, task, projectDir, hostInfos, gitRepo, variables); err != nil { + if err := s.handleGitTask(c, task, projectDir, hostInfos, gitRepo, variables, req.PlaybookPaths); err != nil { result.Failed(c, 500, err.Error()) return } @@ -985,6 +1240,11 @@ func (s *TaskAnsibleServiceImpl) CreateTask(c *gin.Context, req *CreateTaskReque return } + // 触发任务配置变更钩子 + if OnTaskConfigChange != nil { + OnTaskConfigChange(updatedTask) + } + result.Success(c, updatedTask) } @@ -1154,17 +1414,33 @@ func (s *TaskAnsibleServiceImpl) handleManualTask(c *gin.Context, task *taskmode } // handleGitTask 处理Git导入的任务(Type=2) -func (s *TaskAnsibleServiceImpl) handleGitTask(c *gin.Context, task *taskmodel.TaskAnsible, projectDir string, hostInfos *HostSSHInfoCollection, gitRepo string, variables map[string]string) error { +func (s *TaskAnsibleServiceImpl) handleGitTask(c *gin.Context, task *taskmodel.TaskAnsible, projectDir string, hostInfos *HostSSHInfoCollection, gitRepo string, variables map[string]string, manualPlaybookPaths []string) error { // 1. 下载Git仓库 if err := s.cloneGitRepository(gitRepo, projectDir); err != nil { return fmt.Errorf("下载Git仓库失败: %v", err) } - // 2. 解析仓库目录结构,识别playbook文件 - playbookFiles, err := s.parseGitRepository(projectDir) - if err != nil { - return fmt.Errorf("解析Git仓库失败: %v", err) + // 2. 确定playbook文件列表 + var playbookFiles []string + if len(manualPlaybookPaths) > 0 { + // 如果前端指定了playbook列表,验证并使用它们 + var err error + playbookFiles, err = s.resolvePlaybookPaths(projectDir, manualPlaybookPaths) + if err != nil { + return err + } + } else { + // 否则自动扫描仓库目录结构 + var err error + playbookFiles, err = s.parseGitRepository(projectDir) + if err != nil { + return fmt.Errorf("解析Git仓库失败: %v", err) + } + } + + if len(playbookFiles) == 0 { + return fmt.Errorf("未找到有效的playbook文件") } // 3. 创建子任务记录 @@ -1188,6 +1464,42 @@ func (s *TaskAnsibleServiceImpl) handleGitTask(c *gin.Context, task *taskmodel.T return nil } +// resolvePlaybookPaths 校验并解析仓库内playbook路径 +func (s *TaskAnsibleServiceImpl) resolvePlaybookPaths(projectDir string, paths []string) ([]string, error) { + var result []string + for _, p := range paths { + p = strings.TrimSpace(p) + if p == "" { + continue + } + + // 防止路径遍历攻击 + clean := filepath.Clean(p) + if strings.HasPrefix(clean, "..") || filepath.IsAbs(clean) { + return nil, fmt.Errorf("非法playbook路径: %s (禁止包含..或使用绝对路径)", p) + } + + // 拼接完整路径 + full := filepath.Join(projectDir, clean) + + // 验证文件扩展名 + ext := strings.ToLower(filepath.Ext(full)) + if ext != ".yml" && ext != ".yaml" { + return nil, fmt.Errorf("playbook必须是yml/yaml文件: %s", p) + } + + // 验证文件是否存在 + if _, err := os.Stat(full); err != nil { + return nil, fmt.Errorf("playbook不存在: %s", p) + } + + // 注意:这里应该只返回相对路径,而不是包含项目目录的完整路径 + // 因为后续 createSubTasksFromPlaybooks 会再次拼接项目目录 + result = append(result, clean) + } + return result, nil +} + // cloneGitRepository 克隆Git仓库 func (s *TaskAnsibleServiceImpl) cloneGitRepository(gitRepo, projectDir string) error { // 使用git命令克隆仓库 @@ -1355,7 +1667,7 @@ func (s *TaskAnsibleServiceImpl) CreateK8sTask(c *gin.Context, req *CreateK8sTas task := &model.TaskAnsible{ Name: req.Name, Description: req.Description, - Type: 3, // K8s任务类型 + Type: 3, // K8s任务类型 GitRepo: "git@gitee.com:zhang_fan1024/zf-k8s.git", // 固定的K8s Git仓库 HostGroups: s.buildK8sHostGroups(req), AllHostIDs: s.buildK8sAllHostIDs(req), @@ -1598,3 +1910,228 @@ func (s *TaskAnsibleServiceImpl) createK8sSubTask(taskID uint, projectDir string return nil } + +// UpdateTask 修改任务 +func (s *TaskAnsibleServiceImpl) UpdateTask(c *gin.Context, taskID uint, req *UpdateTaskRequest) { + // 1. 获取任务 + task, err := s.dao.GetTaskDetail(taskID) + if err != nil { + result.Failed(c, 500, fmt.Sprintf("获取任务失败: %v", err)) + return + } + + // 2. 检查任务状态,运行中不可修改 + if task.Status == 2 { + result.Failed(c, 400, "任务正在运行中,无法修改") + return + } + + // 3. 更新基本信息 + if req.Name != "" { + task.Name = req.Name + } + + // 更新配置选项 + task.UseConfig = req.UseConfig + task.InventoryConfigID = req.InventoryConfigID + task.GlobalVarsConfigID = req.GlobalVarsConfigID + task.ExtraVarsConfigID = req.ExtraVarsConfigID + task.CliArgsConfigID = req.CliArgsConfigID + + // 更新变量信息 + if req.ExtraVars != "" { + task.ExtraVars = req.ExtraVars + } + if req.CliArgs != "" { + task.CliArgs = req.CliArgs + } + + // 4. 更新Git信息 (仅Type=2) + if task.Type == 2 && req.GitRepo != "" { + task.GitRepo = req.GitRepo + } + + // 5. 更新HostGroups + if len(req.HostGroups) > 0 { + task.HostGroups = toJSON(req.HostGroups) + // 重新计算AllHostIDs + allHostIDs := make([]uint, 0) + idMap := make(map[uint]bool) + for _, ids := range req.HostGroups { + for _, id := range ids { + if id > 0 && !idMap[id] { + idMap[id] = true + allHostIDs = append(allHostIDs, id) + } + } + } + task.AllHostIDs = toJSON(allHostIDs) + } + + // 6. 更新GlobalVars + if len(req.Variables) > 0 { + task.GlobalVars = toJSON(req.Variables) + } + + // Update New fields (支持增量更新) + // 只有当 CronExpr 不为空字符串时才更新 + if req.CronExpr != "" { + task.CronExpr = req.CronExpr + } + + // 只有当 IsRecurring 传了值(不为nil)时才更新 + if req.IsRecurring != nil { + task.IsRecurring = *req.IsRecurring + } + + // 只有当 ViewID 传了值(不为nil)时才更新 + if req.ViewID != nil { + task.ViewID = req.ViewID + } + + task.UpdatedAt = time.Now() + + // 7. 保存 + if err := s.dao.Update(task); err != nil { + result.Failed(c, 500, fmt.Sprintf("更新任务失败: %v", err)) + return + } + + // 触发任务配置变更钩子 + if OnTaskConfigChange != nil { + // 重新获取完整任务信息以确保调度器获取最新配置 + if fullTask, err := s.dao.GetTaskDetail(taskID); err == nil { + OnTaskConfigChange(fullTask) + } + } + + result.Success(c, task) +} + +// GetTaskHistoryList 获取任务历史记录列表 Service +func (s *TaskAnsibleServiceImpl) GetTaskHistoryList(c *gin.Context, taskID uint, page, limit int) { + histories, total, err := s.dao.GetTaskAnsibleHistoryList(taskID, page, limit) + if err != nil { + result.Failed(c, 500, fmt.Sprintf("获取历史记录列表失败: %v", err)) + return + } + result.Success(c, gin.H{ + "data": histories, + "total": total, + }) +} + +// GetTaskHistoryDetail 获取任务历史记录详情 Service +func (s *TaskAnsibleServiceImpl) GetTaskHistoryDetail(c *gin.Context, historyID uint) { + history, err := s.dao.GetTaskAnsibleHistoryDetail(historyID) + if err != nil { + result.Failed(c, 500, fmt.Sprintf("获取历史记录详情失败: %v", err)) + return + } + result.Success(c, history) +} + +// GetTaskHistoryLog 获取历史记录的日志内容 +func (s *TaskAnsibleServiceImpl) GetTaskHistoryLog(c *gin.Context, historyWorkID uint) { + // 1. 获取SubHistory记录 + var workHistory model.TaskAnsibleworkHistory + if err := s.dao.DB.First(&workHistory, historyWorkID).Error; err != nil { + result.Failed(c, 404, "未找到历史任务日志记录") + return + } + + // 2. 获取LogPath + logPath := workHistory.LogPath + if logPath == "" { + result.Failed(c, 404, "日志路径为空") + return + } + + // 3. 构建绝对路径 (假设运行目录在项目根目录) + // LogPath is usually "logs/ansible/..." + workDir, _ := os.Getwd() + // 防御性处理,如果已经在 task 目录下 + if strings.Contains(workDir, "/task/") { + workDir = strings.Split(workDir, "/task/")[0] + } + absLogPath := filepath.Join(workDir, logPath) + + // 4. 读取文件 + content, err := os.ReadFile(absLogPath) + if err != nil { + result.Failed(c, 500, fmt.Sprintf("读取日志文件失败: %v", err)) + return + } + + result.Success(c, string(content)) +} + +// GetTaskHistoryLogByDetails 根据 TaskID, WorkID, HistoryID 获取日志 +func (s *TaskAnsibleServiceImpl) GetTaskHistoryLogByDetails(c *gin.Context, taskID, workID, historyID uint) { + // 1. 查询 TaskAnsibleworkHistory + var workHistory model.TaskAnsibleworkHistory + err := s.dao.DB.Where("task_id = ? AND work_id = ? AND history_id = ?", taskID, workID, historyID). + First(&workHistory).Error + + if err != nil { + result.Failed(c, 404, "未找到历史日志记录") + return + } + + // 2. 获取LogPath + logPath := workHistory.LogPath + if logPath == "" { + result.Failed(c, 404, "日志路径为空") + return + } + + // 3. 读取文件 + workDir, _ := os.Getwd() + if strings.Contains(workDir, "/task/") { + workDir = strings.Split(workDir, "/task/")[0] + } + absLogPath := filepath.Join(workDir, logPath) + + content, err := os.ReadFile(absLogPath) + if err != nil { + result.Failed(c, 500, fmt.Sprintf("读取日志文件失败: %v", err)) + return + } + + result.Success(c, string(content)) +} + +// DeleteTaskHistory 删除任务历史记录 +func (s *TaskAnsibleServiceImpl) DeleteTaskHistory(c *gin.Context, historyID uint) { + // 1. 获取History记录 + history, err := s.dao.GetTaskAnsibleHistoryDetail(historyID) + if err != nil { + result.Failed(c, 404, "未找到历史记录") + return + } + + // 2. 删除文件 (RunID目录) + for _, work := range history.WorkHistories { + if work.LogPath != "" { + workDir, _ := os.Getwd() + if strings.Contains(workDir, "/task/") { + workDir = strings.Split(workDir, "/task/")[0] + } + absLogPath := filepath.Join(workDir, work.LogPath) + dirToDelete := filepath.Dir(absLogPath) + + // 安全检查:确保要删除的目录在 logs/ansible 之下 + if strings.Contains(dirToDelete, "logs/ansible") && len(dirToDelete) > 12 { + os.RemoveAll(dirToDelete) + } + } + } + + // 3. 删除数据库记录 + if err := s.dao.DeleteHistory(historyID); err != nil { + result.Failed(c, 500, fmt.Sprintf("删除历史记录失败: %v", err)) + return + } + + result.Success(c, gin.H{"message": "删除成功", "id": historyID}) +} diff --git a/dodevops-api/config.yaml b/dodevops-api/config.yaml index 55ba568..170869d 100644 --- a/dodevops-api/config.yaml +++ b/dodevops-api/config.yaml @@ -1,6 +1,6 @@ # 项目启动端口 server: - address: 127.0.0.1:8000 + address: 192.168.1.156:5700 # debug模式 model: debug # release模式 @@ -10,11 +10,11 @@ server: # 数据库配置 db: dialects: mysql - host: 192.168.1.1 - port: 3306 - db: gin-api + host: 192.168.1.156 + port: 3307 + db: devops username: root - password: 1111111 + password: devops@2025 charset: utf8 # 最大空闲数 maxIdle: 50 @@ -24,8 +24,8 @@ db: # redis配置 redis: # address: 127.0.0.1:6379 - address: 192.168.1.1:6379 - password: "123456" + address: 192.168.1.156:6379 + password: "devops@2025" # 图片地址和ip imageSettings: @@ -46,9 +46,9 @@ log: # 监控配置 monitor: prometheus: - url: "http://192.168.1.1:9090" + url: "http://192.168.1.227:30901" pushgateway: url: "http://192.168.1.1:9091" agent: - heartbeat_server_url: "http://192.168.1.1:8000/api/v1/monitor/agent/heartbeat" + heartbeat_server_url: "http://192.168.1.156:5700/api/v1/monitor/agent/heartbeat" heartbeat_token: "agent-heartbeat-token-2024" diff --git a/dodevops-api/docs/app/app_docs.go b/dodevops-api/docs/app/app_docs.go new file mode 100644 index 0000000..4277b6a --- /dev/null +++ b/dodevops-api/docs/app/app_docs.go @@ -0,0 +1,407 @@ +package docsapp + +const AppPaths = ` +` + +const AppDefinitions = ` + "model.AppEnvironmentResponse": { + "type": "object", + "properties": { + "app_code": { + "description": "应用编码", + "type": "string" + }, + "app_id": { + "description": "应用ID", + "type": "integer" + }, + "app_name": { + "description": "应用名称", + "type": "string" + }, + "business_dept_id": { + "description": "业务部门ID", + "type": "integer" + }, + "business_group_id": { + "description": "业务组ID", + "type": "integer" + }, + "environment": { + "description": "环境名称", + "type": "string" + }, + "is_configured": { + "description": "是否已配置", + "type": "boolean" + }, + "jenkins_job_url": { + "description": "Jenkins任务URL", + "type": "string" + }, + "jenkins_server_id": { + "description": "Jenkins服务器ID", + "type": "integer" + }, + "jenkins_server_name": { + "description": "Jenkins服务器名称", + "type": "string" + }, + "job_name": { + "description": "Jenkins任务名称", + "type": "string" + }, + "programming_lang": { + "description": "编程语言", + "type": "string" + }, + "status": { + "description": "应用状态", + "type": "integer" + }, + "status_text": { + "description": "应用状态文本", + "type": "string" + } + } + }, + "model.Application": { + "type": "object", + "properties": { + "business_dept_id": { + "description": "业务部门ID(关联sys_dept)", + "type": "integer" + }, + "business_group_id": { + "description": "基本信息", + "type": "integer" + }, + "code": { + "description": "应用编码", + "type": "string" + }, + "created_at": { + "type": "string" + }, + "databases": { + "description": "关联数据库(cmdb_sql表ID)", + "type": "array", + "items": { + "type": "integer" + } + }, + "description": { + "description": "应用介绍", + "type": "string" + }, + "dev_owners": { + "description": "负责人信息 (多个用户ID,关联sys_admin表)", + "type": "array", + "items": { + "type": "integer" + } + }, + "domains": { + "description": "关联资源 (存储资源ID)", + "type": "array", + "items": { + "type": "string" + } + }, + "health_api": { + "description": "健康检查接口", + "type": "string" + }, + "hosts": { + "description": "关联主机(cmdb_host表ID)", + "type": "array", + "items": { + "type": "integer" + } + }, + "id": { + "type": "integer" + }, + "jenkins_envs": { + "description": "关联的Jenkins环境配置(级联删除)", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsEnv" + } + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "ops_owners": { + "description": "运维负责人", + "type": "array", + "items": { + "type": "integer" + } + }, + "other_res": { + "description": "关联其他资源", + "allOf": [ + { + "$ref": "#/definitions/model.OtherResources" + } + ] + }, + "programming_lang": { + "description": "技术信息", + "type": "string" + }, + "repo_url": { + "description": "仓库地址", + "type": "string" + }, + "start_command": { + "description": "启动命令", + "type": "string" + }, + "status": { + "description": "状态", + "type": "integer" + }, + "stop_command": { + "description": "停止命令", + "type": "string" + }, + "test_owners": { + "description": "测试负责人", + "type": "array", + "items": { + "type": "integer" + } + }, + "updated_at": { + "type": "string" + } + } + }, + "model.ApplicationListResponse": { + "type": "object", + "properties": { + "list": { + "description": "列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.Application" + } + }, + "total": { + "description": "总数", + "type": "integer" + } + } + }, + "model.CreateApplicationRequest": { + "type": "object", + "required": [ + "business_dept_id", + "business_group_id", + "name" + ], + "properties": { + "business_dept_id": { + "description": "业务部门ID", + "type": "integer" + }, + "business_group_id": { + "description": "业务组ID", + "type": "integer" + }, + "code": { + "description": "应用编码(可选,不提供则根据名称自动生成)", + "type": "string" + }, + "databases": { + "description": "关联数据库ID", + "type": "array", + "items": { + "type": "integer" + } + }, + "description": { + "description": "应用介绍", + "type": "string" + }, + "dev_owners": { + "description": "负责人信息", + "type": "array", + "items": { + "type": "integer" + } + }, + "domains": { + "description": "关联资源", + "type": "array", + "items": { + "type": "string" + } + }, + "health_api": { + "description": "健康检查接口", + "type": "string" + }, + "hosts": { + "description": "关联主机ID", + "type": "array", + "items": { + "type": "integer" + } + }, + "jenkins_envs": { + "description": "Jenkins环境配置(可选,如果不提供则创建默认的3套环境:prod, test, dev)", + "type": "array", + "items": { + "$ref": "#/definitions/model.CreateJenkinsEnvRequest" + } + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "ops_owners": { + "description": "运维负责人ID数组", + "type": "array", + "items": { + "type": "integer" + } + }, + "other_res": { + "description": "其他资源", + "allOf": [ + { + "$ref": "#/definitions/model.OtherResources" + } + ] + }, + "programming_lang": { + "description": "技术信息", + "type": "string" + }, + "repo_url": { + "description": "仓库地址", + "type": "string" + }, + "start_command": { + "description": "启动命令", + "type": "string" + }, + "stop_command": { + "description": "停止命令", + "type": "string" + }, + "test_owners": { + "description": "测试负责人ID数组", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "model.UpdateApplicationRequest": { + "type": "object", + "properties": { + "business_dept_id": { + "description": "业务部门ID", + "type": "integer" + }, + "business_group_id": { + "description": "业务组ID", + "type": "integer" + }, + "databases": { + "description": "关联数据库ID", + "type": "array", + "items": { + "type": "integer" + } + }, + "description": { + "description": "应用介绍", + "type": "string" + }, + "dev_owners": { + "description": "负责人信息", + "type": "array", + "items": { + "type": "integer" + } + }, + "domains": { + "description": "关联资源", + "type": "array", + "items": { + "type": "string" + } + }, + "health_api": { + "description": "健康检查接口", + "type": "string" + }, + "hosts": { + "description": "关联主机ID", + "type": "array", + "items": { + "type": "integer" + } + }, + "jenkins_envs": { + "description": "Jenkins环境配置(可选,如果提供则完全替换现有配置)", + "type": "array", + "items": { + "$ref": "#/definitions/model.UpdateJenkinsEnvRequest" + } + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "ops_owners": { + "description": "运维负责人ID数组", + "type": "array", + "items": { + "type": "integer" + } + }, + "other_res": { + "description": "其他资源", + "allOf": [ + { + "$ref": "#/definitions/model.OtherResources" + } + ] + }, + "programming_lang": { + "description": "技术信息", + "type": "string" + }, + "repo_url": { + "description": "仓库地址", + "type": "string" + }, + "start_command": { + "description": "启动命令", + "type": "string" + }, + "status": { + "description": "状态", + "type": "integer" + }, + "stop_command": { + "description": "停止命令", + "type": "string" + }, + "test_owners": { + "description": "测试负责人ID数组", + "type": "array", + "items": { + "type": "integer" + } + } + } + }` diff --git a/dodevops-api/docs/cmdb/cmdb_docs.go b/dodevops-api/docs/cmdb/cmdb_docs.go new file mode 100644 index 0000000..3f432c2 --- /dev/null +++ b/dodevops-api/docs/cmdb/cmdb_docs.go @@ -0,0 +1,2072 @@ +package docscmdb + +const CmdbPaths = ` + "/api/v1/cmdb/database": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "修改数据库记录", + "parameters": [ + { + "description": "数据库信息(必须包含ID)", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbSQL" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "创建数据库", + "parameters": [ + { + "description": "数据库信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbSQL" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "删除数据库记录", + "parameters": [ + { + "type": "integer", + "description": "数据库ID(query参数)", + "name": "id", + "in": "query" + }, + { + "description": "请求体(包含id字段)", + "name": "body", + "in": "body", + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/database/byname": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "根据名称查询数据库", + "parameters": [ + { + "type": "string", + "description": "数据库名称", + "name": "name", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/database/bytype": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "根据类型查询数据库", + "parameters": [ + { + "type": "integer", + "description": "数据库类型(1=MySQL 2=PostgreSQL 3=Redis 4=MongoDB 5=Elasticsearch)", + "name": "type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/database/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据ID获取数据库详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "根据ID获取数据库详情", + "parameters": [ + { + "type": "integer", + "description": "数据库ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/databaselist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "获取数据库列表[分页]", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页数量", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/groupadd": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "新增资产分组接口", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "新增资产分组接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbGroup" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/groupbyname": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据名称查询资产分组", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "根据名称查询资产分组", + "parameters": [ + { + "type": "string", + "description": "分组名称", + "name": "name", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/groupdelete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除资产分组接口", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "删除资产分组接口", + "parameters": [ + { + "description": "分组ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbGroupIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/grouplist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询所有资产分组,并以树形结构返回", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "查询所有资产分组(树形结构)", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/grouplistwithhosts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询所有资产分组及关联主机,并以树形结构返回", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "查询所有资产分组及关联主机(树形结构)", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/groupupdate": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新资产分组接口", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "更新资产分组接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbGroup" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostbyip": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据IP查询主机(匹配内网IP、公网IP或SSH IP)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "根据IP查询主机", + "parameters": [ + { + "type": "string", + "description": "IP地址", + "name": "ip", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostbyname": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据主机名称模糊查询", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "根据主机名称模糊查询", + "parameters": [ + { + "type": "string", + "description": "主机名称(模糊匹配)", + "name": "name", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostbystatus": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据状态查询主机(1-\u003e认证成功,2-\u003e未认证,3-\u003e认证失败)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "根据状态查询主机", + "parameters": [ + { + "type": "integer", + "description": "状态(1/2/3)", + "name": "status", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostcloudcreatealiyun": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建阿里云主机(通过阿里云API获取主机信息)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "创建阿里云主机", + "parameters": [ + { + "description": "阿里云主机信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateCmdbHostCloudDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostcloudcreatebaidu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建百度云主机(通过百度云API自动扫描所有区域并获取主机信息)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "创建百度云主机", + "parameters": [ + { + "description": "百度云主机信息(AccessKey和SecretKey)", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateCmdbHostCloudDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostcloudcreatetencent": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建腾讯云主机(通过腾讯云API获取主机信息)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "创建腾讯云主机", + "parameters": [ + { + "description": "腾讯云主机信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateCmdbHostCloudDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostcreate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建主机", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "创建主机", + "parameters": [ + { + "description": "主机信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateCmdbHostDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostdelete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除主机", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "删除主机", + "parameters": [ + { + "description": "主机ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbHostIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostgroup": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据分组ID获取主机列表(包括所有子分组的主机)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "根据分组ID获取主机列表", + "parameters": [ + { + "type": "integer", + "description": "分组ID", + "name": "groupId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostimport": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "通过上传Excel模板批量导入主机(Excel列顺序:主机别名、SSH地址、SSH端口、SSH用户、备注)", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "从Excel导入主机", + "parameters": [ + { + "type": "file", + "description": "Excel文件", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "分组ID", + "name": "groupId", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostinfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据ID获取主机", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "根据ID获取主机", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostlist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取主机列表(分页)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "获取主机列表(分页)", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostssh/command/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "在SSH终端执行命令", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB主机SSH" + ], + "summary": "执行SSH命令", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命令", + "name": "command", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostssh/upload/{id}": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传本地文件到远程SSH服务器", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB主机SSH" + ], + "summary": "上传文件到SSH服务器", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "要上传的文件", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "string", + "description": "远程服务器目标路径", + "name": "destPath", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hostsync": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据主机ID自动同步获取目标主机的基本信息(主机名称、操作系统、CPU、内存、磁盘、内网IP、公网IP)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "同步主机基本信息", + "parameters": [ + { + "description": "主机ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbHostIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/hosttemplate": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载主机导入Excel模板", + "produces": [ + "application/octet-stream" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "下载主机导入模板", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "file" + } + } + } + } + }, + "/api/v1/cmdb/hostupdate": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新主机", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CMDB资产管理" + ], + "summary": "更新主机", + "parameters": [ + { + "description": "主机信息(包含ID)", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateCmdbHostDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sql": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "执行更新语句(通过数据库ID/名称)", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "执行更新语句", + "parameters": [ + { + "description": "SQL更新请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "执行插入语句(通过数据库ID/名称)", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "执行插入语句", + "parameters": [ + { + "description": "SQL插入请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "ApiKeyAuth": [] + } + ], + "description": "执行删除语句(通过数据库ID/名称)\n执行原生SQL语句(通过数据库ID/名称)", + "produces": [ + "application/json", + "application/json" + ], + "tags": [ + "CMDB数据库", + "CMDB数据库" + ], + "summary": "执行原生SQL语句", + "parameters": [ + { + "description": "SQL删除请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + }, + { + "description": "SQL执行请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sql/databaselist": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定数据库实例的数据库列表", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "获取数据库列表", + "parameters": [ + { + "description": "数据库查询请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sql/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "ApiKeyAuth": [] + } + ], + "description": "执行删除语句(通过数据库ID/名称)\n执行原生SQL语句(通过数据库ID/名称)", + "produces": [ + "application/json", + "application/json" + ], + "tags": [ + "CMDB数据库", + "CMDB数据库" + ], + "summary": "执行原生SQL语句", + "parameters": [ + { + "description": "SQL删除请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + }, + { + "description": "SQL执行请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sql/select": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "执行查询语句(通过数据库ID/名称)", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "执行查询语句", + "parameters": [ + { + "description": "SQL查询请求", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/controller.SQLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sqlLog/clean": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "清空SQL操作日志接口", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "清空SQL操作日志接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sqlLog/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除SQL操作日志", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "根据id删除SQL操作日志", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CmdbSqlLogIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/cmdb/sqlLog/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页获取SQL操作日志列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "CMDB数据库" + ], + "summary": "分页获取SQL操作日志列表接口", + "parameters": [ + { + "type": "integer", + "description": "每页数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "分页数", + "name": "pageNum", + "in": "query" + }, + { + "type": "string", + "description": "执行用户", + "name": "execUser", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "beginTime", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "endTime", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const CmdbDefinitions = ` + "model.ClusterResourceMetrics": { + "type": "object", + "properties": { + "available": { + "description": "可用量", + "type": "string" + }, + "requestRate": { + "description": "请求率 (0-100)", + "type": "number" + }, + "total": { + "description": "总量", + "type": "string" + }, + "usageRate": { + "description": "使用率 (0-100)", + "type": "number" + }, + "used": { + "description": "已使用", + "type": "string" + } + } + }, + "model.CmdbGroup": { + "type": "object", + "properties": { + "children": { + "description": "子分组(虚拟字段,用于树形展示)", + "type": "array", + "items": { + "$ref": "#/definitions/model.CmdbGroup" + } + }, + "createTime": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "hostCount": { + "description": "主机数量(虚拟字段,包含所有子分组的主机数量)", + "type": "integer" + }, + "hosts": { + "description": "关联的主机列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.CmdbHost" + } + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "分组名称", + "type": "string" + }, + "parentId": { + "description": "父级分组ID(0 表示根分组)", + "type": "integer" + } + } + }, + "model.CmdbGroupIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.CmdbHost": { + "type": "object", + "properties": { + "billingType": { + "type": "string" + }, + "cpu": { + "type": "string" + }, + "createTime": { + "$ref": "#/definitions/util.HTime" + }, + "disk": { + "type": "string" + }, + "expireTime": { + "$ref": "#/definitions/util.HTime" + }, + "group": { + "$ref": "#/definitions/model.CmdbGroup" + }, + "groupId": { + "type": "integer" + }, + "hostName": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "instanceId": { + "type": "string" + }, + "memory": { + "type": "string" + }, + "name": { + "type": "string" + }, + "os": { + "type": "string" + }, + "privateIp": { + "type": "string" + }, + "publicIp": { + "type": "string" + }, + "region": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "sshIp": { + "type": "string" + }, + "sshKeyId": { + "type": "integer" + }, + "sshName": { + "type": "string" + }, + "sshPort": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "updateTime": { + "$ref": "#/definitions/util.HTime" + }, + "vendor": { + "type": "integer" + } + } + }, + "model.CmdbHostIdDto": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + } + }, + "model.CmdbSQL": { + "type": "object", + "properties": { + "accountId": { + "description": "所属账号ID", + "type": "integer" + }, + "createdAt": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "description": { + "description": "描述/备注", + "type": "string" + }, + "groupId": { + "description": "所属业务组ID", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "数据库名称", + "type": "string" + }, + "tags": { + "description": "标签(多个标签用逗号分隔)", + "type": "string" + }, + "type": { + "description": "数据库类型(1=MySQL 2=PostgreSQL 3=Redis 4=MongoDB 5=Elasticsearch)", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + } + } + }, + "model.CmdbSqlLogIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.CreateCmdbHostCloudDto": { + "type": "object", + "required": [ + "accessKey", + "groupId", + "region", + "secretKey", + "vendor" + ], + "properties": { + "accessKey": { + "description": "AK", + "type": "string" + }, + "groupId": { + "description": "分组ID", + "type": "integer" + }, + "instanceId": { + "description": "实例ID(可选)", + "type": "string" + }, + "region": { + "description": "区域", + "type": "string" + }, + "secretKey": { + "description": "SK", + "type": "string" + }, + "vendor": { + "description": "云厂商:2-\u003e阿里云,3-\u003e腾讯云", + "type": "integer" + } + } + }, + "model.CreateCmdbHostDto": { + "type": "object", + "required": [ + "groupId", + "hostName", + "sshIp", + "sshKeyId", + "sshName" + ], + "properties": { + "groupId": { + "description": "主机分组ID", + "type": "integer" + }, + "hostName": { + "description": "主机名称(唯一标识)", + "type": "string" + }, + "remark": { + "description": "备注信息(可选)", + "type": "string" + }, + "sshIp": { + "description": "SSH连接IP(公网或私网IP)", + "type": "string" + }, + "sshKeyId": { + "description": "SSH凭据ID(从ecsAuth表获取)", + "type": "integer" + }, + "sshName": { + "description": "SSH登录用户名", + "type": "string" + }, + "sshPort": { + "description": "SSH端口(默认22)", + "type": "integer" + } + } + }, + "model.CreateResourceQuotaRequest": { + "type": "object", + "required": [ + "hard", + "name" + ], + "properties": { + "hard": { + "description": "硬限制", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "ResourceQuota名称", + "type": "string" + }, + "scopeSelector": { + "description": "作用域选择器", + "type": "object", + "additionalProperties": true + }, + "scopes": { + "description": "作用域", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.OtherResources": { + "type": "object", + "properties": { + "kafka": { + "type": "array", + "items": { + "type": "string" + } + }, + "other": { + "type": "array", + "items": { + "type": "string" + } + }, + "rabbitmq": { + "type": "array", + "items": { + "type": "string" + } + }, + "redis": { + "type": "array", + "items": { + "type": "string" + } + }, + "zookeeper": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.ResourceInfo": { + "type": "object", + "properties": { + "allocatable": { + "description": "可分配量", + "type": "string" + }, + "capacity": { + "description": "总容量", + "type": "string" + }, + "requests": { + "description": "请求量", + "type": "string" + }, + "usage": { + "description": "使用量", + "type": "string" + } + } + }, + "model.ResourceQuotaDetail": { + "type": "object", + "properties": { + "cpuQuota": { + "description": "CPU配额详情", + "allOf": [ + { + "$ref": "#/definitions/model.QuotaInfo" + } + ] + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "hard": { + "description": "硬限制", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "memoryQuota": { + "description": "内存配额详情", + "allOf": [ + { + "$ref": "#/definitions/model.QuotaInfo" + } + ] + }, + "name": { + "description": "ResourceQuota名称", + "type": "string" + }, + "storageQuota": { + "description": "存储配额详情", + "allOf": [ + { + "$ref": "#/definitions/model.QuotaInfo" + } + ] + }, + "used": { + "description": "已使用", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.ResourceQuotaListResponse": { + "type": "object", + "properties": { + "resourceQuotas": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ResourceQuotaDetail" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.ResourceSpec": { + "type": "object", + "properties": { + "cpu": { + "description": "CPU", + "type": "string" + }, + "memory": { + "description": "内存", + "type": "string" + } + } + }, + "model.ResourceUsage": { + "type": "object", + "properties": { + "cpu": { + "description": "CPU使用量 (如: \"100m\", \"1.5\")", + "type": "string" + }, + "memory": { + "description": "内存使用量 (如: \"128Mi\", \"1Gi\")", + "type": "string" + } + } + }, + "model.ResourceUsageRate": { + "type": "object", + "properties": { + "cpuRate": { + "description": "CPU使用率 (百分比: 0-100)", + "type": "number" + }, + "memoryRate": { + "description": "内存使用率 (百分比: 0-100)", + "type": "number" + } + } + }, + "model.UpdateCmdbHostDto": { + "type": "object", + "required": [ + "groupId", + "hostName", + "sshIp", + "sshKeyId", + "sshName" + ], + "properties": { + "groupId": { + "description": "主机分组ID", + "type": "integer" + }, + "hostName": { + "description": "主机名称(唯一标识)", + "type": "string" + }, + "id": { + "description": "主机ID", + "type": "integer" + }, + "remark": { + "description": "备注信息(可选)", + "type": "string" + }, + "sshIp": { + "description": "SSH连接IP(公网或私网IP)", + "type": "string" + }, + "sshKeyId": { + "description": "SSH凭据ID(从ecsAuth表获取)", + "type": "integer" + }, + "sshName": { + "description": "SSH登录用户名", + "type": "string" + }, + "sshPort": { + "description": "SSH端口(默认22)", + "type": "integer" + }, + "vendor": { + "description": "厂商类型:1-\u003e自建,2-\u003e阿里云,3-\u003e腾讯云", + "type": "integer" + } + } + }, + "model.UpdateResourceQuotaRequest": { + "type": "object", + "required": [ + "hard" + ], + "properties": { + "hard": { + "description": "硬限制", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "scopeSelector": { + "description": "作用域选择器", + "type": "object", + "additionalProperties": true + }, + "scopes": { + "description": "作用域", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.WorkloadResources": { + "type": "object", + "properties": { + "limits": { + "description": "资源限制", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceSpec" + } + ] + }, + "requests": { + "description": "资源请求", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceSpec" + } + ] + } + } + }` diff --git a/dodevops-api/docs/configcenter/configcenter_docs.go b/dodevops-api/docs/configcenter/configcenter_docs.go new file mode 100644 index 0000000..e4e788e --- /dev/null +++ b/dodevops-api/docs/configcenter/configcenter_docs.go @@ -0,0 +1,1573 @@ +package docsconfigcenter + +const ConfigcenterPaths = ` + "/api/v1/config/accountauth": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据ID获取账号详情", + "parameters": [ + { + "type": "integer", + "description": "账号ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AccountAuth" + } + } + } + ] + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "更新账号认证信息", + "parameters": [ + { + "description": "账号认证信息", + "name": "account", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AccountAuth" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AccountAuth" + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "创建账号认证信息", + "parameters": [ + { + "description": "账号认证信息", + "name": "account", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AccountAuth" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AccountAuth" + } + } + } + ] + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "删除账号认证信息", + "parameters": [ + { + "type": "integer", + "description": "账号ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/accountauth/alias": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据别名查询账号", + "parameters": [ + { + "type": "string", + "description": "账号别名", + "name": "alias", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AccountAuth" + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/accountauth/decrypt": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "解密密码", + "parameters": [ + { + "type": "integer", + "description": "账号ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/accountauth/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取账号列表(分页)", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/result.PageResult" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AccountAuth" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/accountauth/type": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据类型查询账号", + "parameters": [ + { + "type": "string", + "description": "账号类型", + "name": "type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AccountAuth" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/ecsauthadd": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "创建凭据", + "parameters": [ + { + "description": "凭据信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateEcsPasswordAuthDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/ecsauthdelete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "删除凭据", + "parameters": [ + { + "description": "凭据ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.EcsAuthIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/ecsauthdetail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据ID获取凭据详情", + "parameters": [ + { + "type": "integer", + "description": "凭据ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.EcsAuthVo" + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/ecsauthinfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据名称获取凭据", + "parameters": [ + { + "type": "string", + "description": "凭据名称", + "name": "name", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.EcsAuthVo" + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/ecsauthlist": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取所有凭据(分页)", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/result.PageResult" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.EcsAuthVo" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/ecsauthupdate": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "更新凭据", + "parameters": [ + { + "description": "凭据信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateEcsAuthDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/keymanage": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据ID获取密钥详情", + "parameters": [ + { + "type": "integer", + "description": "密钥ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KeyManage" + } + } + } + ] + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "更新密钥管理信息", + "parameters": [ + { + "description": "密钥管理信息", + "name": "keyManage", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateKeyManageDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KeyManage" + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "创建密钥管理信息", + "parameters": [ + { + "description": "密钥管理信息", + "name": "keyManage", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateKeyManageDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KeyManage" + } + } + } + ] + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "删除密钥管理信息", + "parameters": [ + { + "type": "integer", + "description": "密钥ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/keymanage/decrypt": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "解密密钥信息", + "parameters": [ + { + "type": "integer", + "description": "密钥ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/keymanage/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取密钥列表(分页)", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/result.PageResult" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.KeyManage" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/keymanage/sync": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据密钥类型自动同步对应云厂商的主机", + "parameters": [ + { + "description": "同步参数,keyType: 1=阿里云,2=腾讯云,3=百度云", + "name": "request", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "keyId": { + "type": "integer" + }, + "keyType": { + "type": "integer" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/keymanage/type": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据云厂商类型查询密钥", + "parameters": [ + { + "type": "integer", + "description": "云厂商类型", + "name": "type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.KeyManage" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/sync-schedule": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "根据ID获取定时同步配置详情", + "parameters": [ + { + "type": "integer", + "description": "配置ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.SyncSchedule" + } + } + } + ] + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "更新定时同步配置", + "parameters": [ + { + "description": "定时同步配置信息", + "name": "syncSchedule", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSyncScheduleDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.SyncSchedule" + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "创建定时同步配置", + "parameters": [ + { + "description": "定时同步配置信息", + "name": "syncSchedule", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateSyncScheduleDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.SyncSchedule" + } + } + } + ] + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "删除定时同步配置", + "parameters": [ + { + "type": "integer", + "description": "配置ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/sync-schedule/active": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取所有启用的定时同步配置", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SyncSchedule" + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/sync-schedule/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取定时同步配置列表(分页)", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/definitions/result.PageResult" + }, + { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SyncSchedule" + } + } + } + } + ] + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/sync-schedule/log": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取同步日志", + "parameters": [ + { + "type": "integer", + "description": "配置ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "lastRunTime": { + "type": "string" + }, + "syncLog": { + "type": "string" + } + } + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/sync-schedule/scheduler-stats": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "获取调度器状态信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + } + } + } + }, + "/api/v1/config/sync-schedule/toggle-status": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "切换配置状态(启用/禁用)", + "parameters": [ + { + "description": "配置ID和状态", + "name": "request", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "status": { + "type": "integer" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/config/sync-schedule/trigger": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "Config配置中心" + ], + "summary": "手动触发定时同步(测试用)", + "parameters": [ + { + "type": "integer", + "description": "配置ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const ConfigcenterDefinitions = ` + "model.AccountAuth": { + "type": "object", + "properties": { + "alias": { + "description": "别名", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "host": { + "description": "IP地址", + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "description": "用户名", + "type": "string" + }, + "password": { + "description": "密码(加密存储)", + "type": "string" + }, + "port": { + "description": "端口", + "type": "integer" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "type": { + "description": "类型", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + } + } + }, + "model.ConfigMapDetail": { + "type": "object", + "properties": { + "binaryData": { + "description": "二进制数据", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "createdTime": { + "description": "创建时间", + "type": "string" + }, + "data": { + "description": "数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "immutable": { + "description": "是否不可变", + "type": "boolean" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "ConfigMap名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "spec": { + "description": "完整规格配置" + }, + "usage": { + "description": "使用情况(哪些Pod在使用)", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.ConfigMapListResponse": { + "type": "object", + "properties": { + "configMaps": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sConfigMap" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.CreateConfigMapRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "binaryData": { + "description": "二进制数据", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "data": { + "description": "数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "immutable": { + "description": "是否不可变", + "type": "boolean" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "ConfigMap名称", + "type": "string" + } + } + }, + "model.RegistryConfig": { + "type": "object", + "properties": { + "privateRegistry": { + "description": "私有镜像仓库地址", + "type": "string" + }, + "registryPassword": { + "description": "镜像仓库密码", + "type": "string" + }, + "registryUsername": { + "description": "镜像仓库用户名", + "type": "string" + }, + "usePrivateRegistry": { + "description": "是否使用私有仓库", + "type": "boolean" + } + } + }, + "model.UpdateConfigMapRequest": { + "type": "object", + "properties": { + "binaryData": { + "description": "二进制数据", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "data": { + "description": "数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }` diff --git a/dodevops-api/docs/cron_format_fix.md b/dodevops-api/docs/cron_format_fix.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/dashboard/dashboard_docs.go b/dodevops-api/docs/dashboard/dashboard_docs.go new file mode 100644 index 0000000..b27fcf9 --- /dev/null +++ b/dodevops-api/docs/dashboard/dashboard_docs.go @@ -0,0 +1,244 @@ +package docsdashboard + +const DashboardPaths = ` + "/dashboard/assets": { + "get": { + "description": "获取系统资产统计数据,包括主机(按云平台)、数据库(按类型)、K8s集群等资产分布", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "看板管理" + ], + "summary": "获取资产统计数据", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AssetStats" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/dashboard/business-distribution": { + "get": { + "description": "获取各业务线的服务数量分布,包括总服务数量和各业务线的服务占比", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "看板管理" + ], + "summary": "获取业务分布统计数据", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.BusinessDistributionStats" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/dashboard/stats": { + "get": { + "description": "获取系统看板的各项统计数据,包括主机、K8s集群、发布、任务、服务和数据库统计", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "看板管理" + ], + "summary": "获取看板统计数据", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DashboardStats" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const DashboardDefinitions = ` + "model.DashboardStats": { + "type": "object", + "properties": { + "databaseStats": { + "description": "数据库统计", + "allOf": [ + { + "$ref": "#/definitions/model.DatabaseStats" + } + ] + }, + "deploymentStats": { + "description": "发布统计", + "allOf": [ + { + "$ref": "#/definitions/model.DeploymentStats" + } + ] + }, + "hostStats": { + "description": "主机统计", + "allOf": [ + { + "$ref": "#/definitions/model.HostStats" + } + ] + }, + "k8sClusterStats": { + "description": "K8s集群统计", + "allOf": [ + { + "$ref": "#/definitions/model.K8sClusterStats" + } + ] + }, + "serviceStats": { + "description": "服务统计", + "allOf": [ + { + "$ref": "#/definitions/model.ServiceStats" + } + ] + }, + "taskStats": { + "description": "任务统计", + "allOf": [ + { + "$ref": "#/definitions/model.TaskStats" + } + ] + } + } + }` diff --git a/dodevops-api/docs/docs.go b/dodevops-api/docs/docs.go old mode 100644 new mode 100755 index 4db9a08..631a563 --- a/dodevops-api/docs/docs.go +++ b/dodevops-api/docs/docs.go @@ -1,7 +1,18 @@ // Package docs Code generated by swaggo/swag. DO NOT EDIT package docs -import "github.com/swaggo/swag" +import ( + "github.com/swaggo/swag" + docsapp "dodevops-api/docs/app" + docscmdb "dodevops-api/docs/cmdb" + docsconfigcenter "dodevops-api/docs/configcenter" + docsdashboard "dodevops-api/docs/dashboard" + docsk8s "dodevops-api/docs/k8s" + docsmonitor "dodevops-api/docs/monitor" + docssystem "dodevops-api/docs/system" + docstask "dodevops-api/docs/task" + docstool "dodevops-api/docs/tool" +) const docTemplate = `{ "schemes": {{ marshal .Schemes }}, @@ -14,28739 +25,15 @@ const docTemplate = `{ }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", - "paths": { - "/api/v1/admin/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "新增用户接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "新增用户接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddSysAdminDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id删除用户接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysAdminIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id查询用户接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id查询用户接口", - "parameters": [ - { - "type": "integer", - "description": "Id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页获取用户列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "分页获取用户列表接口", - "parameters": [ - { - "type": "integer", - "description": "分页数", - "name": "pageNum", - "in": "query" - }, - { - "type": "integer", - "description": "每页数", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "用户名", - "name": "username", - "in": "query" - }, - { - "type": "string", - "description": "帐号启用状态:1-\u003e启用,2-\u003e禁用", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "开始时间", - "name": "beginTime", - "in": "query" - }, - { - "type": "string", - "description": "结束时间", - "name": "endTime", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改用户接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改用户接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSysAdminDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/updatePassword": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "重置密码接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "重置密码接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.ResetSysAdminPasswordDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/updatePersonal": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改个人信息接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改个人信息接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdatePersonalDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/updatePersonalPassword": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改用户密码接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改用户密码接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdatePersonalPasswordDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/admin/updateStatus": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "用户状态启用/停用接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "用户状态启用/停用接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSysAdminStatusDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/captcha": { - "get": { - "description": "验证码接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "验证码接口", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/database": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "修改数据库记录", - "parameters": [ - { - "description": "数据库信息(必须包含ID)", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbSQL" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "创建数据库", - "parameters": [ - { - "description": "数据库信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbSQL" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "删除数据库记录", - "parameters": [ - { - "type": "integer", - "description": "数据库ID(query参数)", - "name": "id", - "in": "query" - }, - { - "description": "请求体(包含id字段)", - "name": "body", - "in": "body", - "schema": { - "type": "object" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/database/byname": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "根据名称查询数据库", - "parameters": [ - { - "type": "string", - "description": "数据库名称", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/database/bytype": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "根据类型查询数据库", - "parameters": [ - { - "type": "integer", - "description": "数据库类型(1=MySQL 2=PostgreSQL 3=Redis 4=MongoDB 5=Elasticsearch)", - "name": "type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/database/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据ID获取数据库详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "根据ID获取数据库详情", - "parameters": [ - { - "type": "integer", - "description": "数据库ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/databaselist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "获取数据库列表[分页]", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/groupadd": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "新增资产分组接口", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "新增资产分组接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbGroup" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/groupbyname": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据名称查询资产分组", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "根据名称查询资产分组", - "parameters": [ - { - "type": "string", - "description": "分组名称", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/groupdelete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除资产分组接口", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "删除资产分组接口", - "parameters": [ - { - "description": "分组ID", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbGroupIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/grouplist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询所有资产分组,并以树形结构返回", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "查询所有资产分组(树形结构)", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/grouplistwithhosts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询所有资产分组及关联主机,并以树形结构返回", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "查询所有资产分组及关联主机(树形结构)", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/groupupdate": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新资产分组接口", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "更新资产分组接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbGroup" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostbyip": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据IP查询主机(匹配内网IP、公网IP或SSH IP)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "根据IP查询主机", - "parameters": [ - { - "type": "string", - "description": "IP地址", - "name": "ip", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostbyname": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据主机名称模糊查询", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "根据主机名称模糊查询", - "parameters": [ - { - "type": "string", - "description": "主机名称(模糊匹配)", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostbystatus": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据状态查询主机(1-\u003e认证成功,2-\u003e未认证,3-\u003e认证失败)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "根据状态查询主机", - "parameters": [ - { - "type": "integer", - "description": "状态(1/2/3)", - "name": "status", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostcloudcreatealiyun": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建阿里云主机(通过阿里云API获取主机信息)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "创建阿里云主机", - "parameters": [ - { - "description": "阿里云主机信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateCmdbHostCloudDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostcloudcreatebaidu": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建百度云主机(通过百度云API自动扫描所有区域并获取主机信息)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "创建百度云主机", - "parameters": [ - { - "description": "百度云主机信息(AccessKey和SecretKey)", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateCmdbHostCloudDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostcloudcreatetencent": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建腾讯云主机(通过腾讯云API获取主机信息)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "创建腾讯云主机", - "parameters": [ - { - "description": "腾讯云主机信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateCmdbHostCloudDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostcreate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建主机", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "创建主机", - "parameters": [ - { - "description": "主机信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateCmdbHostDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostdelete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除主机", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "删除主机", - "parameters": [ - { - "description": "主机ID", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbHostIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostgroup": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据分组ID获取主机列表(包括所有子分组的主机)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "根据分组ID获取主机列表", - "parameters": [ - { - "type": "integer", - "description": "分组ID", - "name": "groupId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostimport": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "通过上传Excel模板批量导入主机(Excel列顺序:主机别名、SSH地址、SSH端口、SSH用户、备注)", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "从Excel导入主机", - "parameters": [ - { - "type": "file", - "description": "Excel文件", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "integer", - "description": "分组ID", - "name": "groupId", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostinfo": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据ID获取主机", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "根据ID获取主机", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostlist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取主机列表(分页)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "获取主机列表(分页)", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostssh/command/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "在SSH终端执行命令", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB主机SSH" - ], - "summary": "执行SSH命令", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命令", - "name": "command", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostssh/upload/{id}": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "上传本地文件到远程SSH服务器", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB主机SSH" - ], - "summary": "上传文件到SSH服务器", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "要上传的文件", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "远程服务器目标路径", - "name": "destPath", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hostsync": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据主机ID自动同步获取目标主机的基本信息(主机名称、操作系统、CPU、内存、磁盘、内网IP、公网IP)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "同步主机基本信息", - "parameters": [ - { - "description": "主机ID", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbHostIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/hosttemplate": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "下载主机导入Excel模板", - "produces": [ - "application/octet-stream" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "下载主机导入模板", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "file" - } - } - } - } - }, - "/api/v1/cmdb/hostupdate": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新主机", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "CMDB资产管理" - ], - "summary": "更新主机", - "parameters": [ - { - "description": "主机信息(包含ID)", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateCmdbHostDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sql": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "执行更新语句(通过数据库ID/名称)", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "执行更新语句", - "parameters": [ - { - "description": "SQL更新请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "执行插入语句(通过数据库ID/名称)", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "执行插入语句", - "parameters": [ - { - "description": "SQL插入请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "ApiKeyAuth": [] - } - ], - "description": "执行删除语句(通过数据库ID/名称)\n执行原生SQL语句(通过数据库ID/名称)", - "produces": [ - "application/json", - "application/json" - ], - "tags": [ - "CMDB数据库", - "CMDB数据库" - ], - "summary": "执行原生SQL语句", - "parameters": [ - { - "description": "SQL删除请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - }, - { - "description": "SQL执行请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sql/databaselist": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定数据库实例的数据库列表", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "获取数据库列表", - "parameters": [ - { - "description": "数据库查询请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sql/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "ApiKeyAuth": [] - } - ], - "description": "执行删除语句(通过数据库ID/名称)\n执行原生SQL语句(通过数据库ID/名称)", - "produces": [ - "application/json", - "application/json" - ], - "tags": [ - "CMDB数据库", - "CMDB数据库" - ], - "summary": "执行原生SQL语句", - "parameters": [ - { - "description": "SQL删除请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - }, - { - "description": "SQL执行请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sql/select": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "执行查询语句(通过数据库ID/名称)", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "执行查询语句", - "parameters": [ - { - "description": "SQL查询请求", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.SQLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sqlLog/clean": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "清空SQL操作日志接口", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "清空SQL操作日志接口", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sqlLog/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除SQL操作日志", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "根据id删除SQL操作日志", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CmdbSqlLogIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/cmdb/sqlLog/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页获取SQL操作日志列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "CMDB数据库" - ], - "summary": "分页获取SQL操作日志列表接口", - "parameters": [ - { - "type": "integer", - "description": "每页数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "分页数", - "name": "pageNum", - "in": "query" - }, - { - "type": "string", - "description": "执行用户", - "name": "execUser", - "in": "query" - }, - { - "type": "string", - "description": "开始时间", - "name": "beginTime", - "in": "query" - }, - { - "type": "string", - "description": "结束时间", - "name": "endTime", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/accountauth": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据ID获取账号详情", - "parameters": [ - { - "type": "integer", - "description": "账号ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AccountAuth" - } - } - } - ] - } - } - } - }, - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "更新账号认证信息", - "parameters": [ - { - "description": "账号认证信息", - "name": "account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AccountAuth" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AccountAuth" - } - } - } - ] - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "创建账号认证信息", - "parameters": [ - { - "description": "账号认证信息", - "name": "account", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AccountAuth" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AccountAuth" - } - } - } - ] - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "删除账号认证信息", - "parameters": [ - { - "type": "integer", - "description": "账号ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/accountauth/alias": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据别名查询账号", - "parameters": [ - { - "type": "string", - "description": "账号别名", - "name": "alias", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AccountAuth" - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/accountauth/decrypt": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "解密密码", - "parameters": [ - { - "type": "integer", - "description": "账号ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/accountauth/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取账号列表(分页)", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/definitions/result.PageResult" - }, - { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.AccountAuth" - } - } - } - } - ] - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/accountauth/type": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据类型查询账号", - "parameters": [ - { - "type": "string", - "description": "账号类型", - "name": "type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.AccountAuth" - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/ecsauthadd": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "创建凭据", - "parameters": [ - { - "description": "凭据信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateEcsPasswordAuthDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/ecsauthdelete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "删除凭据", - "parameters": [ - { - "description": "凭据ID", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.EcsAuthIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/ecsauthdetail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据ID获取凭据详情", - "parameters": [ - { - "type": "integer", - "description": "凭据ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.EcsAuthVo" - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/ecsauthinfo": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据名称获取凭据", - "parameters": [ - { - "type": "string", - "description": "凭据名称", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.EcsAuthVo" - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/ecsauthlist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取所有凭据(分页)", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/definitions/result.PageResult" - }, - { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.EcsAuthVo" - } - } - } - } - ] - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/ecsauthupdate": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "更新凭据", - "parameters": [ - { - "description": "凭据信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateEcsAuthDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/keymanage": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据ID获取密钥详情", - "parameters": [ - { - "type": "integer", - "description": "密钥ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KeyManage" - } - } - } - ] - } - } - } - }, - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "更新密钥管理信息", - "parameters": [ - { - "description": "密钥管理信息", - "name": "keyManage", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateKeyManageDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KeyManage" - } - } - } - ] - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "创建密钥管理信息", - "parameters": [ - { - "description": "密钥管理信息", - "name": "keyManage", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateKeyManageDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KeyManage" - } - } - } - ] - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "删除密钥管理信息", - "parameters": [ - { - "type": "integer", - "description": "密钥ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/keymanage/decrypt": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "解密密钥信息", - "parameters": [ - { - "type": "integer", - "description": "密钥ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/keymanage/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取密钥列表(分页)", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/definitions/result.PageResult" - }, - { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.KeyManage" - } - } - } - } - ] - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/keymanage/sync": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据密钥类型自动同步对应云厂商的主机", - "parameters": [ - { - "description": "同步参数,keyType: 1=阿里云,2=腾讯云,3=百度云", - "name": "request", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "keyId": { - "type": "integer" - }, - "keyType": { - "type": "integer" - } - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/keymanage/type": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据云厂商类型查询密钥", - "parameters": [ - { - "type": "integer", - "description": "云厂商类型", - "name": "type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.KeyManage" - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/sync-schedule": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "根据ID获取定时同步配置详情", - "parameters": [ - { - "type": "integer", - "description": "配置ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.SyncSchedule" - } - } - } - ] - } - } - } - }, - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "更新定时同步配置", - "parameters": [ - { - "description": "定时同步配置信息", - "name": "syncSchedule", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSyncScheduleDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.SyncSchedule" - } - } - } - ] - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "创建定时同步配置", - "parameters": [ - { - "description": "定时同步配置信息", - "name": "syncSchedule", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateSyncScheduleDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.SyncSchedule" - } - } - } - ] - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "删除定时同步配置", - "parameters": [ - { - "type": "integer", - "description": "配置ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/sync-schedule/active": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取所有启用的定时同步配置", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.SyncSchedule" - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/sync-schedule/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取定时同步配置列表(分页)", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/definitions/result.PageResult" - }, - { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.SyncSchedule" - } - } - } - } - ] - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/sync-schedule/log": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取同步日志", - "parameters": [ - { - "type": "integer", - "description": "配置ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "lastRunTime": { - "type": "string" - }, - "syncLog": { - "type": "string" - } - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/sync-schedule/scheduler-stats": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "获取调度器状态信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - } - } - } - }, - "/api/v1/config/sync-schedule/toggle-status": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "切换配置状态(启用/禁用)", - "parameters": [ - { - "description": "配置ID和状态", - "name": "request", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "status": { - "type": "integer" - } - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/config/sync-schedule/trigger": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "Config配置中心" - ], - "summary": "手动触发定时同步(测试用)", - "parameters": [ - { - "type": "integer", - "description": "配置ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "新增部门接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "新增部门接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysDept" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除部门接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id删除部门接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysDeptIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id查询部门接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id查询部门接口", - "parameters": [ - { - "type": "integer", - "description": "ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询部门列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "查询部门列表接口", - "parameters": [ - { - "type": "string", - "description": "部门名称", - "name": "deptName", - "in": "query" - }, - { - "type": "string", - "description": "部门状态", - "name": "deptStatus", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改部门接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改部门接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysDept" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/users": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取某部门下的所有用户", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "获取某部门下的所有用户接口", - "parameters": [ - { - "type": "integer", - "description": "部门ID", - "name": "deptId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/dept/vo/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "部门下拉列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "部门下拉列表接口", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页获取K8s集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "获取K8s集群列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KubeClusterListResponse" - } - } - } - ] - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建K8s集群,可选择是否自动部署", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "创建K8s集群", - "parameters": [ - { - "description": "集群创建参数", - "name": "cluster", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateKubeClusterRequest" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KubeCluster" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据集群ID获取集群详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "获取K8s集群详情", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KubeCluster" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新集群的基本信息(名称、描述、kubeconfig等)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "更新K8s集群信息", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "集群更新参数", - "name": "cluster", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateKubeClusterRequest" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KubeCluster" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的K8s集群(只能删除已停止的集群)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "删除K8s集群", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误或集群状态不允许删除", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取集群的完整详细信息,包括节点、工作负载、组件、网络配置、监控信息等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "获取K8s集群详细信息", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ClusterDetailResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/events": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取整个集群的事件列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s事件管理" - ], - "summary": "获取集群事件列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 100, - "description": "限制返回数量", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.EventListResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定集群的所有命名空间信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "获取K8s命名空间列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.NamespaceListResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "在指定集群中创建新的命名空间", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "创建K8s命名空间", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "命名空间信息", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateNamespaceRequest" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sNamespace" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定命名空间的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "获取K8s命名空间详情", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sNamespace" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新指定命名空间的标签和注释", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "更新K8s命名空间", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "更新信息", - "name": "namespace", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateNamespaceRequest" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sNamespace" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的命名空间(会同时删除其中的所有资源)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "删除K8s命名空间", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/events": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定命名空间的事件列表,支持按资源类型和名称过滤", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s事件管理" - ], - "summary": "获取K8s事件列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "enum": [ - "Pod", - "Deployment", - "StatefulSet", - "DaemonSet", - "Service" - ], - "type": "string", - "description": "资源类型", - "name": "kind", - "in": "query" - }, - { - "type": "string", - "description": "资源名称", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "default": 100, - "description": "限制返回数量", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.EventListResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/limitranges": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定命名空间的所有默认资源限制", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "获取默认资源限制列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.LimitRangeListResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "为指定命名空间创建默认资源限制", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "创建默认资源限制", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "默认资源限制信息", - "name": "limitrange", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateLimitRangeRequest" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.LimitRangeDetail" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/limitranges/{limitRangeName}": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新指定的默认资源限制", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "更新默认资源限制", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "LimitRange名称", - "name": "limitRangeName", - "in": "path", - "required": true - }, - { - "description": "更新信息", - "name": "limitrange", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateLimitRangeRequest" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.LimitRangeDetail" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "默认资源限制不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的默认资源限制", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "删除默认资源限制", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "LimitRange名称", - "name": "limitRangeName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "默认资源限制不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/resourcequotas": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定命名空间的所有资源配额", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "获取资源配额列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ResourceQuotaListResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "为指定命名空间创建资源配额", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "创建资源配额", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "资源配额信息", - "name": "quota", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateResourceQuotaRequest" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ResourceQuotaDetail" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "命名空间不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/resourcequotas/{quotaName}": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新指定的资源配额", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "更新资源配额", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ResourceQuota名称", - "name": "quotaName", - "in": "path", - "required": true - }, - { - "description": "更新信息", - "name": "quota", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateResourceQuotaRequest" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ResourceQuotaDetail" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "资源配额不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的资源配额", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s命名空间管理" - ], - "summary": "删除资源配额", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ResourceQuota名称", - "name": "quotaName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "资源配额不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定集群的所有节点详细信息,包括名称/IP地址、状态、配置、资源使用情况等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "获取K8s节点信息", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sNode" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定节点的详细信息,包括容器组、资源使用详情等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "获取单个节点详细信息", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sNodeDetail" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/cordon": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "设置节点的可调度状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "封锁/解封节点", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - }, - { - "description": "封锁信息", - "name": "cordon", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CordonNodeRequest" - } - } - ], - "responses": { - "200": { - "description": "操作成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/drain": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "驱逐节点上的所有Pod", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "驱逐节点", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - }, - { - "description": "驱逐配置", - "name": "drain", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.DrainNodeRequest" - } - } - ], - "responses": { - "200": { - "description": "驱逐成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/enhanced": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取节点的完整详细信息,包括基本信息、系统信息、K8s组件版本、资源使用情况、监控信息、Pod列表等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "获取增强的节点详细信息", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.NodeDetailResponse" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/labels": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "为指定节点添加标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "为节点添加标签", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - }, - { - "description": "标签信息", - "name": "label", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddLabelRequest" - } - } - ], - "responses": { - "200": { - "description": "添加成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "移除指定节点的标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "移除节点标签", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - }, - { - "description": "标签信息", - "name": "label", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.RemoveLabelRequest" - } - } - ], - "responses": { - "200": { - "description": "移除成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/resources": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取节点的资源容量、分配情况和Pod资源使用详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "获取节点资源分配详情", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.NodeResourceAllocation" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/taints": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "为指定节点添加污点,控制Pod调度", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "为节点添加污点", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - }, - { - "description": "污点信息", - "name": "taint", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddTaintRequest" - } - } - ], - "responses": { - "200": { - "description": "添加成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "移除指定节点的污点", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s节点管理" - ], - "summary": "移除节点污点", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - }, - { - "description": "污点信息", - "name": "taint", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.RemoveTaintRequest" - } - } - ], - "responses": { - "200": { - "description": "移除成功", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "节点不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取集群运行状态和节点信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "获取K8s集群状态", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/k8s/cluster/{id}/sync": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "通过K8s API同步集群版本、节点数量、集群状态等信息并更新数据库", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s集群管理" - ], - "summary": "同步K8s集群信息", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "同步成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.KubeCluster" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "集群不存在", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "服务器错误", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/login": { - "post": { - "description": "用户登录接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "用户登录接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.LoginDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/menu/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "新增菜单接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "新增菜单接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysMenu" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/menu/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除菜单接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id删除菜单接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysMenuIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/menu/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id查询菜单", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id查询菜单", - "parameters": [ - { - "type": "integer", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/menu/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询菜单列表", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "查询菜单列表", - "parameters": [ - { - "type": "string", - "description": "菜单名称", - "name": "menuName", - "in": "query" - }, - { - "type": "string", - "description": "菜单状态", - "name": "menuStatus", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/menu/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改菜单接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改菜单接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysMenu" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/menu/vo/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询新增选项列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "查询新增选项列表接口", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/delete/{id}": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的agent数据,用于服务器离线无法正常卸载的情况", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "删除agent数据", - "parameters": [ - { - "type": "integer", - "description": "Agent ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/deploy": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "自动编译agent二进制文件,拷贝到目标主机并启动服务,单个主机传[hostId],多个主机传[hostId1,hostId2,hostId3]", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "部署agent到指定主机(支持单个或多个)", - "parameters": [ - { - "description": "部署参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.BatchDeployAgentDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/heartbeat": { - "post": { - "description": "Agent主动上报心跳信息,通过IP自动识别主机", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "更新Agent心跳", - "parameters": [ - { - "description": "心跳数据", - "name": "heartbeat", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AgentHeartbeatDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取所有Agent的列表信息,支持分页和筛选", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取Agent列表", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "hostId", - "in": "query" - }, - { - "type": "integer", - "description": "状态", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "页大小", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/restart/{id}": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "重启指定主机上的agent服务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "重启agent", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/statistics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取Agent的统计信息,包括各状态数量、平台分布等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取Agent统计信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/status/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定主机上agent的运行状态、版本信息等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取agent状态", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/agent/uninstall": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "停止agent服务并删除相关文件,单个主机传[hostId],多个主机传[hostId1,hostId2,hostId3]", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "卸载指定主机的agent(支持单个或多个)", - "parameters": [ - { - "description": "卸载参数(只需hostIds字段)", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.BatchDeployAgentDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/host/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取主机的CPU、内存、磁盘使用率", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取主机监控数据", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/hosts": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "批量获取主机的CPU、内存、磁盘使用率", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "批量获取主机监控数据,主机ID列表,逗号分隔,如:1,2,3", - "parameters": [ - { - "type": "string", - "description": "主机ID列表,逗号分隔,如:1,2,3", - "name": "ids", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/hosts/{id}/all-metrics": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取主机的CPU、内存、磁盘、网络等所有指标的历史数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取主机所有指标历史数据", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "example": "\"2025-08-02 15:00:00\"", - "description": "开始时间(格式: 2025-08-02 15:00:00)", - "name": "start", - "in": "query" - }, - { - "type": "string", - "example": "\"2025-08-02 16:00:00\"", - "description": "结束时间(格式: 2025-08-02 16:00:00)", - "name": "end", - "in": "query" - }, - { - "type": "string", - "example": "\"1h\"", - "description": "时间范围(30m/1h/3h/6h/12h/24h)", - "name": "duration", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/hosts/{id}/history": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取主机的CPU、内存、磁盘使用率历史数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取主机指标历史数据-CPU、内存、磁盘", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "指标类型(cpu/memory/disk)", - "name": "metric", - "in": "query" - }, - { - "type": "string", - "example": "\"2025-08-02 15:00:00\"", - "description": "开始时间(格式: 2025-08-02 15:00:00)", - "name": "start", - "in": "query" - }, - { - "type": "string", - "example": "\"2025-08-02 16:00:00\"", - "description": "结束时间(格式: 2025-08-02 16:00:00)", - "name": "end", - "in": "query" - }, - { - "type": "string", - "example": "\"1h\"", - "description": "时间范围(30m/1h/3h/6h/12h/24h)", - "name": "duration", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/hosts/{id}/ports": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取主机所有TCP端口的监听状态、服务名称和进程信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取主机端口信息", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/monitor/hosts/{id}/top-processes": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取主机CPU和内存使用率前5名的进程信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "监控" - ], - "summary": "获取主机TOP进程使用率", - "parameters": [ - { - "type": "integer", - "description": "主机ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "新增岗位接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "新增岗位接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysPost" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/batch/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "批量删除岗位接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "批量删除岗位接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.DelSysPostDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除岗位接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id删除岗位接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysPostIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id查询岗位", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id查询岗位", - "parameters": [ - { - "type": "integer", - "description": "ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页查询岗位列表", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "分页查询岗位列表", - "parameters": [ - { - "type": "integer", - "description": "分页数", - "name": "pageNum", - "in": "query" - }, - { - "type": "integer", - "description": "每页数", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "岗位名称", - "name": "postName", - "in": "query" - }, - { - "type": "string", - "description": "状态:1-\u003e启用,2-\u003e禁用", - "name": "postStatus", - "in": "query" - }, - { - "type": "string", - "description": "开始时间", - "name": "beginTime", - "in": "query" - }, - { - "type": "string", - "description": "结束时间", - "name": "endTime", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改岗位接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改岗位接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysPost" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/updateStatus": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "岗位状态修改接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "岗位状态修改接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSysPostStatusDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/post/vo/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "岗位下拉列表", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "岗位下拉列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "新增角色接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "新增角色接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddSysRoleDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/assignPermissions": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分配权限接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "分配权限接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.RoleMenu" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除角色接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id删除角色接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysRoleIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id查询角色接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id查询角色接口", - "parameters": [ - { - "type": "integer", - "description": "Id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页查询角色列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "分页查询角色列表接口", - "parameters": [ - { - "type": "integer", - "description": "分页数", - "name": "pageNum", - "in": "query" - }, - { - "type": "integer", - "description": "每页数", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "角色名称", - "name": "roleName", - "in": "query" - }, - { - "type": "string", - "description": "帐号启用状态:1-\u003e启用,2-\u003e禁用", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "开始时间", - "name": "beginTime", - "in": "query" - }, - { - "type": "string", - "description": "结束时间", - "name": "endTime", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "修改角色", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "修改角色", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSysRoleDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/updateStatus": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "角色状态启用/停用接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "角色状态启用/停用接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSysRoleStatusDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/vo/idList": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据角色id查询菜单数据接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据角色id查询菜单数据接口", - "parameters": [ - { - "type": "integer", - "description": "Id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/role/vo/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "角色下拉列表", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "角色下拉列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysLoginInfo/batch/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "批量删除登录日志接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "批量删除登录日志接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.DelSysLoginInfoDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysLoginInfo/clean": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "清空登录日志接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "清空登录日志接口", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysLoginInfo/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据ID删除登录日志接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据ID删除登录日志接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysLoginInfoIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysLoginInfo/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页获取登录日志列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "分页获取登录日志列表接口", - "parameters": [ - { - "type": "integer", - "description": "分页数", - "name": "pageNum", - "in": "query" - }, - { - "type": "integer", - "description": "每页数", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "用户名", - "name": "username", - "in": "query" - }, - { - "type": "string", - "description": "登录状态(1-成功 2-失败)", - "name": "loginStatus", - "in": "query" - }, - { - "type": "string", - "description": "开始时间", - "name": "beginTime", - "in": "query" - }, - { - "type": "string", - "description": "结束时间", - "name": "endTime", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysOperationLog/batch/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "批量删除操作日志接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "批量删除操作日志接口", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.BatchDeleteSysOperationLogDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysOperationLog/clean": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "清空操作日志接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "清空操作日志接口", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysOperationLog/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据id删除操作日志", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "根据id删除操作日志", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.SysOperationLogIdDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/sysOperationLog/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "分页获取操作日志列表接口", - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "分页获取操作日志列表接口", - "parameters": [ - { - "type": "integer", - "description": "每页数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "分页数", - "name": "pageNum", - "in": "query" - }, - { - "type": "string", - "description": "用户名", - "name": "username", - "in": "query" - }, - { - "type": "string", - "description": "开始时间", - "name": "beginTime", - "in": "query" - }, - { - "type": "string", - "description": "结束时间", - "name": "endTime", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建新的任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "创建任务", - "parameters": [ - { - "description": "任务信息", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/controller.CreateTaskRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/ansible": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建Ansible任务(1=手动,2=Git导入)。K8s部署任务请使用专门的K8s创建接口", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "创建Ansible任务", - "parameters": [ - { - "type": "string", - "description": "任务名称", - "name": "name", - "in": "formData", - "required": true - }, - { - "type": "integer", - "description": "任务类型(1=手动,2=Git导入)", - "name": "type", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "主机分组JSON", - "name": "hostGroups", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "Git仓库地址(type=2时必填)", - "name": "gitRepo", - "in": "formData" - }, - { - "type": "string", - "description": "全局变量JSON", - "name": "variables", - "in": "formData" - }, - { - "type": "file", - "description": "playbook文件(type=1时上传)", - "name": "playbooks", - "in": "formData" - }, - { - "type": "file", - "description": "roles目录(type=1时上传)", - "name": "roles", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TaskAnsible" - } - } - } - ] - } - } - } - } - }, - "/api/v1/task/ansible/query/name": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务名称进行模糊查询", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "根据名称模糊查询Ansible任务", - "parameters": [ - { - "type": "string", - "description": "任务名称(支持模糊查询)", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.TaskAnsible" - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/task/ansible/query/type": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务类型查询(1=手动,2=Git导入,3=K8s部署)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "根据类型查询Ansible任务", - "parameters": [ - { - "type": "integer", - "description": "任务类型(1=手动,2=Git导入,3=K8s部署)", - "name": "type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.TaskAnsible" - } - } - } - } - ] - } - } - } - } - }, - "/api/v1/task/ansible/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取Ansible任务详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "获取Ansible任务详情", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TaskAnsible" - } - } - } - ] - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的Ansible任务(级联删除关联的子任务)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "删除Ansible任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/ansible/{id}/log/{work_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "通过SSE协议实时获取Ansible任务执行日志", - "consumes": [ - "application/json" - ], - "produces": [ - "text/event-stream" - ], - "tags": [ - "任务作业" - ], - "summary": "获取Ansible任务日志(SSE)", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "子任务ID", - "name": "work_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "SSE格式的实时日志", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/task/ansible/{id}/start": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "启动指定的Ansible任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "启动Ansible任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/ansiblelist": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取Ansible任务列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "获取Ansible任务列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/controller.ListResponse" - } - } - } - ] - } - } - } - } - }, - "/api/v1/task/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "删除任务", - "parameters": [ - { - "description": "任务ID请求", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.TaskIDRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/execution-info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取任务的执行次数和下次执行时间", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "获取任务执行信息", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - } - } - } - }, - "/api/v1/task/get": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务ID查询任务详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据ID查询任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/k8s": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建K8s集群部署任务", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "创建K8s部署任务", - "parameters": [ - { - "type": "string", - "description": "任务名称", - "name": "name", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "任务描述", - "name": "description", - "in": "formData" - }, - { - "type": "string", - "description": "K8s集群名称", - "name": "cluster_name", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "K8s集群版本", - "name": "cluster_version", - "in": "formData", - "required": true - }, - { - "type": "integer", - "description": "部署模式(1=单节点,2=集群)", - "name": "deployment_mode", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "Master节点主机ID数组JSON", - "name": "master_host_ids", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "Worker节点主机ID数组JSON", - "name": "worker_host_ids", - "in": "formData" - }, - { - "type": "string", - "description": "ETCD节点主机ID数组JSON", - "name": "etcd_host_ids", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "启用组件数组JSON", - "name": "enabled_components", - "in": "formData" - }, - { - "type": "string", - "description": "私有仓库地址", - "name": "private_registry", - "in": "formData" - }, - { - "type": "string", - "description": "仓库用户名", - "name": "registry_username", - "in": "formData" - }, - { - "type": "string", - "description": "仓库密码", - "name": "registry_password", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TaskAnsible" - } - } - } - ] - } - } - } - } - }, - "/api/v1/task/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取任务列表,支持分页和条件查询", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "获取任务列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "任务名称", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "任务状态(1=等待中,2=运行中,3=成功,4=异常)", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/list-with-details": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取任务列表,支持分页和条件查询,包含模板和主机的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "获取任务列表(包含关联信息)", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "任务名称", - "name": "name", - "in": "query" - }, - { - "type": "integer", - "description": "任务状态(1=等待中,2=运行中,3=成功,4=异常)", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/next-execution": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据cron表达式计算下次执行时间", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "计算下次执行时间", - "parameters": [ - { - "type": "string", - "description": "cron表达式", - "name": "cron", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/query/name": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务名称模糊查询任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据名称查询任务", - "parameters": [ - { - "type": "string", - "description": "任务名称", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/query/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务状态查询任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据状态查询任务", - "parameters": [ - { - "type": "integer", - "description": "任务状态(1=等待中,2=运行中,3=成功,4=异常)", - "name": "status", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/query/type": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务类型查询任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据类型查询任务", - "parameters": [ - { - "type": "integer", - "description": "任务类型(1=普通任务,2=定时任务,3=ansible任务,4=工作作业)", - "name": "type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/templates": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务ID获取关联模板信息及状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "获取任务模板及状态", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/task/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新任务信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "更新任务", - "parameters": [ - { - "description": "需要更新的任务字段(必须包含ID)", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.Task" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/taskjob/log": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务ID和模板ID获取日志", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "获取任务日志", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "taskId", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "模板ID", - "name": "templateId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/taskjob/start": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务ID启动任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "启动任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "taskId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/taskjob/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务ID和模板ID获取任务状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "获取任务状态", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "taskId", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "模板ID", - "name": "templateId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/taskjob/stop": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据任务ID和模板ID停止任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务作业" - ], - "summary": "停止单个任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "taskId", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "模板ID", - "name": "templateId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/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.TaskTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/content/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定ID的任务模板脚本内容", - "consumes": [ - "application/json" - ], - "produces": [ - "text/plain" - ], - "tags": [ - "任务中心" - ], - "summary": "获取脚本内容", - "parameters": [ - { - "type": "integer", - "description": "模板ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "脚本内容", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/template/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定ID的任务模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "删除模板", - "parameters": [ - { - "type": "integer", - "description": "模板ID", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/info/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定ID的任务模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据ID获取模板", - "parameters": [ - { - "type": "integer", - "description": "模板ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取所有任务模板列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "获取所有模板", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/query/name": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取名称包含指定字符串的任务模板列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据名称模糊查询模板", - "parameters": [ - { - "type": "string", - "description": "模板名称", - "name": "name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/query/type": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定类型的任务模板列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "根据类型查询模板", - "parameters": [ - { - "type": "integer", - "description": "模板类型(1=shell, 2=python, 3=ansible)", - "name": "type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/template/update": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新任务模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务中心" - ], - "summary": "更新模板", - "parameters": [ - { - "type": "integer", - "description": "模板ID", - "name": "id", - "in": "query", - "required": true - }, - { - "description": "需要更新的模板字段", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.TaskTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新导航工具接口", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tool导航工具" - ], - "summary": "更新导航工具", - "parameters": [ - { - "description": "导航工具信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateToolDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建导航工具接口", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tool导航工具" - ], - "summary": "创建导航工具", - "parameters": [ - { - "description": "导航工具信息", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.AddToolDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/all": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取所有导航工具(不分页)", - "produces": [ - "application/json" - ], - "tags": [ - "Tool导航工具" - ], - "summary": "获取所有导航工具", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/deploy": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建一个服务部署任务,异步执行部署", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tool运维工具箱" - ], - "summary": "创建部署任务", - "parameters": [ - { - "description": "部署参数", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateDeployDto" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/deploy/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取服务部署历史记录列表(分页)", - "produces": [ - "application/json" - ], - "tags": [ - "Tool运维工具箱" - ], - "summary": "获取部署历史列表", - "parameters": [ - { - "type": "string", - "description": "服务名称(模糊查询)", - "name": "serviceName", - "in": "query" - }, - { - "type": "integer", - "description": "主机ID", - "name": "hostId", - "in": "query" - }, - { - "type": "integer", - "description": "状态: 0=部署中, 1=运行中, 2=已停止, 3=部署失败", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/deploy/{id}": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "停止并删除已部署的服务", - "produces": [ - "application/json" - ], - "tags": [ - "Tool运维工具箱" - ], - "summary": "卸载服务", - "parameters": [ - { - "type": "integer", - "description": "部署ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/deploy/{id}/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据部署ID获取部署状态和日志", - "produces": [ - "application/json" - ], - "tags": [ - "Tool运维工具箱" - ], - "summary": "获取部署状态", - "parameters": [ - { - "type": "integer", - "description": "部署ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取导航工具列表(分页)", - "produces": [ - "application/json" - ], - "tags": [ - "Tool导航工具" - ], - "summary": "获取导航工具列表", - "parameters": [ - { - "type": "string", - "description": "标题(模糊查询)", - "name": "title", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/services": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取所有可部署的服务列表及分类", - "produces": [ - "application/json" - ], - "tags": [ - "Tool运维工具箱" - ], - "summary": "获取可部署服务列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/services/{serviceId}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据服务ID获取服务的详细信息", - "produces": [ - "application/json" - ], - "tags": [ - "Tool运维工具箱" - ], - "summary": "获取服务详情", - "parameters": [ - { - "type": "string", - "description": "服务ID", - "name": "serviceId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/tool/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据ID获取导航工具详情", - "produces": [ - "application/json" - ], - "tags": [ - "Tool导航工具" - ], - "summary": "根据ID获取导航工具", - "parameters": [ - { - "type": "integer", - "description": "工具ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除导航工具接口", - "produces": [ - "application/json" - ], - "tags": [ - "Tool导航工具" - ], - "summary": "删除导航工具", - "parameters": [ - { - "type": "integer", - "description": "工具ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/upload": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "单图片上传接口", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "System系统管理" - ], - "summary": "单图片上传接口", - "parameters": [ - { - "type": "file", - "description": "file", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/api/v1/ws/task/ansible/{id}/log/{work_id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "建立WebSocket连接实时推送任务执行日志", - "tags": [ - "任务作业" - ], - "summary": "通过WebSocket实时获取Ansible任务日志", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "子任务ID", - "name": "work_id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "认证token", - "name": "token", - "in": "query" - } - ], - "responses": {} - } - }, - "/apps": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取应用列表,支持分页和筛选", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "获取应用列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "应用名称(模糊查询)", - "name": "name", - "in": "query" - }, - { - "type": "string", - "description": "应用编码(模糊查询)", - "name": "code", - "in": "query" - }, - { - "type": "string", - "description": "应用类型", - "name": "app_type", - "in": "query" - }, - { - "type": "integer", - "description": "状态", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ApplicationListResponse" - } - } - } - ] - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建新的应用,应用编码(code)为可选参数,不提供则根据应用名称自动生成", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "创建应用", - "parameters": [ - { - "description": "创建应用请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateApplicationRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Application" - } - } - } - ] - } - } - } - } - }, - "/apps/business-group-options": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取业务组和业务部门的树形选择器数据,支持二级分组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ServiceTree" - ], - "summary": "获取业务组选项", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/applications": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据业务组、部门和环境获取可发布的应用列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "获取可发布的应用列表", - "parameters": [ - { - "type": "integer", - "description": "业务组ID", - "name": "business_group_id", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "业务部门ID", - "name": "business_dept_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "环境名称", - "name": "environment", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ApplicationForDeployment" - } - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/execute": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "启动快速发布流程,支持串行或并行执行模式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "执行快速发布", - "parameters": [ - { - "description": "执行快速发布请求,支持选择执行模式", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.ExecuteQuickDeploymentRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速发布列表,支持分页和筛选", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "获取快速发布列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "业务组ID", - "name": "business_group_id", - "in": "query" - }, - { - "type": "integer", - "description": "业务部门ID", - "name": "business_dept_id", - "in": "query" - }, - { - "type": "string", - "description": "环境名称", - "name": "environment", - "in": "query" - }, - { - "type": "integer", - "description": "状态", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "创建人ID", - "name": "creator_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.QuickDeploymentListResponse" - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/quick": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建快速发布流程,包含多个应用的发布任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "创建快速发布", - "parameters": [ - { - "description": "创建快速发布请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateQuickDeploymentRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.QuickDeployment" - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/tasks/{task_id}/log": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速发布任务的Jenkins构建日志", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "获取任务构建日志", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "task_id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 0, - "description": "日志起始位置", - "name": "start", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/tasks/{task_id}/status": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速发布任务的实时状态信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "获取任务状态", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "task_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TaskStatusResponse" - } - } - } - ] - } - } - } - } - }, - "/apps/deployment/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速发布详情,包含所有任务信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "QuickDeployment" - ], - "summary": "获取快速发布详情", - "parameters": [ - { - "type": "integer", - "description": "发布ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.QuickDeployment" - } - } - } - ] - } - } - } - } - }, - "/apps/environment": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定应用在指定环境的详细配置信息,包括Jenkins配置状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "获取应用环境配置", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "app_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "环境名称", - "name": "environment", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AppEnvironmentResponse" - } - } - } - ] - } - } - } - } - }, - "/apps/jenkins-job/validate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "验证指定Jenkins服务器中是否存在指定的任务名称", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "验证Jenkins任务是否存在", - "parameters": [ - { - "description": "验证Jenkins任务请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.ValidateJenkinsJobRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ValidateJenkinsJobResponse" - } - } - } - ] - } - } - } - } - }, - "/apps/jenkins-servers": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取所有类型为Jenkins(type=4)的服务器配置信息,用于Jenkins环境配置选择", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "获取Jenkins服务器列表", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsServerOption" - } - } - } - } - ] - } - } - } - } - }, - "/apps/service-tree": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据业务线查询服务,按业务线重新组装排序服务,类似于服务树结构", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ServiceTree" - ], - "summary": "获取业务线服务树", - "parameters": [ - { - "type": "array", - "items": { - "type": "integer" - }, - "collectionFormat": "csv", - "description": "业务组ID列表,为空则查询所有", - "name": "business_group_ids", - "in": "query" - }, - { - "type": "integer", - "description": "应用状态筛选,为空则查询所有状态", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "环境名称筛选,为空则不筛选环境配置", - "name": "environment", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.BusinessLineServiceTree" - } - } - } - } - ] - } - } - } - } - }, - "/apps/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据应用ID获取应用详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "获取应用详情", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Application" - } - } - } - ] - } - } - } - }, - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新应用信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "更新应用", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "更新应用请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateApplicationRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Application" - } - } - } - ] - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定的应用", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "删除应用", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/apps/{id}/jenkins-envs": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据应用ID获取所有Jenkins环境配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "JenkinsEnv" - ], - "summary": "获取应用的所有Jenkins环境配置", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsEnv" - } - } - } - } - ] - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "为指定应用添加新的Jenkins环境配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "为应用添加Jenkins环境配置", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "Jenkins环境配置请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateJenkinsEnvRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsEnv" - } - } - } - ] - } - } - } - } - }, - "/apps/{id}/jenkins-envs/{env_id}": { - "put": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新指定应用的Jenkins环境配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "更新应用的Jenkins环境配置", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Jenkins环境配置ID", - "name": "env_id", - "in": "path", - "required": true - }, - { - "description": "更新Jenkins环境配置请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateJenkinsEnvRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsEnv" - } - } - } - ] - } - } - } - }, - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除指定应用的Jenkins环境配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Application" - ], - "summary": "删除应用的Jenkins环境配置", - "parameters": [ - { - "type": "integer", - "description": "应用ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Jenkins环境配置ID", - "name": "env_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/dashboard/assets": { - "get": { - "description": "获取系统资产统计数据,包括主机(按云平台)、数据库(按类型)、K8s集群等资产分布", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "看板管理" - ], - "summary": "获取资产统计数据", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AssetStats" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/dashboard/business-distribution": { - "get": { - "description": "获取各业务线的服务数量分布,包括总服务数量和各业务线的服务占比", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "看板管理" - ], - "summary": "获取业务分布统计数据", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.BusinessDistributionStats" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/dashboard/stats": { - "get": { - "description": "获取系统看板的各项统计数据,包括主机、K8s集群、发布、任务、服务和数据库统计", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "看板管理" - ], - "summary": "获取看板统计数据", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DashboardStats" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/jenkins/servers": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取所有配置的Jenkins服务器", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins服务器列表", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页数量", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsServerListResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/servers/{id}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据服务器ID获取Jenkins服务器详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins服务器详情", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsServerInfo" - } - } - } - ] - } - } - } - } - }, - "/jenkins/test-connection": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "测试Jenkins服务器连接是否正常", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "测试Jenkins连接", - "parameters": [ - { - "description": "连接测试请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.TestJenkinsConnectionRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TestJenkinsConnectionResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定Jenkins服务器的所有任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins任务列表", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsJobListResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs/search": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "根据关键词模糊搜索指定Jenkins服务器的任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "搜索Jenkins任务", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "搜索关键词", - "name": "keyword", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsJobListResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs/{jobName}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定任务的详细信息和构建历史", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins任务详情", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "任务名称", - "name": "jobName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsJobDetailResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs/{jobName}/builds/{buildNumber}": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定构建的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins构建详情", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "任务名称", - "name": "jobName", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "构建编号", - "name": "buildNumber", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsBuildDetailResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs/{jobName}/builds/{buildNumber}/log": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定构建的日志信息,支持分页获取", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins构建日志", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "任务名称", - "name": "jobName", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "构建编号", - "name": "buildNumber", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 0, - "description": "开始位置", - "name": "start", - "in": "query" - }, - { - "type": "boolean", - "default": false, - "description": "是否返回HTML格式", - "name": "html", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.GetBuildLogResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs/{jobName}/builds/{buildNumber}/stop": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "停止指定的Jenkins构建任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "停止Jenkins构建", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "任务名称", - "name": "jobName", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "构建编号", - "name": "buildNumber", - "in": "path", - "required": true - }, - { - "description": "停止构建请求", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/model.StopBuildRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.StopBuildResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/jobs/{jobName}/start": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "启动指定的Jenkins任务,支持带参数构建", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "启动Jenkins任务", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "任务名称", - "name": "jobName", - "in": "path", - "required": true - }, - { - "description": "启动任务请求", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/model.StartJobRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.StartJobResponse" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/queue": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定Jenkins服务器的构建队列信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins队列信息", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsQueue" - } - } - } - ] - } - } - } - } - }, - "/jenkins/{serverId}/system-info": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取指定Jenkins服务器的系统信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Jenkins" - ], - "summary": "获取Jenkins系统信息", - "parameters": [ - { - "type": "integer", - "description": "服务器ID", - "name": "serverId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.JenkinsSystemInfo" - } - } - } - ] - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/configmaps": { - "get": { - "description": "获取指定集群和命名空间下的ConfigMap列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "获取ConfigMap列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页大小", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigMapListResponse" - } - } - } - ] - } - } - } - }, - "post": { - "description": "创建新的ConfigMap", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "创建ConfigMap", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "创建ConfigMap请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateConfigMapRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sConfigMap" - } - } - } - ] - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/configmaps/{configMapName}": { - "get": { - "description": "获取指定ConfigMap的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "获取ConfigMap详情", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ConfigMap名称", - "name": "configMapName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigMapDetail" - } - } - } - ] - } - } - } - }, - "put": { - "description": "更新指定的ConfigMap", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "更新ConfigMap", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ConfigMap名称", - "name": "configMapName", - "in": "path", - "required": true - }, - { - "description": "更新ConfigMap请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateConfigMapRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sConfigMap" - } - } - } - ] - } - } - } - }, - "delete": { - "description": "删除指定的ConfigMap", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "删除ConfigMap", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ConfigMap名称", - "name": "configMapName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/configmaps/{configMapName}/yaml": { - "get": { - "description": "获取指定ConfigMap的YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "获取ConfigMap YAML", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ConfigMap名称", - "name": "configMapName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - } - } - }, - "put": { - "description": "通过YAML更新ConfigMap配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "更新ConfigMap YAML", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ConfigMap名称", - "name": "configMapName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "request", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sConfigMap" - } - } - } - ] - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments": { - "post": { - "description": "在指定命名空间中创建新的Deployment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment管理" - ], - "summary": "创建Deployment", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "Deployment配置", - "name": "deployment", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateDeploymentRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sWorkload" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}": { - "put": { - "description": "更新指定的Deployment配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment管理" - ], - "summary": "更新Deployment", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - }, - { - "description": "更新配置", - "name": "deployment", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateWorkloadRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sWorkload" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的Deployment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment管理" - ], - "summary": "删除Deployment", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/history": { - "get": { - "description": "获取指定Deployment的所有版本历史信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment版本管理" - ], - "summary": "获取Deployment版本历史", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DeploymentRolloutHistoryResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/pause": { - "post": { - "description": "暂停正在进行的Deployment滚动更新过程", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment版本管理" - ], - "summary": "暂停Deployment滚动更新", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.PauseDeploymentResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/restart": { - "post": { - "description": "通过更新Pod模板来重启Deployment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment管理" - ], - "summary": "重启Deployment", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/resume": { - "post": { - "description": "恢复被暂停的Deployment滚动更新过程", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment版本管理" - ], - "summary": "恢复Deployment滚动更新", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ResumeDeploymentResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/revisions/{revision}": { - "get": { - "description": "获取指定Deployment特定版本的详细配置信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment版本管理" - ], - "summary": "获取Deployment指定版本详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "版本号", - "name": "revision", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DeploymentRevisionDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/rollback": { - "post": { - "description": "将Deployment回滚到指定的历史版本", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment版本管理" - ], - "summary": "回滚Deployment到指定版本", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - }, - { - "description": "回滚请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.RollbackDeploymentRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.RollbackDeploymentResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/rollout-status": { - "get": { - "description": "获取指定Deployment的当前滚动发布状态和进度信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment版本管理" - ], - "summary": "获取Deployment滚动发布状态", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DeploymentRolloutStatusResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/scale": { - "post": { - "description": "调整Deployment的副本数", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Deployment管理" - ], - "summary": "伸缩Deployment", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Deployment名称", - "name": "deploymentName", - "in": "path", - "required": true - }, - { - "description": "伸缩配置", - "name": "scale", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.ScaleWorkloadRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses": { - "get": { - "description": "获取指定命名空间的Ingress列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "获取Ingress列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.IngressListResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "description": "在指定命名空间中创建新的Ingress", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "创建Ingress", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "Ingress配置", - "name": "ingress", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateIngressRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sIngress" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}": { - "get": { - "description": "获取指定Ingress的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "获取Ingress详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.IngressDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "更新指定的Ingress配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "更新Ingress", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - }, - { - "description": "更新配置", - "name": "ingress", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateIngressRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sIngress" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的Ingress", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "删除Ingress", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}/events": { - "get": { - "description": "获取指定Ingress的相关事件列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "获取Ingress事件", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}/monitoring": { - "get": { - "description": "获取指定Ingress的监控指标和状态信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "获取Ingress监控信息", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}/yaml": { - "get": { - "description": "获取指定Ingress的完整YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "获取Ingress的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "通过提供的YAML内容更新Ingress配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Ingress管理" - ], - "summary": "通过YAML更新Ingress", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Ingress名称", - "name": "ingressName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "yaml", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/metrics": { - "get": { - "description": "获取指定命名空间下所有Pod的CPU、内存等监控指标汇总", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s监控" - ], - "summary": "获取命名空间监控指标", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.NamespaceMetricsInfo" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods": { - "get": { - "description": "获取指定命名空间的Pod列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "获取Pod列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/yaml": { - "post": { - "description": "通过提供的YAML内容创建Pod,支持校验模式和DryRun模式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "通过YAML创建Pod", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "创建请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreatePodFromYAMLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.CreatePodFromYAMLResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}": { - "get": { - "description": "获取指定Pod的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "获取Pod详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sPodDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的Pod", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "删除Pod", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/containers": { - "get": { - "description": "获取指定Pod中所有容器的名称列表,用于终端连接时选择容器", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s容器终端" - ], - "summary": "获取Pod中的容器列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/events": { - "get": { - "description": "获取指定Pod的相关事件列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "获取Pod事件", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/logs": { - "get": { - "description": "获取指定Pod容器的日志", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "获取Pod日志", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "容器名称", - "name": "container", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/metrics": { - "get": { - "description": "获取指定Pod的CPU、内存等监控指标和使用率", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s监控" - ], - "summary": "获取Pod监控指标", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.PodMetricsInfo" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/terminal": { - "get": { - "description": "通过WebSocket连接到指定Pod的终端", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s容器终端" - ], - "summary": "连接到Pod终端", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "容器名称(默认为Pod中第一个容器)", - "name": "containerName", - "in": "query" - }, - { - "type": "string", - "description": "执行命令(默认为/bin/bash)", - "name": "command", - "in": "query" - } - ], - "responses": { - "101": { - "description": "Switching Protocols" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/yaml": { - "get": { - "description": "获取指定Pod的完整YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "获取Pod的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "通过YAML内容更新指定的Pod配置,支持校验模式和DryRun模式", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "更新Pod的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名称", - "name": "podName", - "in": "path", - "required": true - }, - { - "description": "更新请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdatePodYAMLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.UpdatePodYAMLResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pvcs": { - "get": { - "description": "获取指定命名空间的PVC列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "获取PVC列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.PVCListResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "description": "在指定命名空间中创建新的PVC", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "创建PVC", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "PVC配置", - "name": "pvc", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreatePVCRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sPersistentVolumeClaim" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pvcs/{pvcName}": { - "get": { - "description": "获取指定PVC的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "获取PVC详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PVC名称", - "name": "pvcName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.PVCDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "更新指定的PVC配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "更新PVC", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PVC名称", - "name": "pvcName", - "in": "path", - "required": true - }, - { - "description": "更新配置", - "name": "pvc", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdatePVCRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sPersistentVolumeClaim" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的PVC", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "删除PVC", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PVC名称", - "name": "pvcName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/pvcs/{pvcName}/yaml": { - "get": { - "description": "获取指定PVC的完整YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "获取PVC的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PVC名称", - "name": "pvcName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "通过提供的YAML内容更新PVC配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PVC" - ], - "summary": "通过YAML更新PVC", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PVC名称", - "name": "pvcName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "yaml", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/secrets": { - "get": { - "description": "获取指定集群和命名空间下的Secret列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "获取Secret列表", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 10, - "description": "每页大小", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.SecretListResponse" - } - } - } - ] - } - } - } - }, - "post": { - "description": "创建新的Secret", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "创建Secret", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "创建Secret请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateSecretRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sSecret" - } - } - } - ] - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/secrets/{secretName}": { - "get": { - "description": "获取指定Secret的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "获取Secret详情", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret名称", - "name": "secretName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.SecretDetail" - } - } - } - ] - } - } - } - }, - "put": { - "description": "更新指定的Secret", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "更新Secret", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret名称", - "name": "secretName", - "in": "path", - "required": true - }, - { - "description": "更新Secret请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateSecretRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sSecret" - } - } - } - ] - } - } - } - }, - "delete": { - "description": "删除指定的Secret", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "删除Secret", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret名称", - "name": "secretName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/secrets/{secretName}/yaml": { - "get": { - "description": "获取指定Secret的YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "获取Secret YAML", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret名称", - "name": "secretName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - } - } - }, - "put": { - "description": "通过YAML更新Secret配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s配置管理" - ], - "summary": "更新Secret YAML", - "parameters": [ - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Secret名称", - "name": "secretName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "request", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sSecret" - } - } - } - ] - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/services": { - "get": { - "description": "获取指定命名空间的Service列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "获取Service列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ServiceListResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "description": "在指定命名空间中创建新的Service", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "创建Service", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "Service配置", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateServiceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sService" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/services/{serviceName}": { - "get": { - "description": "获取指定Service的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "获取Service详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Service名称", - "name": "serviceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ServiceDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "更新指定的Service配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "更新Service", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Service名称", - "name": "serviceName", - "in": "path", - "required": true - }, - { - "description": "更新配置", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateServiceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sService" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的Service", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "删除Service", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Service名称", - "name": "serviceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/services/{serviceName}/events": { - "get": { - "description": "获取指定Service的相关事件列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "获取Service事件", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Service名称", - "name": "serviceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/services/{serviceName}/yaml": { - "get": { - "description": "获取指定Service的完整YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "获取Service的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Service名称", - "name": "serviceName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "通过提供的YAML内容更新Service配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s Service管理" - ], - "summary": "通过YAML更新Service", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Service名称", - "name": "serviceName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "yaml", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads": { - "get": { - "description": "获取指定命名空间的工作负载列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s工作负载管理" - ], - "summary": "获取工作负载列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "enum": [ - "deployment", - "statefulset", - "daemonset", - "job", - "cronjob", - "all" - ], - "type": "string", - "description": "工作负载类型", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.WorkloadListResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/yaml": { - "put": { - "description": "通过YAML内容更新指定的工作负载配置,支持deployment,statefulset,daemonset,job,cronjob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "工作负载YAML管理" - ], - "summary": "更新工作负载的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "description": "更新请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateWorkloadYAMLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.UpdateWorkloadYAMLResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/{type}/{workloadName}": { - "get": { - "description": "获取指定工作负载的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s工作负载管理" - ], - "summary": "获取工作负载详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "enum": [ - "deployment", - "statefulset", - "daemonset", - "job", - "cronjob" - ], - "type": "string", - "description": "工作负载类型", - "name": "type", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "工作负载名称", - "name": "workloadName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sWorkloadDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/{type}/{workloadName}/pods": { - "get": { - "description": "获取指定工作负载下的所有Pod信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Pod管理" - ], - "summary": "获取工作负载下的Pod列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "enum": [ - "deployment", - "statefulset", - "daemonset", - "job", - "cronjob" - ], - "type": "string", - "description": "工作负载类型", - "name": "type", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "工作负载名称", - "name": "workloadName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sPodInfo" - } - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/{workloadType}/{workloadName}/yaml": { - "get": { - "description": "获取指定工作负载的完整YAML配置,支持deployment,statefulset,daemonset,job,cronjob", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "工作负载YAML管理" - ], - "summary": "获取工作负载的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespaceName", - "in": "path", - "required": true - }, - { - "enum": [ - "deployment", - "statefulset", - "daemonset", - "job", - "cronjob" - ], - "type": "string", - "description": "工作负载类型", - "name": "workloadType", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "工作负载名称", - "name": "workloadName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.GetWorkloadYAMLResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/nodes/{nodeName}/metrics": { - "get": { - "description": "获取指定节点的CPU、内存等监控指标和使用率", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s监控" - ], - "summary": "获取节点监控指标", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.NodeMetricsInfo" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/pvs": { - "get": { - "description": "获取集群中的PV列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "获取PV列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.PVListResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "description": "在集群中创建新的PV", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "创建PV", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "PV配置", - "name": "pv", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreatePVRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sPersistentVolume" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/pvs/{pvName}": { - "get": { - "description": "获取指定PV的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "获取PV详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PV名称", - "name": "pvName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.PVDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "更新指定的PV配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "更新PV", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PV名称", - "name": "pvName", - "in": "path", - "required": true - }, - { - "description": "更新配置", - "name": "pv", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdatePVRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sPersistentVolume" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的PV", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "删除PV", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PV名称", - "name": "pvName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/pvs/{pvName}/yaml": { - "get": { - "description": "获取指定PV的完整YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "获取PV的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PV名称", - "name": "pvName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "通过提供的YAML内容更新PV配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-PV" - ], - "summary": "通过YAML更新PV", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "PV名称", - "name": "pvName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "yaml", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/storageclasses": { - "get": { - "description": "获取集群中的存储类列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "获取存储类列表", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.StorageClassListResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "post": { - "description": "在集群中创建新的存储类", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "创建存储类", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "存储类配置", - "name": "storageClass", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.CreateStorageClassRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sStorageClass" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/storageclasses/{storageClassName}": { - "get": { - "description": "获取指定存储类的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "获取存储类详情", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "存储类名称", - "name": "storageClassName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.StorageClassDetail" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "更新指定的存储类配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "更新存储类", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "存储类名称", - "name": "storageClassName", - "in": "path", - "required": true - }, - { - "description": "更新配置", - "name": "storageClass", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.UpdateStorageClassRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.K8sStorageClass" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "delete": { - "description": "删除指定的存储类", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "删除存储类", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "存储类名称", - "name": "storageClassName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/storageclasses/{storageClassName}/yaml": { - "get": { - "description": "获取指定存储类的完整YAML配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "获取存储类的YAML配置", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "存储类名称", - "name": "storageClassName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "object", - "additionalProperties": true - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - }, - "put": { - "description": "通过提供的YAML内容更新存储类配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "K8s存储管理-StorageClass" - ], - "summary": "通过YAML更新存储类", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "存储类名称", - "name": "storageClassName", - "in": "path", - "required": true - }, - { - "description": "YAML内容", - "name": "yaml", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": true - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/k8s/cluster/{id}/yaml/validate": { - "post": { - "description": "校验提供的YAML内容是否符合Kubernetes资源规范", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "YAML校验" - ], - "summary": "校验YAML格式", - "parameters": [ - { - "type": "string", - "description": "Bearer 用户Token", - "name": "Authorization", - "in": "header", - "required": true - }, - { - "type": "integer", - "description": "集群ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "校验请求", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.ValidateYAMLRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/result.Result" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ValidateYAMLResponse" - } - } - } - ] - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/queue/clear-failed": { - "post": { - "description": "清空失败任务队列中的所有任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "清空失败队列", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/queue/details": { - "get": { - "description": "获取各个优先级队列的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "获取队列详细信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/queue/metrics": { - "get": { - "description": "获取任务队列的运行指标,包括队列长度、处理统计等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "获取任务队列指标", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/queue/retry-failed": { - "post": { - "description": "将失败队列中的任务重新提交到正常队列", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "重试失败队列中的任务", - "parameters": [ - { - "type": "integer", - "description": "重试任务数量限制,默认10,最大100", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/scheduled/pause": { - "post": { - "description": "暂停正在运行的定时任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "暂停定时任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "task_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/scheduled/reset": { - "post": { - "description": "将定时任务的所有子任务状态重置为等待中(1),用于修复状态异常的情况", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "重置定时任务子任务状态", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "task_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/scheduled/resume": { - "post": { - "description": "恢复已暂停的定时任务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "恢复定时任务", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "task_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/scheduler/stats": { - "get": { - "description": "获取全局调度器的统计信息,包括活跃任务数、下次运行时间等", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "获取调度器统计信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/system/status": { - "get": { - "description": "获取任务队列和调度器的整体运行状态", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "获取任务系统整体状态", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - }, - "/task/monitor/task/status": { - "get": { - "description": "获取任务的详细状态信息,包括可执行的操作", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "任务监控" - ], - "summary": "获取任务状态详情", - "parameters": [ - { - "type": "integer", - "description": "任务ID", - "name": "task_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/result.Result" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/result.Result" - } - } - } - } - } - }, - "definitions": { - "controller.CreateTaskRequest": { - "type": "object", - "required": [ - "host_ids", - "name", - "shell", - "type" - ], - "properties": { - "cron_expr": { - "type": "string" - }, - "host_ids": { - "type": "string" - }, - "name": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "shell": { - "type": "string" - }, - "type": { - "type": "integer" - } - } - }, - "controller.ListResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.TaskAnsible" - } - }, - "total": { - "type": "integer" - } - } - }, - "controller.SQLRequest": { - "type": "object", - "properties": { - "databaseId": { - "description": "数据库ID", - "type": "integer" - }, - "databaseName": { - "description": "数据库名称", - "type": "string" - }, - "sql": { - "description": "SQL语句", - "type": "string" - } - } - }, - "model.AccountAuth": { - "type": "object", - "properties": { - "alias": { - "description": "别名", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "host": { - "description": "IP地址", - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "description": "用户名", - "type": "string" - }, - "password": { - "description": "密码(加密存储)", - "type": "string" - }, - "port": { - "description": "端口", - "type": "integer" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "type": { - "description": "类型", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - } - } - }, - "model.AddLabelRequest": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "model.AddSysAdminDto": { - "type": "object", - "required": [ - "deptId", - "email", - "nickname", - "password", - "phone", - "postId", - "roleId", - "status", - "username" - ], - "properties": { - "deptId": { - "description": "部门id", - "type": "integer" - }, - "email": { - "description": "邮箱", - "type": "string" - }, - "nickname": { - "description": "昵称", - "type": "string" - }, - "note": { - "description": "备注", - "type": "string" - }, - "password": { - "description": "密码", - "type": "string" - }, - "phone": { - "description": "手机号", - "type": "string" - }, - "postId": { - "description": "岗位id", - "type": "integer" - }, - "roleId": { - "description": "角色id", - "type": "integer" - }, - "status": { - "description": "状态:1-\u003e启用,2-\u003e禁用", - "type": "integer" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.AddSysRoleDto": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "roleKey": { - "description": "角色key", - "type": "string" - }, - "roleName": { - "description": "角色名称", - "type": "string" - }, - "status": { - "description": "状态:1-\u003e启用,2-\u003e禁用", - "type": "integer" - } - } - }, - "model.AddTaintRequest": { - "type": "object", - "required": [ - "effect", - "key" - ], - "properties": { - "effect": { - "type": "string", - "enum": [ - "NoSchedule", - "PreferNoSchedule", - "NoExecute" - ] - }, - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "model.AddToolDto": { - "type": "object", - "required": [ - "link", - "title" - ], - "properties": { - "icon": { - "description": "导航图标", - "type": "string" - }, - "link": { - "description": "链接地址", - "type": "string", - "maxLength": 500 - }, - "sort": { - "description": "排序", - "type": "integer" - }, - "title": { - "description": "导航标题", - "type": "string", - "maxLength": 100, - "minLength": 1 - } - } - }, - "model.AgentHeartbeatDto": { - "type": "object", - "properties": { - "hostname": { - "description": "Agent所在主机的hostname", - "type": "string" - }, - "ip": { - "description": "Agent所在主机的IP地址 (内网IP)", - "type": "string" - }, - "pid": { - "description": "Agent进程ID", - "type": "integer" - }, - "port": { - "description": "Agent监听端口", - "type": "integer" - }, - "token": { - "description": "认证token", - "type": "string" - } - } - }, - "model.AppEnvironmentResponse": { - "type": "object", - "properties": { - "app_code": { - "description": "应用编码", - "type": "string" - }, - "app_id": { - "description": "应用ID", - "type": "integer" - }, - "app_name": { - "description": "应用名称", - "type": "string" - }, - "business_dept_id": { - "description": "业务部门ID", - "type": "integer" - }, - "business_group_id": { - "description": "业务组ID", - "type": "integer" - }, - "environment": { - "description": "环境名称", - "type": "string" - }, - "is_configured": { - "description": "是否已配置", - "type": "boolean" - }, - "jenkins_job_url": { - "description": "Jenkins任务URL", - "type": "string" - }, - "jenkins_server_id": { - "description": "Jenkins服务器ID", - "type": "integer" - }, - "jenkins_server_name": { - "description": "Jenkins服务器名称", - "type": "string" - }, - "job_name": { - "description": "Jenkins任务名称", - "type": "string" - }, - "programming_lang": { - "description": "编程语言", - "type": "string" - }, - "status": { - "description": "应用状态", - "type": "integer" - }, - "status_text": { - "description": "应用状态文本", - "type": "string" - } - } - }, - "model.Application": { - "type": "object", - "properties": { - "business_dept_id": { - "description": "业务部门ID(关联sys_dept)", - "type": "integer" - }, - "business_group_id": { - "description": "基本信息", - "type": "integer" - }, - "code": { - "description": "应用编码", - "type": "string" - }, - "created_at": { - "type": "string" - }, - "databases": { - "description": "关联数据库(cmdb_sql表ID)", - "type": "array", - "items": { - "type": "integer" - } - }, - "description": { - "description": "应用介绍", - "type": "string" - }, - "dev_owners": { - "description": "负责人信息 (多个用户ID,关联sys_admin表)", - "type": "array", - "items": { - "type": "integer" - } - }, - "domains": { - "description": "关联资源 (存储资源ID)", - "type": "array", - "items": { - "type": "string" - } - }, - "health_api": { - "description": "健康检查接口", - "type": "string" - }, - "hosts": { - "description": "关联主机(cmdb_host表ID)", - "type": "array", - "items": { - "type": "integer" - } - }, - "id": { - "type": "integer" - }, - "jenkins_envs": { - "description": "关联的Jenkins环境配置(级联删除)", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsEnv" - } - }, - "name": { - "description": "应用名称", - "type": "string" - }, - "ops_owners": { - "description": "运维负责人", - "type": "array", - "items": { - "type": "integer" - } - }, - "other_res": { - "description": "关联其他资源", - "allOf": [ - { - "$ref": "#/definitions/model.OtherResources" - } - ] - }, - "programming_lang": { - "description": "技术信息", - "type": "string" - }, - "repo_url": { - "description": "仓库地址", - "type": "string" - }, - "start_command": { - "description": "启动命令", - "type": "string" - }, - "status": { - "description": "状态", - "type": "integer" - }, - "stop_command": { - "description": "停止命令", - "type": "string" - }, - "test_owners": { - "description": "测试负责人", - "type": "array", - "items": { - "type": "integer" - } - }, - "updated_at": { - "type": "string" - } - } - }, - "model.ApplicationForDeployment": { - "type": "object", - "properties": { - "can_deploy": { - "description": "是否可以部署", - "type": "boolean" - }, - "code": { - "description": "应用编码", - "type": "string" - }, - "environment": { - "description": "环境名称", - "type": "string" - }, - "id": { - "description": "应用ID", - "type": "integer" - }, - "jenkins_env_id": { - "description": "Jenkins环境配置ID", - "type": "integer" - }, - "job_name": { - "description": "Jenkins任务名称", - "type": "string" - }, - "name": { - "description": "应用名称", - "type": "string" - }, - "reason": { - "description": "不能部署的原因", - "type": "string" - } - } - }, - "model.ApplicationListResponse": { - "type": "object", - "properties": { - "list": { - "description": "列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.Application" - } - }, - "total": { - "description": "总数", - "type": "integer" - } - } - }, - "model.AssetCategoryStats": { - "type": "object", - "properties": { - "category": { - "description": "资产分类名称 (主机/数据库/K8s集群)", - "type": "string" - }, - "items": { - "description": "具体资产项统计", - "type": "array", - "items": { - "$ref": "#/definitions/model.AssetItemStats" - } - }, - "total": { - "description": "该分类总数", - "type": "integer" - } - } - }, - "model.AssetItemStats": { - "type": "object", - "properties": { - "count": { - "description": "数量", - "type": "integer" - }, - "name": { - "description": "资产项名称 (自建主机/阿里云/MySQL等)", - "type": "string" - } - } - }, - "model.AssetStats": { - "type": "object", - "properties": { - "categories": { - "description": "资产分类统计", - "type": "array", - "items": { - "$ref": "#/definitions/model.AssetCategoryStats" - } - }, - "totalAssets": { - "description": "总资产数量", - "type": "integer" - } - } - }, - "model.BatchDeleteSysOperationLogDto": { - "type": "object", - "properties": { - "ids": { - "description": "id列表", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.BatchDeployAgentDto": { - "type": "object", - "required": [ - "hostIds" - ], - "properties": { - "hostIds": { - "description": "主机ID列表", - "type": "array", - "items": { - "type": "integer" - } - }, - "version": { - "description": "版本", - "type": "string" - } - } - }, - "model.BuildAction": { - "type": "object", - "properties": { - "_class": { - "description": "操作类型", - "type": "string" - } - } - }, - "model.BuildExecutor": { - "type": "object", - "properties": { - "node": { - "description": "节点名称", - "type": "string" - }, - "number": { - "description": "执行器编号", - "type": "integer" - } - } - }, - "model.BusinessDistributionStats": { - "type": "object", - "properties": { - "businessLines": { - "description": "业务线列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.BusinessLineStats" - } - }, - "totalServices": { - "description": "总服务数量", - "type": "integer" - } - } - }, - "model.BusinessLineServiceTree": { - "type": "object", - "properties": { - "business_group_id": { - "description": "业务组ID", - "type": "integer" - }, - "business_group_name": { - "description": "业务组名称", - "type": "string" - }, - "service_count": { - "description": "服务数量", - "type": "integer" - }, - "services": { - "description": "服务列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServiceTreeNode" - } - } - } - }, - "model.BusinessLineStats": { - "type": "object", - "properties": { - "id": { - "description": "业务组ID", - "type": "integer" - }, - "name": { - "description": "业务线名称", - "type": "string" - }, - "percentage": { - "description": "占比", - "type": "number" - }, - "serviceCount": { - "description": "服务数量", - "type": "integer" - } - } - }, - "model.ChangeSet": { - "type": "object", - "properties": { - "items": { - "description": "变更项目", - "type": "array", - "items": { - "$ref": "#/definitions/model.ChangeSetItem" - } - }, - "kind": { - "description": "变更类型", - "type": "string" - } - } - }, - "model.ChangeSetItem": { - "type": "object", - "properties": { - "affectedPaths": { - "description": "影响路径", - "type": "array", - "items": { - "type": "string" - } - }, - "author": { - "description": "作者", - "allOf": [ - { - "$ref": "#/definitions/model.User" - } - ] - }, - "comment": { - "description": "提交注释", - "type": "string" - }, - "date": { - "description": "提交日期", - "type": "string" - }, - "id": { - "description": "提交ID", - "type": "string" - }, - "msg": { - "description": "提交消息", - "type": "string" - }, - "timestamp": { - "description": "时间戳", - "type": "integer" - } - } - }, - "model.ClusterDetailResponse": { - "type": "object", - "properties": { - "cluster": { - "$ref": "#/definitions/model.KubeCluster" - }, - "components": { - "description": "安装的组件", - "type": "array", - "items": { - "$ref": "#/definitions/model.ComponentInfo" - } - }, - "events": { - "description": "集群事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.ClusterEvent" - } - }, - "monitoring": { - "description": "监控信息", - "allOf": [ - { - "$ref": "#/definitions/model.MonitoringInfo" - } - ] - }, - "network": { - "description": "网络配置", - "allOf": [ - { - "$ref": "#/definitions/model.NetworkInfo" - } - ] - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeInfo" - } - }, - "runtime": { - "description": "运行时信息", - "allOf": [ - { - "$ref": "#/definitions/model.RuntimeSummary" - } - ] - }, - "summary": { - "$ref": "#/definitions/model.ClusterSummary" - }, - "workloads": { - "description": "工作负载统计", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadSummary" - } - ] - } - } - }, - "model.ClusterEvent": { - "type": "object", - "properties": { - "count": { - "description": "发生次数", - "type": "integer" - }, - "firstTime": { - "description": "首次时间", - "type": "string" - }, - "involvedObject": { - "description": "相关对象", - "type": "string" - }, - "lastTime": { - "description": "最后时间", - "type": "string" - }, - "message": { - "description": "消息", - "type": "string" - }, - "reason": { - "description": "原因", - "type": "string" - }, - "source": { - "description": "事件源", - "type": "string" - }, - "type": { - "description": "事件类型", - "type": "string" - } - } - }, - "model.ClusterResourceMetrics": { - "type": "object", - "properties": { - "available": { - "description": "可用量", - "type": "string" - }, - "requestRate": { - "description": "请求率 (0-100)", - "type": "number" - }, - "total": { - "description": "总量", - "type": "string" - }, - "usageRate": { - "description": "使用率 (0-100)", - "type": "number" - }, - "used": { - "description": "已使用", - "type": "string" - } - } - }, - "model.ClusterSummary": { - "type": "object", - "properties": { - "masterNodes": { - "type": "integer" - }, - "readyNodes": { - "type": "integer" - }, - "totalNodes": { - "type": "integer" - }, - "workerNodes": { - "type": "integer" - } - } - }, - "model.CmdbGroup": { - "type": "object", - "properties": { - "children": { - "description": "子分组(虚拟字段,用于树形展示)", - "type": "array", - "items": { - "$ref": "#/definitions/model.CmdbGroup" - } - }, - "createTime": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "hostCount": { - "description": "主机数量(虚拟字段,包含所有子分组的主机数量)", - "type": "integer" - }, - "hosts": { - "description": "关联的主机列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.CmdbHost" - } - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "name": { - "description": "分组名称", - "type": "string" - }, - "parentId": { - "description": "父级分组ID(0 表示根分组)", - "type": "integer" - } - } - }, - "model.CmdbGroupIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.CmdbHost": { - "type": "object", - "properties": { - "billingType": { - "type": "string" - }, - "cpu": { - "type": "string" - }, - "createTime": { - "$ref": "#/definitions/util.HTime" - }, - "disk": { - "type": "string" - }, - "expireTime": { - "$ref": "#/definitions/util.HTime" - }, - "group": { - "$ref": "#/definitions/model.CmdbGroup" - }, - "groupId": { - "type": "integer" - }, - "hostName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "instanceId": { - "type": "string" - }, - "memory": { - "type": "string" - }, - "name": { - "type": "string" - }, - "os": { - "type": "string" - }, - "privateIp": { - "type": "string" - }, - "publicIp": { - "type": "string" - }, - "region": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "sshIp": { - "type": "string" - }, - "sshKeyId": { - "type": "integer" - }, - "sshName": { - "type": "string" - }, - "sshPort": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "updateTime": { - "$ref": "#/definitions/util.HTime" - }, - "vendor": { - "type": "integer" - } - } - }, - "model.CmdbHostIdDto": { - "type": "object", - "properties": { - "id": { - "type": "integer" - } - } - }, - "model.CmdbSQL": { - "type": "object", - "properties": { - "accountId": { - "description": "所属账号ID", - "type": "integer" - }, - "createdAt": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "description": { - "description": "描述/备注", - "type": "string" - }, - "groupId": { - "description": "所属业务组ID", - "type": "integer" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "name": { - "description": "数据库名称", - "type": "string" - }, - "tags": { - "description": "标签(多个标签用逗号分隔)", - "type": "string" - }, - "type": { - "description": "数据库类型(1=MySQL 2=PostgreSQL 3=Redis 4=MongoDB 5=Elasticsearch)", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - } - } - }, - "model.CmdbSqlLogIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.ComponentInfo": { - "type": "object", - "properties": { - "name": { - "description": "组件名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "组件类型 (system/addon)", - "type": "string" - }, - "version": { - "description": "版本", - "type": "string" - } - } - }, - "model.ConfigMapDetail": { - "type": "object", - "properties": { - "binaryData": { - "description": "二进制数据", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "createdTime": { - "description": "创建时间", - "type": "string" - }, - "data": { - "description": "数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "immutable": { - "description": "是否不可变", - "type": "boolean" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "ConfigMap名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "spec": { - "description": "完整规格配置" - }, - "usage": { - "description": "使用情况(哪些Pod在使用)", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.ConfigMapListResponse": { - "type": "object", - "properties": { - "configMaps": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sConfigMap" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.ContainerInfo": { - "type": "object", - "properties": { - "env": { - "description": "环境变量", - "type": "array", - "items": { - "$ref": "#/definitions/model.EnvVar" - } - }, - "image": { - "description": "镜像", - "type": "string" - }, - "name": { - "description": "容器名称", - "type": "string" - }, - "ports": { - "description": "端口配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerPort" - } - }, - "ready": { - "description": "就绪状态", - "type": "boolean" - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadResources" - } - ] - }, - "restartCount": { - "description": "重启次数", - "type": "integer" - }, - "state": { - "description": "状态", - "type": "string" - } - } - }, - "model.ContainerMetricsInfo": { - "type": "object", - "properties": { - "limits": { - "description": "资源限制量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "name": { - "description": "容器名称", - "type": "string" - }, - "requests": { - "description": "资源请求量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "restartCount": { - "description": "重启次数", - "type": "integer" - }, - "state": { - "description": "容器状态", - "type": "string" - }, - "usage": { - "description": "资源使用量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "usageRate": { - "description": "使用率", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsageRate" - } - ] - } - } - }, - "model.ContainerPort": { - "type": "object", - "properties": { - "containerPort": { - "description": "容器端口", - "type": "integer" - }, - "name": { - "description": "端口名称", - "type": "string" - }, - "protocol": { - "description": "协议", - "type": "string" - } - } - }, - "model.ContainerSpec": { - "type": "object", - "required": [ - "image", - "name" - ], - "properties": { - "args": { - "description": "启动参数", - "type": "array", - "items": { - "type": "string" - } - }, - "command": { - "description": "启动命令", - "type": "array", - "items": { - "type": "string" - } - }, - "env": { - "description": "环境变量", - "type": "array", - "items": { - "$ref": "#/definitions/model.EnvVar" - } - }, - "image": { - "description": "镜像", - "type": "string" - }, - "name": { - "description": "容器名称", - "type": "string" - }, - "ports": { - "description": "端口配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerPort" - } - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadResources" - } - ] - }, - "volumeMounts": { - "description": "存储卷挂载", - "type": "array", - "items": { - "$ref": "#/definitions/model.VolumeMount" - } - } - } - }, - "model.ContainerStatus": { - "type": "object", - "properties": { - "image": { - "description": "镜像", - "type": "string" - }, - "name": { - "description": "容器名称", - "type": "string" - }, - "ready": { - "description": "就绪状态", - "type": "boolean" - }, - "restartCount": { - "description": "重启次数", - "type": "integer" - }, - "state": { - "description": "状态", - "type": "string" - } - } - }, - "model.CordonNodeRequest": { - "type": "object", - "properties": { - "reason": { - "type": "string" - }, - "unschedulable": { - "type": "boolean" - } - } - }, - "model.CreateApplicationRequest": { - "type": "object", - "required": [ - "business_dept_id", - "business_group_id", - "name" - ], - "properties": { - "business_dept_id": { - "description": "业务部门ID", - "type": "integer" - }, - "business_group_id": { - "description": "业务组ID", - "type": "integer" - }, - "code": { - "description": "应用编码(可选,不提供则根据名称自动生成)", - "type": "string" - }, - "databases": { - "description": "关联数据库ID", - "type": "array", - "items": { - "type": "integer" - } - }, - "description": { - "description": "应用介绍", - "type": "string" - }, - "dev_owners": { - "description": "负责人信息", - "type": "array", - "items": { - "type": "integer" - } - }, - "domains": { - "description": "关联资源", - "type": "array", - "items": { - "type": "string" - } - }, - "health_api": { - "description": "健康检查接口", - "type": "string" - }, - "hosts": { - "description": "关联主机ID", - "type": "array", - "items": { - "type": "integer" - } - }, - "jenkins_envs": { - "description": "Jenkins环境配置(可选,如果不提供则创建默认的3套环境:prod, test, dev)", - "type": "array", - "items": { - "$ref": "#/definitions/model.CreateJenkinsEnvRequest" - } - }, - "name": { - "description": "应用名称", - "type": "string" - }, - "ops_owners": { - "description": "运维负责人ID数组", - "type": "array", - "items": { - "type": "integer" - } - }, - "other_res": { - "description": "其他资源", - "allOf": [ - { - "$ref": "#/definitions/model.OtherResources" - } - ] - }, - "programming_lang": { - "description": "技术信息", - "type": "string" - }, - "repo_url": { - "description": "仓库地址", - "type": "string" - }, - "start_command": { - "description": "启动命令", - "type": "string" - }, - "stop_command": { - "description": "停止命令", - "type": "string" - }, - "test_owners": { - "description": "测试负责人ID数组", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.CreateCmdbHostCloudDto": { - "type": "object", - "required": [ - "accessKey", - "groupId", - "region", - "secretKey", - "vendor" - ], - "properties": { - "accessKey": { - "description": "AK", - "type": "string" - }, - "groupId": { - "description": "分组ID", - "type": "integer" - }, - "instanceId": { - "description": "实例ID(可选)", - "type": "string" - }, - "region": { - "description": "区域", - "type": "string" - }, - "secretKey": { - "description": "SK", - "type": "string" - }, - "vendor": { - "description": "云厂商:2-\u003e阿里云,3-\u003e腾讯云", - "type": "integer" - } - } - }, - "model.CreateCmdbHostDto": { - "type": "object", - "required": [ - "groupId", - "hostName", - "sshIp", - "sshKeyId", - "sshName" - ], - "properties": { - "groupId": { - "description": "主机分组ID", - "type": "integer" - }, - "hostName": { - "description": "主机名称(唯一标识)", - "type": "string" - }, - "remark": { - "description": "备注信息(可选)", - "type": "string" - }, - "sshIp": { - "description": "SSH连接IP(公网或私网IP)", - "type": "string" - }, - "sshKeyId": { - "description": "SSH凭据ID(从ecsAuth表获取)", - "type": "integer" - }, - "sshName": { - "description": "SSH登录用户名", - "type": "string" - }, - "sshPort": { - "description": "SSH端口(默认22)", - "type": "integer" - } - } - }, - "model.CreateConfigMapRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "binaryData": { - "description": "二进制数据", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "data": { - "description": "数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "immutable": { - "description": "是否不可变", - "type": "boolean" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "ConfigMap名称", - "type": "string" - } - } - }, - "model.CreateDeployDto": { - "type": "object", - "required": [ - "hostId", - "installDir", - "serviceId", - "version" - ], - "properties": { - "autoStart": { - "description": "是否自动启动", - "type": "boolean" - }, - "envVars": { - "description": "环境变量", - "type": "object", - "additionalProperties": true - }, - "hostId": { - "description": "主机ID", - "type": "integer" - }, - "installDir": { - "description": "安装目录", - "type": "string" - }, - "serviceId": { - "description": "服务ID (如: mysql)", - "type": "string" - }, - "version": { - "description": "版本 (如: 5.7)", - "type": "string" - } - } - }, - "model.CreateDeploymentRequest": { - "type": "object", - "required": [ - "name", - "template" - ], - "properties": { - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "Deployment名称", - "type": "string" - }, - "replicas": { - "description": "副本数,默认1", - "type": "integer" - }, - "strategy": { - "description": "部署策略", - "allOf": [ - { - "$ref": "#/definitions/model.DeploymentStrategy" - } - ] - }, - "template": { - "description": "Pod模板", - "allOf": [ - { - "$ref": "#/definitions/model.PodTemplateSpec" - } - ] - } - } - }, - "model.CreateEcsPasswordAuthDto": { - "type": "object", - "required": [ - "name", - "password", - "port", - "type", - "username" - ], - "properties": { - "name": { - "description": "凭证名称", - "type": "string" - }, - "password": { - "description": "密码", - "type": "string" - }, - "port": { - "description": "端口号", - "type": "integer" - }, - "publicKey": { - "description": "公钥", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "type": { - "description": "认证类型:1-\u003e密码", - "type": "integer" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.CreateIngressRequest": { - "type": "object", - "required": [ - "name", - "rules" - ], - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "class": { - "description": "Ingress类", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "Ingress名称", - "type": "string" - }, - "rules": { - "description": "路由规则", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressRuleSpec" - } - }, - "tls": { - "description": "TLS配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressTLSSpec" - } - } - } - }, - "model.CreateJenkinsEnvRequest": { - "type": "object", - "required": [ - "env_name" - ], - "properties": { - "app_id": { - "description": "应用ID(由控制器自动设置)", - "type": "integer" - }, - "env_name": { - "description": "环境名称", - "type": "string" - }, - "jenkins_server_id": { - "description": "Jenkins服务器ID(关联account_auth表)", - "type": "integer" - }, - "job_name": { - "description": "Jenkins任务名称", - "type": "string" - } - } - }, - "model.CreateKeyManageDto": { - "type": "object", - "required": [ - "keyId", - "keySecret", - "keyType" - ], - "properties": { - "keyId": { - "description": "密钥ID", - "type": "string" - }, - "keySecret": { - "description": "密钥Secret", - "type": "string" - }, - "keyType": { - "description": "云厂商类型:1=阿里云,2=腾讯云,3=百度云,4=华为云,5=AWS云", - "type": "integer" - }, - "remark": { - "description": "备注信息", - "type": "string" - } - } - }, - "model.CreateKubeClusterRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "autoDeploy": { - "description": "是否自动部署", - "type": "boolean" - }, - "clusterType": { - "description": "集群类型:1-自建,2-导入(默认为自建)", - "type": "integer" - }, - "deploymentMode": { - "description": "部署模式:1-单Master,2-多Master", - "type": "integer" - }, - "description": { - "description": "集群描述", - "type": "string" - }, - "enabledComponents": { - "description": "启用组件", - "type": "array", - "items": { - "type": "string" - } - }, - "kubeconfig": { - "description": "导入集群参数", - "type": "string" - }, - "name": { - "description": "集群名称", - "type": "string" - }, - "nodeConfig": { - "description": "节点配置", - "allOf": [ - { - "$ref": "#/definitions/model.NodeConfig" - } - ] - }, - "privateRegistry": { - "description": "私有镜像仓库地址(兼容旧版本)", - "type": "string" - }, - "registryConfig": { - "description": "镜像仓库配置(新版本)", - "allOf": [ - { - "$ref": "#/definitions/model.RegistryConfig" - } - ] - }, - "registryPassword": { - "description": "镜像仓库密码(兼容旧版本)", - "type": "string" - }, - "registryUsername": { - "description": "镜像仓库用户名(兼容旧版本)", - "type": "string" - }, - "taskDescription": { - "description": "任务描述", - "type": "string" - }, - "taskName": { - "description": "任务名称", - "type": "string" - }, - "version": { - "description": "自建集群参数", - "type": "string" - } - } - }, - "model.CreateLimitRangeRequest": { - "type": "object", - "required": [ - "name", - "spec" - ], - "properties": { - "name": { - "description": "LimitRange名称", - "type": "string" - }, - "spec": { - "description": "LimitRange规格", - "allOf": [ - { - "$ref": "#/definitions/model.LimitRangeRequestSpec" - } - ] - } - } - }, - "model.CreateNamespaceRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "命名空间名称", - "type": "string" - } - } - }, - "model.CreatePVCRequest": { - "type": "object", - "required": [ - "accessModes", - "name", - "resources" - ], - "properties": { - "accessModes": { - "description": "访问模式", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "PVC名称", - "type": "string" - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.PVCResourcesSpec" - } - ] - }, - "selector": { - "description": "标签选择器", - "allOf": [ - { - "$ref": "#/definitions/model.PVCSelectorSpec" - } - ] - }, - "storageClass": { - "description": "存储类名称", - "type": "string" - }, - "volumeMode": { - "description": "卷模式", - "type": "string" - } - } - }, - "model.CreatePVRequest": { - "type": "object", - "required": [ - "accessModes", - "capacity", - "name", - "persistentVolumeSource" - ], - "properties": { - "accessModes": { - "description": "访问模式", - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "description": "容量", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "PV名称", - "type": "string" - }, - "nodeAffinity": { - "description": "节点亲和性", - "allOf": [ - { - "$ref": "#/definitions/model.PVNodeAffinity" - } - ] - }, - "persistentVolumeSource": { - "description": "存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVSourceSpec" - } - ] - }, - "reclaimPolicy": { - "description": "回收策略", - "type": "string" - }, - "storageClassName": { - "description": "存储类名称", - "type": "string" - }, - "volumeMode": { - "description": "卷模式", - "type": "string" - } - } - }, - "model.CreatePodFromYAMLRequest": { - "type": "object", - "required": [ - "yamlContent" - ], - "properties": { - "dryRun": { - "description": "是否只进行校验不实际创建", - "type": "boolean" - }, - "validateOnly": { - "description": "是否只校验YAML格式", - "type": "boolean" - }, - "yamlContent": { - "description": "YAML内容", - "type": "string" - } - } - }, - "model.CreatePodFromYAMLResponse": { - "type": "object", - "properties": { - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "Pod所在的命名空间", - "type": "string" - }, - "parsedObject": { - "description": "解析的对象信息", - "type": "object", - "additionalProperties": true - }, - "podName": { - "description": "创建的Pod名称", - "type": "string" - }, - "success": { - "description": "是否创建成功", - "type": "boolean" - }, - "validationResult": { - "description": "校验结果(DryRun时返回)", - "allOf": [ - { - "$ref": "#/definitions/model.ValidateYAMLResponse" - } - ] - } - } - }, - "model.CreateQuickDeploymentRequest": { - "type": "object", - "required": [ - "applications", - "business_dept_id", - "business_group_id", - "title" - ], - "properties": { - "applications": { - "description": "应用列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.QuickDeploymentAppRequest" - } - }, - "business_dept_id": { - "description": "业务部门ID", - "type": "integer" - }, - "business_group_id": { - "description": "业务组ID", - "type": "integer" - }, - "description": { - "description": "发布描述", - "type": "string" - }, - "title": { - "description": "发布标题", - "type": "string" - } - } - }, - "model.CreateResourceQuotaRequest": { - "type": "object", - "required": [ - "hard", - "name" - ], - "properties": { - "hard": { - "description": "硬限制", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "ResourceQuota名称", - "type": "string" - }, - "scopeSelector": { - "description": "作用域选择器", - "type": "object", - "additionalProperties": true - }, - "scopes": { - "description": "作用域", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.CreateSecretRequest": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "data": { - "description": "数据(base64编码)", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "immutable": { - "description": "是否不可变", - "type": "boolean" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "Secret名称", - "type": "string" - }, - "stringData": { - "description": "字符串数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "Secret类型", - "type": "string" - } - } - }, - "model.CreateServiceRequest": { - "type": "object", - "required": [ - "name", - "ports", - "selector", - "type" - ], - "properties": { - "externalIPs": { - "description": "外部IP列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "服务名称", - "type": "string" - }, - "ports": { - "description": "端口配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServicePortSpec" - } - }, - "selector": { - "description": "选择器", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "服务类型", - "type": "string" - } - } - }, - "model.CreateStorageClassRequest": { - "type": "object", - "required": [ - "name", - "provisioner" - ], - "properties": { - "allowVolumeExpansion": { - "description": "允许卷扩展", - "type": "boolean" - }, - "allowedTopologies": { - "description": "允许的拓扑", - "type": "array", - "items": { - "$ref": "#/definitions/model.StorageClassTopology" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "存储类名称", - "type": "string" - }, - "parameters": { - "description": "参数", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "provisioner": { - "description": "提供者", - "type": "string" - }, - "reclaimPolicy": { - "description": "回收策略", - "type": "string" - }, - "volumeBindingMode": { - "description": "卷绑定模式", - "type": "string" - } - } - }, - "model.CreateSyncScheduleDto": { - "type": "object", - "required": [ - "cronExpr", - "keyTypes", - "name" - ], - "properties": { - "cronExpr": { - "description": "cron表达式", - "type": "string" - }, - "keyTypes": { - "description": "要同步的云厂商类型(JSON数组格式:[1,2,3])", - "type": "string" - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "remark": { - "description": "备注信息", - "type": "string" - }, - "status": { - "description": "状态:1=启用,0=禁用", - "type": "integer" - } - } - }, - "model.DashboardStats": { - "type": "object", - "properties": { - "databaseStats": { - "description": "数据库统计", - "allOf": [ - { - "$ref": "#/definitions/model.DatabaseStats" - } - ] - }, - "deploymentStats": { - "description": "发布统计", - "allOf": [ - { - "$ref": "#/definitions/model.DeploymentStats" - } - ] - }, - "hostStats": { - "description": "主机统计", - "allOf": [ - { - "$ref": "#/definitions/model.HostStats" - } - ] - }, - "k8sClusterStats": { - "description": "K8s集群统计", - "allOf": [ - { - "$ref": "#/definitions/model.K8sClusterStats" - } - ] - }, - "serviceStats": { - "description": "服务统计", - "allOf": [ - { - "$ref": "#/definitions/model.ServiceStats" - } - ] - }, - "taskStats": { - "description": "任务统计", - "allOf": [ - { - "$ref": "#/definitions/model.TaskStats" - } - ] - } - } - }, - "model.DatabaseStats": { - "type": "object", - "properties": { - "byType": { - "description": "按类型统计", - "type": "object", - "additionalProperties": { - "type": "integer" - } - }, - "total": { - "description": "数据库总数", - "type": "integer" - } - } - }, - "model.DelSysLoginInfoDto": { - "type": "object", - "properties": { - "ids": { - "description": "Id列表", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.DelSysPostDto": { - "type": "object", - "properties": { - "ids": { - "description": "Id列表", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.DeploymentRevision": { - "type": "object", - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "changeReason": { - "description": "变更原因", - "type": "string" - }, - "creationTime": { - "description": "创建时间", - "type": "string" - }, - "images": { - "description": "镜像列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "replicasSummary": { - "description": "副本统计", - "allOf": [ - { - "$ref": "#/definitions/model.ReplicasSummary" - } - ] - }, - "revision": { - "description": "版本号", - "type": "integer" - }, - "status": { - "description": "版本状态 (current/historical)", - "type": "string" - } - } - }, - "model.DeploymentRevisionDetail": { - "type": "object", - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "changeReason": { - "description": "变更原因", - "type": "string" - }, - "conditions": { - "description": "状态条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.WorkloadCondition" - } - }, - "creationTime": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "images": { - "description": "镜像列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "podTemplate": { - "description": "Pod模板", - "allOf": [ - { - "$ref": "#/definitions/model.PodTemplateSpec" - } - ] - }, - "replicaSets": { - "description": "关联的ReplicaSet信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.ReplicaSetInfo" - } - }, - "replicasSummary": { - "description": "副本统计", - "allOf": [ - { - "$ref": "#/definitions/model.ReplicasSummary" - } - ] - }, - "revision": { - "description": "版本号", - "type": "integer" - }, - "status": { - "description": "版本状态 (current/historical)", - "type": "string" - }, - "strategy": { - "description": "部署策略", - "allOf": [ - { - "$ref": "#/definitions/model.DeploymentStrategy" - } - ] - } - } - }, - "model.DeploymentRolloutHistoryResponse": { - "type": "object", - "properties": { - "currentRevision": { - "description": "当前版本号", - "type": "integer" - }, - "deploymentName": { - "description": "Deployment名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "revisions": { - "description": "版本列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.DeploymentRevision" - } - }, - "totalRevisions": { - "description": "总版本数", - "type": "integer" - } - } - }, - "model.DeploymentRolloutStatusResponse": { - "type": "object", - "properties": { - "availableReplicas": { - "description": "可用副本数", - "type": "integer" - }, - "conditions": { - "description": "状态条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.WorkloadCondition" - } - }, - "currentRevision": { - "description": "当前版本号", - "type": "integer" - }, - "deploymentName": { - "description": "Deployment名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "observedGeneration": { - "description": "观察到的代数", - "type": "integer" - }, - "paused": { - "description": "是否已暂停", - "type": "boolean" - }, - "progressDeadline": { - "description": "进度截止时间", - "type": "integer" - }, - "readyReplicas": { - "description": "就绪副本数", - "type": "integer" - }, - "rolloutComplete": { - "description": "是否滚动发布完成", - "type": "boolean" - }, - "status": { - "description": "总体状态 (Progressing/Complete/Failed/Paused)", - "type": "string" - }, - "strategy": { - "description": "部署策略", - "allOf": [ - { - "$ref": "#/definitions/model.DeploymentStrategy" - } - ] - }, - "updatedReplicas": { - "description": "已更新副本数", - "type": "integer" - } - } - }, - "model.DeploymentStats": { - "type": "object", - "properties": { - "failed": { - "description": "失败次数", - "type": "integer" - }, - "success": { - "description": "成功次数", - "type": "integer" - }, - "successRate": { - "description": "成功率", - "type": "number" - }, - "total": { - "description": "发布总次数", - "type": "integer" - } - } - }, - "model.DeploymentStrategy": { - "type": "object", - "properties": { - "rollingUpdate": { - "description": "滚动更新配置", - "allOf": [ - { - "$ref": "#/definitions/model.RollingUpdateDeployment" - } - ] - }, - "type": { - "description": "策略类型", - "type": "string" - } - } - }, - "model.DrainNodeRequest": { - "type": "object", - "properties": { - "deleteLocalData": { - "description": "删除本地数据", - "type": "boolean" - }, - "force": { - "description": "强制驱逐", - "type": "boolean" - }, - "gracePeriodSeconds": { - "description": "优雅终止时间", - "type": "integer" - }, - "ignoreDaemonSets": { - "description": "忽略DaemonSet", - "type": "boolean" - } - } - }, - "model.EcsAuthIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.EcsAuthVo": { - "type": "object", - "properties": { - "createTime": { - "$ref": "#/definitions/util.HTime" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "password": { - "type": "string" - }, - "port": { - "type": "integer" - }, - "publicKey": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "type": { - "type": "integer" - }, - "username": { - "type": "string" - } - } - }, - "model.EndpointPort": { - "type": "object", - "properties": { - "name": { - "description": "端口名称", - "type": "string" - }, - "port": { - "description": "端口号", - "type": "integer" - }, - "protocol": { - "description": "协议", - "type": "string" - } - } - }, - "model.EnvVar": { - "type": "object", - "properties": { - "name": { - "description": "变量名", - "type": "string" - }, - "value": { - "description": "变量值", - "type": "string" - } - } - }, - "model.EventInfo": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "firstTime": { - "type": "string" - }, - "lastTime": { - "type": "string" - }, - "message": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "model.EventListResponse": { - "type": "object", - "properties": { - "events": { - "description": "事件列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "filter": { - "description": "过滤条件", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "namespace": { - "description": "命名空间(如果是命名空间级别的查询)", - "type": "string" - }, - "total": { - "description": "事件总数", - "type": "integer" - } - } - }, - "model.ExecuteQuickDeploymentRequest": { - "type": "object", - "required": [ - "deployment_id" - ], - "properties": { - "deployment_id": { - "description": "发布ID", - "type": "integer" - }, - "execution_mode": { - "description": "执行模式: 1=并行(默认) 2=串行", - "type": "integer", - "default": 1, - "enum": [ - 1, - 2 - ] - } - } - }, - "model.GetBuildLogResponse": { - "type": "object", - "properties": { - "buildNumber": { - "description": "构建编号", - "type": "integer" - }, - "hasMore": { - "description": "是否有更多日志", - "type": "boolean" - }, - "jobName": { - "description": "任务名称", - "type": "string" - }, - "log": { - "description": "日志内容", - "type": "string" - }, - "moreData": { - "description": "是否有更多数据", - "type": "boolean" - }, - "server": { - "description": "服务器名称", - "type": "string" - }, - "textSize": { - "description": "文本大小", - "type": "integer" - } - } - }, - "model.GetWorkloadYAMLResponse": { - "type": "object", - "properties": { - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "success": { - "description": "是否获取成功", - "type": "boolean" - }, - "workloadName": { - "description": "工作负载名称", - "type": "string" - }, - "workloadType": { - "description": "工作负载类型", - "type": "string" - }, - "yamlContent": { - "description": "YAML内容", - "type": "string" - } - } - }, - "model.HostStats": { - "type": "object", - "properties": { - "offline": { - "description": "离线数量", - "type": "integer" - }, - "online": { - "description": "在线数量", - "type": "integer" - }, - "total": { - "description": "主机总数", - "type": "integer" - } - } - }, - "model.IngressBackend": { - "type": "object", - "properties": { - "service": { - "description": "服务后端", - "allOf": [ - { - "$ref": "#/definitions/model.IngressServiceBackend" - } - ] - } - } - }, - "model.IngressDetail": { - "type": "object", - "properties": { - "class": { - "description": "Ingress类/控制器类型", - "type": "string" - }, - "controllerName": { - "description": "Controller名称", - "type": "string" - }, - "controllerVersion": { - "description": "Controller版本", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "endpoints": { - "description": "访问端点", - "type": "array", - "items": { - "type": "string" - } - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "loadBalancer": { - "description": "负载均衡器信息", - "allOf": [ - { - "$ref": "#/definitions/model.IngressLoadBalancer" - } - ] - }, - "name": { - "description": "Ingress名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "rules": { - "description": "路由规则", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressRule" - } - }, - "spec": { - "description": "完整规格配置" - }, - "status": { - "description": "状态", - "type": "string" - }, - "tls": { - "description": "TLS配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressTLS" - } - }, - "type": { - "description": "Ingress类型:公网Nginx/内网Nginx等", - "type": "string" - } - } - }, - "model.IngressListResponse": { - "type": "object", - "properties": { - "ingresses": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sIngress" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.IngressLoadBalancer": { - "type": "object", - "properties": { - "ingress": { - "description": "入口信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressLoadBalancerIngress" - } - } - } - }, - "model.IngressLoadBalancerIngress": { - "type": "object", - "properties": { - "hostname": { - "description": "主机名", - "type": "string" - }, - "ip": { - "description": "IP地址", - "type": "string" - }, - "ports": { - "description": "端口信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressLoadBalancerPort" - } - } - } - }, - "model.IngressLoadBalancerPort": { - "type": "object", - "properties": { - "port": { - "description": "端口号", - "type": "integer" - }, - "protocol": { - "description": "协议", - "type": "string" - } - } - }, - "model.IngressPath": { - "type": "object", - "properties": { - "backend": { - "description": "后端服务", - "allOf": [ - { - "$ref": "#/definitions/model.IngressBackend" - } - ] - }, - "path": { - "description": "路径", - "type": "string" - }, - "pathType": { - "description": "路径类型 Exact/Prefix/ImplementationSpecific", - "type": "string" - } - } - }, - "model.IngressPathSpec": { - "type": "object", - "required": [ - "path", - "pathType", - "serviceName", - "servicePort" - ], - "properties": { - "path": { - "description": "路径", - "type": "string" - }, - "pathType": { - "description": "路径类型", - "type": "string" - }, - "serviceName": { - "description": "服务名称", - "type": "string" - }, - "servicePort": { - "description": "服务端口", - "type": "integer" - } - } - }, - "model.IngressRule": { - "type": "object", - "properties": { - "host": { - "description": "主机名", - "type": "string" - }, - "http": { - "description": "HTTP规则", - "allOf": [ - { - "$ref": "#/definitions/model.IngressRuleValue" - } - ] - } - } - }, - "model.IngressRuleSpec": { - "type": "object", - "required": [ - "host", - "paths" - ], - "properties": { - "host": { - "description": "主机名", - "type": "string" - }, - "paths": { - "description": "路径规则", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressPathSpec" - } - } - } - }, - "model.IngressRuleValue": { - "type": "object", - "properties": { - "paths": { - "description": "路径规则", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressPath" - } - } - } - }, - "model.IngressServiceBackend": { - "type": "object", - "properties": { - "name": { - "description": "服务名称", - "type": "string" - }, - "port": { - "description": "服务端口", - "allOf": [ - { - "$ref": "#/definitions/model.IngressServicePort" - } - ] - } - } - }, - "model.IngressServicePort": { - "type": "object", - "properties": { - "name": { - "description": "端口名称", - "type": "string" - }, - "number": { - "description": "端口号", - "type": "integer" - } - } - }, - "model.IngressTLS": { - "type": "object", - "properties": { - "hosts": { - "description": "主机列表", - "type": "array", - "items": { - "type": "string" - } - }, - "secretName": { - "description": "证书Secret名称", - "type": "string" - } - } - }, - "model.IngressTLSSpec": { - "type": "object", - "required": [ - "hosts", - "secretName" - ], - "properties": { - "hosts": { - "description": "主机列表", - "type": "array", - "items": { - "type": "string" - } - }, - "secretName": { - "description": "证书Secret名称", - "type": "string" - } - } - }, - "model.JenkinsBuild": { - "type": "object", - "properties": { - "actions": { - "description": "构建操作", - "type": "array", - "items": { - "$ref": "#/definitions/model.BuildAction" - } - }, - "building": { - "description": "是否正在构建", - "type": "boolean" - }, - "changeSet": { - "description": "变更集", - "allOf": [ - { - "$ref": "#/definitions/model.ChangeSet" - } - ] - }, - "culprits": { - "description": "责任人", - "type": "array", - "items": { - "$ref": "#/definitions/model.User" - } - }, - "description": { - "description": "构建描述", - "type": "string" - }, - "displayName": { - "description": "显示名称", - "type": "string" - }, - "duration": { - "description": "构建时长(毫秒)", - "type": "integer" - }, - "estimatedDuration": { - "description": "预计时长(毫秒)", - "type": "integer" - }, - "executor": { - "description": "执行器信息", - "allOf": [ - { - "$ref": "#/definitions/model.BuildExecutor" - } - ] - }, - "fullDisplayName": { - "description": "完整显示名称", - "type": "string" - }, - "keepLog": { - "description": "是否保留日志", - "type": "boolean" - }, - "number": { - "description": "构建编号", - "type": "integer" - }, - "queueId": { - "description": "队列ID", - "type": "integer" - }, - "result": { - "description": "构建结果 SUCCESS/FAILURE/UNSTABLE/ABORTED", - "type": "string" - }, - "timestamp": { - "description": "开始时间戳", - "type": "integer" - }, - "url": { - "description": "构建URL", - "type": "string" - } - } - }, - "model.JenkinsBuildDetailResponse": { - "type": "object", - "properties": { - "build": { - "$ref": "#/definitions/model.JenkinsBuild" - }, - "log": { - "description": "构建日志", - "type": "string" - }, - "server": { - "description": "服务器名称", - "type": "string" - } - } - }, - "model.JenkinsComputer": { - "type": "object", - "properties": { - "displayName": { - "description": "显示名称", - "type": "string" - }, - "executors": { - "description": "执行器列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsExecutor" - } - }, - "icon": { - "description": "图标", - "type": "string" - }, - "iconClassName": { - "description": "图标类名", - "type": "string" - }, - "idle": { - "description": "是否空闲", - "type": "boolean" - }, - "jnlpAgent": { - "description": "是否JNLP代理", - "type": "boolean" - }, - "launchSupported": { - "description": "是否支持启动", - "type": "boolean" - }, - "loadStatistics": { - "description": "负载统计", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsLoadStatistics" - } - ] - }, - "manualLaunchAllowed": { - "description": "是否允许手动启动", - "type": "boolean" - }, - "monitorData": { - "description": "监控数据", - "type": "object", - "additionalProperties": true - }, - "numExecutors": { - "description": "执行器数量", - "type": "integer" - }, - "offline": { - "description": "是否离线", - "type": "boolean" - }, - "offlineCause": { - "description": "离线原因" - }, - "oneOffExecutors": { - "description": "一次性执行器", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsExecutor" - } - }, - "temporarilyOffline": { - "description": "是否临时离线", - "type": "boolean" - } - } - }, - "model.JenkinsEnv": { - "type": "object", - "properties": { - "app_id": { - "description": "应用ID", - "type": "integer" - }, - "application": { - "description": "关联", - "allOf": [ - { - "$ref": "#/definitions/model.Application" - } - ] - }, - "created_at": { - "type": "string" - }, - "env_name": { - "description": "环境名称", - "type": "string" - }, - "id": { - "type": "integer" - }, - "jenkins_server_id": { - "description": "Jenkins服务器ID(关联account_auth)", - "type": "integer" - }, - "job_name": { - "description": "Jenkins任务名称", - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "model.JenkinsExecutor": { - "type": "object", - "properties": { - "currentExecutable": { - "description": "当前执行的任务" - }, - "currentWorkUnit": { - "description": "当前工作单元" - }, - "idle": { - "description": "是否空闲", - "type": "boolean" - }, - "likelyStuck": { - "description": "是否可能卡住", - "type": "boolean" - }, - "number": { - "description": "执行器编号", - "type": "integer" - }, - "progress": { - "description": "进度", - "type": "integer" - } - } - }, - "model.JenkinsJob": { - "type": "object", - "properties": { - "_class": { - "description": "任务类型", - "type": "string" - }, - "actions": { - "description": "任务操作", - "type": "array", - "items": { - "$ref": "#/definitions/model.JobAction" - } - }, - "buildable": { - "description": "是否可构建", - "type": "boolean" - }, - "color": { - "description": "状态颜色(blue/red/yellow等)", - "type": "string" - }, - "description": { - "description": "任务描述", - "type": "string" - }, - "displayName": { - "description": "显示名称", - "type": "string" - }, - "lastBuild": { - "description": "最后一次构建", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsBuild" - } - ] - }, - "lastFailedBuild": { - "description": "最后一次失败构建", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsBuild" - } - ] - }, - "lastStableBuild": { - "description": "最后一次稳定构建", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsBuild" - } - ] - }, - "lastSuccessfulBuild": { - "description": "最后一次成功构建", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsBuild" - } - ] - }, - "name": { - "description": "任务名称", - "type": "string" - }, - "property": { - "description": "任务属性", - "type": "array", - "items": { - "$ref": "#/definitions/model.JobProperty" - } - }, - "url": { - "description": "任务URL", - "type": "string" - } - } - }, - "model.JenkinsJobDetailResponse": { - "type": "object", - "properties": { - "builds": { - "description": "构建历史", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsBuild" - } - }, - "job": { - "$ref": "#/definitions/model.JenkinsJob" - }, - "server": { - "description": "服务器名称", - "type": "string" - } - } - }, - "model.JenkinsJobListResponse": { - "type": "object", - "properties": { - "jobs": { - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsJob" - } - }, - "server": { - "description": "服务器名称", - "type": "string" - }, - "total": { - "type": "integer" - } - } - }, - "model.JenkinsLabel": { - "type": "object", - "properties": { - "name": { - "description": "标签名称", - "type": "string" - } - } - }, - "model.JenkinsLoadStatistics": { - "type": "object", - "properties": { - "busyExecutors": { - "description": "忙碌执行器数", - "type": "integer" - }, - "idleExecutors": { - "description": "空闲执行器数", - "type": "integer" - }, - "queueLength": { - "description": "队列长度", - "type": "integer" - }, - "totalExecutors": { - "description": "总执行器数", - "type": "integer" - } - } - }, - "model.JenkinsQueue": { - "type": "object", - "properties": { - "items": { - "description": "队列项目", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsQueueItem" - } - } - } - }, - "model.JenkinsQueueItem": { - "type": "object", - "properties": { - "actions": { - "description": "操作", - "type": "array", - "items": {} - }, - "blocked": { - "description": "是否阻塞", - "type": "boolean" - }, - "buildable": { - "description": "是否可构建", - "type": "boolean" - }, - "buildableStartMilliseconds": { - "description": "可构建开始时间", - "type": "integer" - }, - "id": { - "description": "队列项目ID", - "type": "integer" - }, - "inQueueSince": { - "description": "入队时间", - "type": "integer" - }, - "params": { - "description": "参数", - "type": "string" - }, - "stuck": { - "description": "是否卡住", - "type": "boolean" - }, - "task": { - "description": "任务信息", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsTask" - } - ] - }, - "url": { - "description": "URL", - "type": "string" - }, - "why": { - "description": "等待原因", - "type": "string" - } - } - }, - "model.JenkinsServerInfo": { - "type": "object", - "properties": { - "alias": { - "description": "别名(服务器名称)", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "description": { - "description": "描述(备注)", - "type": "string" - }, - "host": { - "description": "Jenkins服务器地址", - "type": "string" - }, - "id": { - "description": "账号ID", - "type": "integer" - }, - "port": { - "description": "端口", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.JenkinsServerListResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsServerInfo" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.JenkinsServerOption": { - "type": "object", - "properties": { - "id": { - "description": "服务器ID", - "type": "integer" - }, - "name": { - "description": "服务器名称(别名)", - "type": "string" - } - } - }, - "model.JenkinsSystemInfo": { - "type": "object", - "properties": { - "assignedLabels": { - "description": "分配的标签", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsLabel" - } - }, - "computers": { - "description": "计算机列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsComputer" - } - }, - "mode": { - "description": "运行模式", - "type": "string" - }, - "nodeDescription": { - "description": "节点描述", - "type": "string" - }, - "nodeName": { - "description": "节点名称", - "type": "string" - }, - "numExecutors": { - "description": "执行器数量", - "type": "integer" - }, - "overallLoad": { - "description": "总体负载", - "type": "object", - "additionalProperties": { - "type": "integer" - } - }, - "primaryView": { - "description": "主视图", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsView" - } - ] - }, - "unlabeledLoad": { - "description": "未标记负载", - "type": "object", - "additionalProperties": { - "type": "integer" - } - }, - "useCrumbs": { - "description": "是否使用CSRF保护", - "type": "boolean" - }, - "useSecurity": { - "description": "是否使用安全", - "type": "boolean" - }, - "version": { - "description": "Jenkins版本", - "type": "string" - }, - "views": { - "description": "视图列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsView" - } - } - } - }, - "model.JenkinsTask": { - "type": "object", - "properties": { - "color": { - "description": "任务颜色", - "type": "string" - }, - "name": { - "description": "任务名称", - "type": "string" - }, - "url": { - "description": "任务URL", - "type": "string" - } - } - }, - "model.JenkinsView": { - "type": "object", - "properties": { - "description": { - "description": "视图描述", - "type": "string" - }, - "jobs": { - "description": "视图中的任务", - "type": "array", - "items": { - "$ref": "#/definitions/model.JenkinsJob" - } - }, - "name": { - "description": "视图名称", - "type": "string" - }, - "url": { - "description": "视图URL", - "type": "string" - } - } - }, - "model.JobAction": { - "type": "object", - "properties": { - "_class": { - "description": "操作类型", - "type": "string" - } - } - }, - "model.JobProperty": { - "type": "object", - "properties": { - "_class": { - "description": "属性类型", - "type": "string" - } - } - }, - "model.K8sClusterStats": { - "type": "object", - "properties": { - "healthy": { - "description": "健康数量", - "type": "integer" - }, - "offline": { - "description": "离线数量", - "type": "integer" - }, - "total": { - "description": "集群总数", - "type": "integer" - } - } - }, - "model.K8sConfigMap": { - "type": "object", - "properties": { - "binaryData": { - "description": "二进制数据", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "createdTime": { - "description": "创建时间", - "type": "string" - }, - "data": { - "description": "数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "immutable": { - "description": "是否不可变", - "type": "boolean" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "ConfigMap名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - } - } - }, - "model.K8sEvent": { - "type": "object", - "properties": { - "count": { - "description": "发生次数", - "type": "integer" - }, - "firstTime": { - "description": "首次时间", - "type": "string" - }, - "lastTime": { - "description": "最后时间", - "type": "string" - }, - "message": { - "description": "消息", - "type": "string" - }, - "reason": { - "description": "原因", - "type": "string" - }, - "source": { - "description": "事件源", - "type": "string" - }, - "type": { - "description": "事件类型", - "type": "string" - } - } - }, - "model.K8sIngress": { - "type": "object", - "properties": { - "class": { - "description": "Ingress类/控制器类型", - "type": "string" - }, - "controllerName": { - "description": "Controller名称", - "type": "string" - }, - "controllerVersion": { - "description": "Controller版本", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "endpoints": { - "description": "访问端点", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "loadBalancer": { - "description": "负载均衡器信息", - "allOf": [ - { - "$ref": "#/definitions/model.IngressLoadBalancer" - } - ] - }, - "name": { - "description": "Ingress名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "rules": { - "description": "路由规则", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressRule" - } - }, - "status": { - "description": "状态", - "type": "string" - }, - "tls": { - "description": "TLS配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressTLS" - } - }, - "type": { - "description": "Ingress类型:公网Nginx/内网Nginx等", - "type": "string" - } - } - }, - "model.K8sNamespace": { - "type": "object", - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "limitRanges": { - "description": "默认资源限制列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.LimitRangeDetail" - } - }, - "name": { - "description": "命名空间名称", - "type": "string" - }, - "resourceCount": { - "description": "资源统计", - "allOf": [ - { - "$ref": "#/definitions/model.NamespaceResourceCount" - } - ] - }, - "resourceQuotas": { - "description": "资源配额列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.ResourceQuotaDetail" - } - }, - "status": { - "description": "状态 Active/Terminating", - "type": "string" - } - } - }, - "model.K8sNode": { - "type": "object", - "properties": { - "conditions": { - "description": "节点状态详细条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeCondition" - } - }, - "configuration": { - "description": "节点配置信息", - "allOf": [ - { - "$ref": "#/definitions/model.NodeConfiguration" - } - ] - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "externalIP": { - "description": "外部IP地址", - "type": "string" - }, - "internalIP": { - "description": "内部IP地址", - "type": "string" - }, - "name": { - "description": "节点名称", - "type": "string" - }, - "podMetrics": { - "description": "容器组统计", - "allOf": [ - { - "$ref": "#/definitions/model.PodMetrics" - } - ] - }, - "resources": { - "description": "CPU和内存资源", - "allOf": [ - { - "$ref": "#/definitions/model.NodeResources" - } - ] - }, - "roles": { - "description": "节点角色 control-plane,master 或 worker", - "type": "string" - }, - "runtime": { - "description": "运行时和版本信息", - "allOf": [ - { - "$ref": "#/definitions/model.RuntimeInfo" - } - ] - }, - "scheduling": { - "description": "调度相关信息(污点、是否可调度等)", - "allOf": [ - { - "$ref": "#/definitions/model.NodeSchedulingInfo" - } - ] - }, - "status": { - "description": "节点状态 Ready/NotReady", - "type": "string" - } - } - }, - "model.K8sNodeDetail": { - "type": "object", - "properties": { - "conditions": { - "description": "节点状态详细条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeCondition" - } - }, - "configuration": { - "description": "节点配置信息", - "allOf": [ - { - "$ref": "#/definitions/model.NodeConfiguration" - } - ] - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.EventInfo" - } - }, - "externalIP": { - "description": "外部IP地址", - "type": "string" - }, - "internalIP": { - "description": "内部IP地址", - "type": "string" - }, - "metrics": { - "description": "详细监控指标", - "allOf": [ - { - "$ref": "#/definitions/model.NodeMetrics" - } - ] - }, - "name": { - "description": "节点名称", - "type": "string" - }, - "podMetrics": { - "description": "容器组统计", - "allOf": [ - { - "$ref": "#/definitions/model.PodMetrics" - } - ] - }, - "pods": { - "description": "节点上运行的Pod列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.PodInfo" - } - }, - "resources": { - "description": "CPU和内存资源", - "allOf": [ - { - "$ref": "#/definitions/model.NodeResources" - } - ] - }, - "roles": { - "description": "节点角色 control-plane,master 或 worker", - "type": "string" - }, - "runtime": { - "description": "运行时和版本信息", - "allOf": [ - { - "$ref": "#/definitions/model.RuntimeInfo" - } - ] - }, - "scheduling": { - "description": "调度相关信息(污点、是否可调度等)", - "allOf": [ - { - "$ref": "#/definitions/model.NodeSchedulingInfo" - } - ] - }, - "status": { - "description": "节点状态 Ready/NotReady", - "type": "string" - } - } - }, - "model.K8sPersistentVolume": { - "type": "object", - "properties": { - "accessModes": { - "description": "访问模式", - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "description": "总量", - "type": "string" - }, - "claimRef": { - "description": "绑定存储声明", - "allOf": [ - { - "$ref": "#/definitions/model.PVClaimRef" - } - ] - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "PV名称", - "type": "string" - }, - "nodeAffinity": { - "description": "节点亲和性", - "allOf": [ - { - "$ref": "#/definitions/model.PVNodeAffinity" - } - ] - }, - "persistentVolumeSource": { - "description": "存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVSource" - } - ] - }, - "reclaimPolicy": { - "description": "回收策略 Retain/Delete/Recycle", - "type": "string" - }, - "status": { - "description": "状态 Available/Bound/Released/Failed", - "type": "string" - }, - "storageClass": { - "description": "存储类型", - "type": "string" - }, - "volumeMode": { - "description": "卷模式", - "type": "string" - } - } - }, - "model.K8sPersistentVolumeClaim": { - "type": "object", - "properties": { - "accessModes": { - "description": "访问模式", - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "description": "总量", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "PVC名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "status": { - "description": "状态 Pending/Bound/Lost", - "type": "string" - }, - "storageClass": { - "description": "存储类型", - "type": "string" - }, - "volumeMode": { - "description": "卷模式 Filesystem/Block", - "type": "string" - }, - "volumeName": { - "description": "关联的存储卷", - "type": "string" - } - } - }, - "model.K8sPodDetail": { - "type": "object", - "properties": { - "conditions": { - "description": "Pod状态条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.PodCondition" - } - }, - "containers": { - "description": "容器信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerInfo" - } - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "hostIP": { - "description": "主机IP", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "实例名称", - "type": "string" - }, - "nodeName": { - "description": "节点名称", - "type": "string" - }, - "phase": { - "description": "阶段", - "type": "string" - }, - "podIP": { - "description": "Pod IP", - "type": "string" - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadResources" - } - ] - }, - "restartCount": { - "description": "重启次数", - "type": "integer" - }, - "runningTime": { - "description": "运行时间", - "type": "string" - }, - "spec": { - "description": "完整规格配置" - }, - "status": { - "description": "状态", - "type": "string" - }, - "volumes": { - "description": "挂载卷信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.VolumeInfo" - } - } - } - }, - "model.K8sPodInfo": { - "type": "object", - "properties": { - "containers": { - "description": "容器信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerInfo" - } - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "hostIP": { - "description": "主机IP", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "实例名称", - "type": "string" - }, - "nodeName": { - "description": "节点名称", - "type": "string" - }, - "phase": { - "description": "阶段", - "type": "string" - }, - "podIP": { - "description": "Pod IP", - "type": "string" - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadResources" - } - ] - }, - "restartCount": { - "description": "重启次数", - "type": "integer" - }, - "runningTime": { - "description": "运行时间", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - } - } - }, - "model.K8sSecret": { - "type": "object", - "properties": { - "createdTime": { - "description": "创建时间", - "type": "string" - }, - "data": { - "description": "数据(base64编码)", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "immutable": { - "description": "是否不可变", - "type": "boolean" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "Secret名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "stringData": { - "description": "字符串数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "Secret类型", - "type": "string" - } - } - }, - "model.K8sService": { - "type": "object", - "properties": { - "clusterIP": { - "description": "集群IP", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "endpoints": { - "description": "端点信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServiceEndpoint" - } - }, - "externalIPs": { - "description": "外部IP列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "服务名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "ports": { - "description": "端口配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServicePort" - } - }, - "selector": { - "description": "选择器", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "服务类型 ClusterIP/NodePort/LoadBalancer/ExternalName", - "type": "string" - } - } - }, - "model.K8sStorageClass": { - "type": "object", - "properties": { - "allowVolumeExpansion": { - "description": "允许卷扩展", - "type": "boolean" - }, - "allowedTopologies": { - "description": "允许的拓扑", - "type": "array", - "items": { - "$ref": "#/definitions/model.StorageClassTopology" - } - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "存储类名称", - "type": "string" - }, - "parameters": { - "description": "参数", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "provisioner": { - "description": "提供者", - "type": "string" - }, - "reclaimPolicy": { - "description": "回收策略", - "type": "string" - }, - "volumeBindingMode": { - "description": "卷绑定模式", - "type": "string" - } - } - }, - "model.K8sWorkload": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "images": { - "description": "镜像列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "readyReplicas": { - "description": "就绪副本数", - "type": "integer" - }, - "replicas": { - "description": "副本数", - "type": "integer" - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadResources" - } - ] - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "类型", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadType" - } - ] - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - } - } - }, - "model.K8sWorkloadDetail": { - "type": "object", - "properties": { - "conditions": { - "description": "状态条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.WorkloadCondition" - } - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "images": { - "description": "镜像列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "pods": { - "description": "Pod列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sPodInfo" - } - }, - "readyReplicas": { - "description": "就绪副本数", - "type": "integer" - }, - "replicas": { - "description": "副本数", - "type": "integer" - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadResources" - } - ] - }, - "spec": { - "description": "完整规格配置" - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "类型", - "allOf": [ - { - "$ref": "#/definitions/model.WorkloadType" - } - ] - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - } - } - }, - "model.KeyManage": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "id": { - "type": "integer" - }, - "keyId": { - "description": "密钥ID(加密存储)", - "type": "string" - }, - "keySecret": { - "description": "密钥Secret(加密存储)", - "type": "string" - }, - "keyType": { - "description": "云厂商类型:1=阿里云,2=腾讯云,3=百度云,4=华为云,5=AWS云", - "type": "integer" - }, - "remark": { - "description": "备注信息", - "type": "string" - }, - "updatedAt": { - "description": "更新时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - } - } - }, - "model.KubeCluster": { - "type": "object", - "properties": { - "clusterType": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "credential": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "lastSyncAt": { - "type": "string" - }, - "masterNodes": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "nodeCount": { - "type": "integer" - }, - "readyNodes": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - }, - "version": { - "type": "string" - }, - "workerNodes": { - "type": "integer" - } - } - }, - "model.KubeClusterListResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/model.KubeCluster" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.LimitRangeDetail": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "limits": { - "description": "限制项列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.LimitRangeItem" - } - }, - "name": { - "description": "LimitRange名称", - "type": "string" - } - } - }, - "model.LimitRangeItem": { - "type": "object", - "properties": { - "default": { - "description": "默认值", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "defaultRequest": { - "description": "默认请求值", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "max": { - "description": "最大限制", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "maxLimitRequestRatio": { - "description": "最大限制与请求比率", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "min": { - "description": "最小限制", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "限制类型 Container/Pod/PersistentVolumeClaim", - "type": "string" - } - } - }, - "model.LimitRangeListResponse": { - "type": "object", - "properties": { - "limitRanges": { - "type": "array", - "items": { - "$ref": "#/definitions/model.LimitRangeDetail" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.LimitRangeRequestSpec": { - "type": "object", - "required": [ - "limits" - ], - "properties": { - "limits": { - "description": "限制项列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.LimitRangeItem" - } - } - } - }, - "model.LoginDto": { - "type": "object", - "required": [ - "idKey", - "image", - "password", - "username" - ], - "properties": { - "idKey": { - "description": "uuid", - "type": "string" - }, - "image": { - "description": "验证码", - "type": "string", - "maxLength": 6, - "minLength": 4 - }, - "password": { - "description": "密码", - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.MonitoringInfo": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU监控", - "allOf": [ - { - "$ref": "#/definitions/model.ClusterResourceMetrics" - } - ] - }, - "memory": { - "description": "内存监控", - "allOf": [ - { - "$ref": "#/definitions/model.ClusterResourceMetrics" - } - ] - }, - "network": { - "description": "网络监控", - "allOf": [ - { - "$ref": "#/definitions/model.NetworkMetrics" - } - ] - }, - "storage": { - "description": "存储监控", - "allOf": [ - { - "$ref": "#/definitions/model.StorageMetrics" - } - ] - } - } - }, - "model.NamespaceListResponse": { - "type": "object", - "properties": { - "namespaces": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sNamespace" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.NamespaceMetricsInfo": { - "type": "object", - "properties": { - "namespace": { - "description": "命名空间名称", - "type": "string" - }, - "podCount": { - "description": "Pod总数", - "type": "integer" - }, - "podMetrics": { - "description": "Pod监控列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.PodMetricsSummary" - } - }, - "resourceQuota": { - "description": "命名空间资源配额", - "allOf": [ - { - "$ref": "#/definitions/model.NamespaceResourceQuota" - } - ] - }, - "runningPods": { - "description": "运行中的Pod数", - "type": "integer" - }, - "timestamp": { - "description": "采集时间", - "type": "string" - }, - "totalUsage": { - "description": "总资源使用量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "usageRate": { - "description": "资源使用率", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsageRate" - } - ] - } - } - }, - "model.NamespaceResourceCount": { - "type": "object", - "properties": { - "configMapCount": { - "description": "ConfigMap数量", - "type": "integer" - }, - "podCount": { - "description": "Pod数量", - "type": "integer" - }, - "secretCount": { - "description": "Secret数量", - "type": "integer" - }, - "serviceCount": { - "description": "Service数量", - "type": "integer" - } - } - }, - "model.NamespaceResourceQuota": { - "type": "object", - "properties": { - "hard": { - "description": "硬限制", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "used": { - "description": "已使用", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - } - } - }, - "model.NetworkInfo": { - "type": "object", - "properties": { - "apiServerEndpoint": { - "description": "API Server内网端点", - "type": "string" - }, - "dnsService": { - "description": "DNS服务", - "type": "string" - }, - "networkPlugin": { - "description": "网络插件", - "type": "string" - }, - "podCIDR": { - "description": "Pod CIDR", - "type": "string" - }, - "proxyMode": { - "description": "服务转发模式", - "type": "string" - }, - "serviceCIDR": { - "description": "Service CIDR", - "type": "string" - } - } - }, - "model.NetworkMetrics": { - "type": "object", - "properties": { - "inboundTraffic": { - "description": "入站流量", - "type": "string" - }, - "outboundTraffic": { - "description": "出站流量", - "type": "string" - }, - "packetsIn": { - "description": "入站包数", - "type": "integer" - }, - "packetsOut": { - "description": "出站包数", - "type": "integer" - } - } - }, - "model.NodeCondition": { - "type": "object", - "properties": { - "reason": { - "type": "string" - }, - "status": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "model.NodeConfig": { - "type": "object", - "required": [ - "etcdHostIds", - "masterHostIds" - ], - "properties": { - "etcdHostIds": { - "description": "ETCD节点主机ID", - "type": "array", - "items": { - "type": "integer" - } - }, - "masterHostIds": { - "description": "Master节点主机ID", - "type": "array", - "items": { - "type": "integer" - } - }, - "workerHostIds": { - "description": "Worker节点主机ID", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.NodeConfiguration": { - "type": "object", - "properties": { - "annotations": { - "description": "节点注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "architecture": { - "description": "系统架构", - "type": "string" - }, - "kernelVersion": { - "description": "内核版本", - "type": "string" - }, - "labels": { - "description": "节点标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "osImage": { - "description": "操作系统镜像", - "type": "string" - }, - "role": { - "description": "节点角色 master/worker", - "type": "string" - } - } - }, - "model.NodeDetailResponse": { - "type": "object", - "properties": { - "allocatable": { - "description": "可分配资源", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "architecture": { - "description": "架构", - "type": "string" - }, - "bootID": { - "description": "启动ID", - "type": "string" - }, - "capacity": { - "description": "资源信息", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "conditions": { - "description": "状态条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeCondition" - } - }, - "containerRuntimeVersion": { - "description": "容器运行时版本", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "externalIP": { - "description": "外部IP", - "type": "string" - }, - "hostname": { - "description": "主机名", - "type": "string" - }, - "internalIP": { - "description": "IP地址信息", - "type": "string" - }, - "kernelVersion": { - "description": "内核版本", - "type": "string" - }, - "kubeProxyVersion": { - "description": "Kube-Proxy版本", - "type": "string" - }, - "kubeletVersion": { - "description": "K8s组件版本", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "machineID": { - "description": "机器ID", - "type": "string" - }, - "monitoring": { - "description": "监控信息", - "allOf": [ - { - "$ref": "#/definitions/model.NodeMonitoringInfo" - } - ] - }, - "name": { - "description": "基本信息", - "type": "string" - }, - "operatingSystem": { - "description": "操作系统", - "type": "string" - }, - "osImage": { - "description": "系统信息", - "type": "string" - }, - "podCIDR": { - "description": "CIDR信息", - "type": "string" - }, - "podCIDRs": { - "description": "容器组CIDR列表", - "type": "array", - "items": { - "type": "string" - } - }, - "podInfo": { - "description": "Pod信息", - "allOf": [ - { - "$ref": "#/definitions/model.NodePodInfo" - } - ] - }, - "podList": { - "description": "节点上的Pod列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodePodDetail" - } - }, - "providerID": { - "description": "提供者ID", - "type": "string" - }, - "status": { - "description": "状态信息", - "type": "string" - }, - "systemUUID": { - "description": "系统UUID", - "type": "string" - }, - "taints": { - "description": "污点列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeTaint" - } - }, - "uid": { - "description": "UID", - "type": "string" - }, - "unschedulable": { - "description": "调度信息", - "type": "boolean" - } - } - }, - "model.NodeInfo": { - "type": "object", - "properties": { - "allocatable": { - "description": "可分配资源", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "capacity": { - "description": "CPU、内存等资源容量", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "conditions": { - "description": "节点状态条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeCondition" - } - }, - "externalIP": { - "type": "string" - }, - "internalIP": { - "type": "string" - }, - "name": { - "type": "string" - }, - "os": { - "type": "string" - }, - "role": { - "description": "master/worker/etcd", - "type": "string" - }, - "status": { - "description": "Ready/NotReady", - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "model.NodeMetrics": { - "type": "object", - "properties": { - "cpuUsagePercentage": { - "type": "number" - }, - "diskUsagePercentage": { - "type": "number" - }, - "memoryUsagePercentage": { - "type": "number" - }, - "networkInBytes": { - "type": "integer" - }, - "networkOutBytes": { - "type": "integer" - } - } - }, - "model.NodeMetricsInfo": { - "type": "object", - "properties": { - "allocatable": { - "description": "可分配量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "capacity": { - "description": "总容量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "nodeName": { - "description": "节点名称", - "type": "string" - }, - "podCount": { - "description": "Pod数量", - "type": "integer" - }, - "podMetrics": { - "description": "Pod监控摘要", - "type": "array", - "items": { - "$ref": "#/definitions/model.PodMetricsSummary" - } - }, - "systemInfo": { - "description": "系统信息", - "allOf": [ - { - "$ref": "#/definitions/model.NodeSystemInfo" - } - ] - }, - "timestamp": { - "description": "采集时间", - "type": "string" - }, - "usage": { - "description": "资源使用量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "usageRate": { - "description": "使用率", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsageRate" - } - ] - } - } - }, - "model.NodeMonitoringInfo": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU使用情况", - "allOf": [ - { - "$ref": "#/definitions/model.NodeResourceUsage" - } - ] - }, - "memory": { - "description": "内存使用情况", - "allOf": [ - { - "$ref": "#/definitions/model.NodeResourceUsage" - } - ] - }, - "network": { - "description": "网络使用情况", - "allOf": [ - { - "$ref": "#/definitions/model.NodeNetworkUsage" - } - ] - }, - "storage": { - "description": "存储使用情况", - "allOf": [ - { - "$ref": "#/definitions/model.NodeResourceUsage" - } - ] - } - } - }, - "model.NodeNetworkUsage": { - "type": "object", - "properties": { - "inboundBytes": { - "description": "入站字节数", - "type": "integer" - }, - "inboundPackets": { - "description": "入站包数", - "type": "integer" - }, - "outboundBytes": { - "description": "出站字节数", - "type": "integer" - }, - "outboundPackets": { - "description": "出站包数", - "type": "integer" - } - } - }, - "model.NodePodDetail": { - "type": "object", - "properties": { - "containers": { - "description": "容器状态", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerStatus" - } - }, - "cpuLimits": { - "description": "CPU限制", - "type": "string" - }, - "cpuRequests": { - "description": "CPU请求", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "memoryLimits": { - "description": "内存限制", - "type": "string" - }, - "memoryRequests": { - "description": "内存请求", - "type": "string" - }, - "name": { - "description": "Pod名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "phase": { - "description": "阶段", - "type": "string" - }, - "restartCount": { - "description": "重启次数", - "type": "integer" - }, - "status": { - "description": "状态", - "type": "string" - } - } - }, - "model.NodePodInfo": { - "type": "object", - "properties": { - "failedPods": { - "description": "失败的Pod数", - "type": "integer" - }, - "pendingPods": { - "description": "等待中的Pod数", - "type": "integer" - }, - "runningPods": { - "description": "运行中的Pod数", - "type": "integer" - }, - "succeededPods": { - "description": "成功的Pod数", - "type": "integer" - }, - "totalPods": { - "description": "Pod总数", - "type": "integer" - } - } - }, - "model.NodeResourceAllocation": { - "type": "object", - "properties": { - "allocatable": { - "description": "可分配资源", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "allocated": { - "description": "已分配资源", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "capacity": { - "description": "节点总容量", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "nodeName": { - "type": "string" - }, - "podList": { - "description": "Pod资源使用详情", - "type": "array", - "items": { - "$ref": "#/definitions/model.PodResourceInfo" - } - } - } - }, - "model.NodeResourceUsage": { - "type": "object", - "properties": { - "available": { - "description": "可用量", - "type": "string" - }, - "limits": { - "description": "限制量", - "type": "string" - }, - "requestRate": { - "description": "请求率 (0-100)", - "type": "number" - }, - "requests": { - "description": "请求量", - "type": "string" - }, - "total": { - "description": "总量", - "type": "string" - }, - "usageRate": { - "description": "使用率 (0-100)", - "type": "number" - }, - "used": { - "description": "已使用", - "type": "string" - } - } - }, - "model.NodeResources": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU资源", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceInfo" - } - ] - }, - "memory": { - "description": "内存资源", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceInfo" - } - ] - } - } - }, - "model.NodeSchedulingInfo": { - "type": "object", - "properties": { - "taints": { - "description": "节点污点", - "type": "array", - "items": { - "$ref": "#/definitions/model.NodeTaint" - } - }, - "unschedulable": { - "description": "是否不可调度", - "type": "boolean" - } - } - }, - "model.NodeSystemInfo": { - "type": "object", - "properties": { - "architecture": { - "description": "系统架构", - "type": "string" - }, - "containerRuntimeVersion": { - "description": "容器运行时版本", - "type": "string" - }, - "kernelVersion": { - "description": "内核版本", - "type": "string" - }, - "kubeProxyVersion": { - "description": "KubeProxy版本", - "type": "string" - }, - "kubeletVersion": { - "description": "Kubelet版本", - "type": "string" - }, - "osImage": { - "description": "操作系统镜像", - "type": "string" - } - } - }, - "model.NodeTaint": { - "type": "object", - "properties": { - "effect": { - "description": "NoSchedule, PreferNoSchedule, NoExecute", - "type": "string" - }, - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "model.OtherResources": { - "type": "object", - "properties": { - "kafka": { - "type": "array", - "items": { - "type": "string" - } - }, - "other": { - "type": "array", - "items": { - "type": "string" - } - }, - "rabbitmq": { - "type": "array", - "items": { - "type": "string" - } - }, - "redis": { - "type": "array", - "items": { - "type": "string" - } - }, - "zookeeper": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.PVAWSElasticBlockStoreVolumeSource": { - "type": "object", - "properties": { - "fsType": { - "description": "文件系统类型", - "type": "string" - }, - "partition": { - "description": "分区", - "type": "integer" - }, - "readOnly": { - "description": "只读", - "type": "boolean" - }, - "volumeID": { - "description": "卷ID", - "type": "string" - } - } - }, - "model.PVCDetail": { - "type": "object", - "properties": { - "accessModes": { - "description": "访问模式", - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "description": "总量", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "PVC名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "spec": { - "description": "完整规格配置" - }, - "status": { - "description": "状态 Pending/Bound/Lost", - "type": "string" - }, - "storageClass": { - "description": "存储类型", - "type": "string" - }, - "volumeMode": { - "description": "卷模式 Filesystem/Block", - "type": "string" - }, - "volumeName": { - "description": "关联的存储卷", - "type": "string" - } - } - }, - "model.PVCListResponse": { - "type": "object", - "properties": { - "pvcs": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sPersistentVolumeClaim" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.PVCMatchExp": { - "type": "object", - "properties": { - "key": { - "description": "键", - "type": "string" - }, - "operator": { - "description": "操作符", - "type": "string" - }, - "values": { - "description": "值", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.PVCResourcesSpec": { - "type": "object", - "required": [ - "requests" - ], - "properties": { - "limits": { - "description": "资源限制", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "requests": { - "description": "资源请求", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.PVCSIVolumeSource": { - "type": "object", - "properties": { - "driver": { - "description": "驱动名称", - "type": "string" - }, - "fsType": { - "description": "文件系统类型", - "type": "string" - }, - "readOnly": { - "description": "只读", - "type": "boolean" - }, - "volumeAttributes": { - "description": "卷属性", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "volumeHandle": { - "description": "卷句柄", - "type": "string" - } - } - }, - "model.PVCSelectorSpec": { - "type": "object", - "properties": { - "matchExpressions": { - "description": "匹配表达式", - "type": "array", - "items": { - "$ref": "#/definitions/model.PVCMatchExp" - } - }, - "matchLabels": { - "description": "匹配标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.PVClaimRef": { - "type": "object", - "properties": { - "apiVersion": { - "description": "API版本", - "type": "string" - }, - "kind": { - "description": "类型", - "type": "string" - }, - "name": { - "description": "名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "uid": { - "description": "UID", - "type": "string" - } - } - }, - "model.PVDetail": { - "type": "object", - "properties": { - "accessModes": { - "description": "访问模式", - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "description": "总量", - "type": "string" - }, - "claimRef": { - "description": "绑定存储声明", - "allOf": [ - { - "$ref": "#/definitions/model.PVClaimRef" - } - ] - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "PV名称", - "type": "string" - }, - "nodeAffinity": { - "description": "节点亲和性", - "allOf": [ - { - "$ref": "#/definitions/model.PVNodeAffinity" - } - ] - }, - "persistentVolumeSource": { - "description": "存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVSource" - } - ] - }, - "reclaimPolicy": { - "description": "回收策略 Retain/Delete/Recycle", - "type": "string" - }, - "spec": { - "description": "完整规格配置" - }, - "status": { - "description": "状态 Available/Bound/Released/Failed", - "type": "string" - }, - "storageClass": { - "description": "存储类型", - "type": "string" - }, - "volumeMode": { - "description": "卷模式", - "type": "string" - } - } - }, - "model.PVHostPathVolumeSource": { - "type": "object", - "properties": { - "path": { - "description": "主机路径", - "type": "string" - }, - "type": { - "description": "类型", - "type": "string" - } - } - }, - "model.PVISCSIVolumeSource": { - "type": "object", - "properties": { - "fsType": { - "description": "文件系统类型", - "type": "string" - }, - "iqn": { - "description": "IQN", - "type": "string" - }, - "iscsiInterface": { - "description": "iSCSI接口", - "type": "string" - }, - "lun": { - "description": "LUN", - "type": "integer" - }, - "portals": { - "description": "门户列表", - "type": "array", - "items": { - "type": "string" - } - }, - "readOnly": { - "description": "只读", - "type": "boolean" - }, - "targetPortal": { - "description": "目标门户", - "type": "string" - } - } - }, - "model.PVListResponse": { - "type": "object", - "properties": { - "pvs": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sPersistentVolume" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.PVLocalVolumeSource": { - "type": "object", - "properties": { - "fsType": { - "description": "文件系统类型", - "type": "string" - }, - "path": { - "description": "本地路径", - "type": "string" - } - } - }, - "model.PVNFSVolumeSource": { - "type": "object", - "properties": { - "path": { - "description": "NFS路径", - "type": "string" - }, - "readOnly": { - "description": "只读", - "type": "boolean" - }, - "server": { - "description": "NFS服务器", - "type": "string" - } - } - }, - "model.PVNodeAffinity": { - "type": "object", - "properties": { - "required": { - "description": "必需的节点选择器", - "allOf": [ - { - "$ref": "#/definitions/model.PVNodeSelector" - } - ] - } - } - }, - "model.PVNodeSelector": { - "type": "object", - "properties": { - "nodeSelectorTerms": { - "description": "节点选择器条件", - "type": "array", - "items": { - "$ref": "#/definitions/model.PVNodeSelectorTerm" - } - } - } - }, - "model.PVNodeSelectorRequirement": { - "type": "object", - "properties": { - "key": { - "description": "键", - "type": "string" - }, - "operator": { - "description": "操作符", - "type": "string" - }, - "values": { - "description": "值", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.PVNodeSelectorTerm": { - "type": "object", - "properties": { - "matchExpressions": { - "description": "匹配表达式", - "type": "array", - "items": { - "$ref": "#/definitions/model.PVNodeSelectorRequirement" - } - }, - "matchFields": { - "description": "匹配字段", - "type": "array", - "items": { - "$ref": "#/definitions/model.PVNodeSelectorRequirement" - } - } - } - }, - "model.PVSource": { - "type": "object", - "properties": { - "awsElasticBlockStore": { - "description": "AWS EBS", - "allOf": [ - { - "$ref": "#/definitions/model.PVAWSElasticBlockStoreVolumeSource" - } - ] - }, - "csi": { - "description": "CSI存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVCSIVolumeSource" - } - ] - }, - "hostPath": { - "description": "HostPath存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVHostPathVolumeSource" - } - ] - }, - "iscsi": { - "description": "iSCSI存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVISCSIVolumeSource" - } - ] - }, - "local": { - "description": "Local存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVLocalVolumeSource" - } - ] - }, - "nfs": { - "description": "NFS存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVNFSVolumeSource" - } - ] - } - } - }, - "model.PVSourceSpec": { - "type": "object", - "properties": { - "awsElasticBlockStore": { - "description": "AWS EBS", - "allOf": [ - { - "$ref": "#/definitions/model.PVAWSElasticBlockStoreVolumeSource" - } - ] - }, - "csi": { - "description": "CSI存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVCSIVolumeSource" - } - ] - }, - "hostPath": { - "description": "HostPath存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVHostPathVolumeSource" - } - ] - }, - "iscsi": { - "description": "iSCSI存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVISCSIVolumeSource" - } - ] - }, - "local": { - "description": "Local存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVLocalVolumeSource" - } - ] - }, - "nfs": { - "description": "NFS存储源", - "allOf": [ - { - "$ref": "#/definitions/model.PVNFSVolumeSource" - } - ] - } - } - }, - "model.PauseDeploymentResponse": { - "type": "object", - "properties": { - "deploymentName": { - "description": "Deployment名称", - "type": "string" - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "status": { - "description": "当前状态", - "type": "string" - }, - "success": { - "description": "是否暂停成功", - "type": "boolean" - } - } - }, - "model.PodCondition": { - "type": "object", - "properties": { - "lastTransitionTime": { - "description": "最后转换时间", - "type": "string" - }, - "message": { - "description": "消息", - "type": "string" - }, - "reason": { - "description": "原因", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "条件类型", - "type": "string" - } - } - }, - "model.PodInfo": { - "type": "object", - "properties": { - "cpuUsage": { - "type": "string" - }, - "memUsage": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, - "model.PodMetrics": { - "type": "object", - "properties": { - "allocated": { - "description": "已分配的Pod数量", - "type": "integer" - }, - "total": { - "description": "总的Pod容量", - "type": "integer" - } - } - }, - "model.PodMetricsInfo": { - "type": "object", - "properties": { - "containers": { - "description": "容器监控信息列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerMetricsInfo" - } - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "nodeName": { - "description": "节点名称", - "type": "string" - }, - "podName": { - "description": "Pod名称", - "type": "string" - }, - "resourceQuota": { - "description": "资源配额信息", - "allOf": [ - { - "$ref": "#/definitions/model.PodResourceQuota" - } - ] - }, - "timestamp": { - "description": "采集时间", - "type": "string" - }, - "totalUsage": { - "description": "总使用量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "usageRate": { - "description": "使用率信息", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsageRate" - } - ] - } - } - }, - "model.PodMetricsSummary": { - "type": "object", - "properties": { - "namespace": { - "description": "命名空间", - "type": "string" - }, - "podName": { - "description": "Pod名称", - "type": "string" - }, - "usage": { - "description": "资源使用量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "usageRate": { - "description": "使用率", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsageRate" - } - ] - } - } - }, - "model.PodResourceInfo": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "requests": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.PodResourceQuota": { - "type": "object", - "properties": { - "limits": { - "description": "资源限制量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - }, - "requests": { - "description": "资源请求量", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceUsage" - } - ] - } - } - }, - "model.PodTemplateSpec": { - "type": "object", - "required": [ - "containers" - ], - "properties": { - "containers": { - "description": "容器规格", - "type": "array", - "items": { - "$ref": "#/definitions/model.ContainerSpec" - } - }, - "labels": { - "description": "Pod标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "nodeSelector": { - "description": "节点选择器", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "tolerations": { - "description": "容忍度", - "type": "array", - "items": { - "$ref": "#/definitions/model.Toleration" - } - }, - "volumes": { - "description": "存储卷规格", - "type": "array", - "items": { - "$ref": "#/definitions/model.VolumeSpec" - } - } - } - }, - "model.QuickDeployment": { - "type": "object", - "properties": { - "business_dept_id": { - "description": "业务部门ID", - "type": "integer" - }, - "business_group_id": { - "description": "业务组ID", - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "creator_id": { - "description": "创建人ID", - "type": "integer" - }, - "creator_name": { - "description": "创建人姓名", - "type": "string" - }, - "description": { - "description": "发布描述", - "type": "string" - }, - "duration": { - "description": "发布耗时(秒)", - "type": "integer" - }, - "end_time": { - "description": "结束发布时间", - "type": "string" - }, - "execution_mode": { - "description": "执行模式: 1=并行 2=串行", - "type": "integer" - }, - "id": { - "type": "integer" - }, - "start_time": { - "description": "开始发布时间", - "type": "string" - }, - "status": { - "description": "发布状态: 1=待发布 2=发布中 3=发布成功 4=发布失败 5=已取消", - "type": "integer" - }, - "task_count": { - "description": "任务数量,记录用户提交的发布任务数量", - "type": "integer" - }, - "tasks": { - "description": "关联的发布任务", - "type": "array", - "items": { - "$ref": "#/definitions/model.QuickDeploymentTask" - } - }, - "title": { - "description": "发布标题", - "type": "string" - }, - "updated_at": { - "type": "string" - } - } - }, - "model.QuickDeploymentAppRequest": { - "type": "object", - "required": [ - "app_id", - "environment" - ], - "properties": { - "app_id": { - "description": "应用ID(按数组顺序执行)", - "type": "integer" - }, - "environment": { - "description": "应用发布环境", - "type": "string" - } - } - }, - "model.QuickDeploymentListResponse": { - "type": "object", - "properties": { - "list": { - "description": "列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.QuickDeployment" - } - }, - "total": { - "description": "总数", - "type": "integer" - } - } - }, - "model.QuickDeploymentTask": { - "type": "object", - "properties": { - "app_code": { - "description": "应用编码", - "type": "string" - }, - "app_id": { - "description": "应用ID", - "type": "integer" - }, - "app_name": { - "description": "应用名称", - "type": "string" - }, - "application": { - "description": "关联", - "allOf": [ - { - "$ref": "#/definitions/model.Application" - } - ] - }, - "build_number": { - "description": "构建编号", - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "deployment_id": { - "description": "发布ID", - "type": "integer" - }, - "duration": { - "description": "任务耗时(秒)", - "type": "integer" - }, - "end_time": { - "description": "任务结束时间", - "type": "string" - }, - "environment": { - "description": "环境名称", - "type": "string" - }, - "error_message": { - "description": "错误信息", - "type": "string" - }, - "execute_order": { - "description": "执行顺序", - "type": "integer" - }, - "id": { - "type": "integer" - }, - "jenkins_env": { - "$ref": "#/definitions/model.JenkinsEnv" - }, - "jenkins_env_id": { - "description": "Jenkins环境配置ID", - "type": "integer" - }, - "jenkins_job_url": { - "description": "Jenkins任务URL", - "type": "string" - }, - "log_url": { - "description": "日志URL", - "type": "string" - }, - "start_time": { - "description": "任务开始时间", - "type": "string" - }, - "status": { - "description": "任务状态: 1=未部署 2=部署中 3=成功 4=异常", - "type": "integer" - }, - "updated_at": { - "type": "string" - } - } - }, - "model.QuotaInfo": { - "type": "object", - "properties": { - "hard": { - "description": "限制值", - "type": "string" - }, - "used": { - "description": "已使用值", - "type": "string" - } - } - }, - "model.RegistryConfig": { - "type": "object", - "properties": { - "privateRegistry": { - "description": "私有镜像仓库地址", - "type": "string" - }, - "registryPassword": { - "description": "镜像仓库密码", - "type": "string" - }, - "registryUsername": { - "description": "镜像仓库用户名", - "type": "string" - }, - "usePrivateRegistry": { - "description": "是否使用私有仓库", - "type": "boolean" - } - } - }, - "model.RemoveLabelRequest": { - "type": "object", - "required": [ - "key" - ], - "properties": { - "key": { - "type": "string" - } - } - }, - "model.RemoveTaintRequest": { - "type": "object", - "required": [ - "key" - ], - "properties": { - "effect": { - "type": "string" - }, - "key": { - "type": "string" - } - } - }, - "model.ReplicaSetInfo": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "name": { - "description": "ReplicaSet名称", - "type": "string" - }, - "readyReplicas": { - "description": "就绪副本数", - "type": "integer" - }, - "replicas": { - "description": "副本数", - "type": "integer" - }, - "revision": { - "description": "版本号", - "type": "integer" - }, - "status": { - "description": "状态", - "type": "string" - } - } - }, - "model.ReplicasSummary": { - "type": "object", - "properties": { - "available": { - "description": "可用副本数", - "type": "integer" - }, - "current": { - "description": "当前副本数", - "type": "integer" - }, - "desired": { - "description": "期望副本数", - "type": "integer" - }, - "ready": { - "description": "就绪副本数", - "type": "integer" - }, - "updated": { - "description": "已更新副本数", - "type": "integer" - } - } - }, - "model.ResetSysAdminPasswordDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "password": { - "description": "密码", - "type": "string" - } - } - }, - "model.ResourceInfo": { - "type": "object", - "properties": { - "allocatable": { - "description": "可分配量", - "type": "string" - }, - "capacity": { - "description": "总容量", - "type": "string" - }, - "requests": { - "description": "请求量", - "type": "string" - }, - "usage": { - "description": "使用量", - "type": "string" - } - } - }, - "model.ResourceQuotaDetail": { - "type": "object", - "properties": { - "cpuQuota": { - "description": "CPU配额详情", - "allOf": [ - { - "$ref": "#/definitions/model.QuotaInfo" - } - ] - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "hard": { - "description": "硬限制", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "memoryQuota": { - "description": "内存配额详情", - "allOf": [ - { - "$ref": "#/definitions/model.QuotaInfo" - } - ] - }, - "name": { - "description": "ResourceQuota名称", - "type": "string" - }, - "storageQuota": { - "description": "存储配额详情", - "allOf": [ - { - "$ref": "#/definitions/model.QuotaInfo" - } - ] - }, - "used": { - "description": "已使用", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.ResourceQuotaListResponse": { - "type": "object", - "properties": { - "resourceQuotas": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ResourceQuotaDetail" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.ResourceSpec": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU", - "type": "string" - }, - "memory": { - "description": "内存", - "type": "string" - } - } - }, - "model.ResourceUsage": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU使用量 (如: \"100m\", \"1.5\")", - "type": "string" - }, - "memory": { - "description": "内存使用量 (如: \"128Mi\", \"1Gi\")", - "type": "string" - } - } - }, - "model.ResourceUsageRate": { - "type": "object", - "properties": { - "cpuRate": { - "description": "CPU使用率 (百分比: 0-100)", - "type": "number" - }, - "memoryRate": { - "description": "内存使用率 (百分比: 0-100)", - "type": "number" - } - } - }, - "model.ResumeDeploymentResponse": { - "type": "object", - "properties": { - "deploymentName": { - "description": "Deployment名称", - "type": "string" - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "status": { - "description": "当前状态", - "type": "string" - }, - "success": { - "description": "是否恢复成功", - "type": "boolean" - } - } - }, - "model.RoleMenu": { - "type": "object", - "required": [ - "id", - "menuIds" - ], - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "menuIds": { - "description": "菜单id列表", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.RollbackDeploymentRequest": { - "type": "object", - "properties": { - "toRevision": { - "description": "目标版本号,0表示回滚到上一版本", - "type": "integer" - } - } - }, - "model.RollbackDeploymentResponse": { - "type": "object", - "properties": { - "deploymentName": { - "description": "Deployment名称", - "type": "string" - }, - "fromRevision": { - "description": "回滚前版本号", - "type": "integer" - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "rolloutStatus": { - "description": "滚动发布状态", - "type": "string" - }, - "success": { - "description": "是否回滚成功", - "type": "boolean" - }, - "toRevision": { - "description": "回滚后版本号", - "type": "integer" - } - } - }, - "model.RollingUpdateDeployment": { - "type": "object", - "properties": { - "maxSurge": { - "description": "最大激增数量", - "type": "string" - }, - "maxUnavailable": { - "description": "最大不可用数量", - "type": "string" - } - } - }, - "model.RuntimeInfo": { - "type": "object", - "properties": { - "containerRuntimeVersion": { - "description": "容器运行时版本", - "type": "string" - }, - "kubeProxyVersion": { - "description": "KubeProxy版本", - "type": "string" - }, - "kubeletVersion": { - "description": "Kubelet版本", - "type": "string" - }, - "operatingSystem": { - "description": "操作系统", - "type": "string" - }, - "osImage": { - "description": "操作系统镜像", - "type": "string" - } - } - }, - "model.RuntimeSummary": { - "type": "object", - "properties": { - "apiServerVersion": { - "description": "API Server版本", - "type": "string" - }, - "containerRuntime": { - "description": "容器运行时", - "type": "string" - }, - "coreDNSVersion": { - "description": "CoreDNS版本", - "type": "string" - }, - "etcdVersion": { - "description": "etcd版本", - "type": "string" - }, - "kubeProxyVersion": { - "description": "kube-proxy版本", - "type": "string" - }, - "kubernetesVersion": { - "description": "Kubernetes版本", - "type": "string" - }, - "upTime": { - "description": "集群运行时间", - "type": "string" - } - } - }, - "model.ScaleWorkloadRequest": { - "type": "object", - "required": [ - "replicas" - ], - "properties": { - "replicas": { - "description": "目标副本数", - "type": "integer" - } - } - }, - "model.SecretDetail": { - "type": "object", - "properties": { - "createdTime": { - "description": "创建时间", - "type": "string" - }, - "data": { - "description": "数据(base64编码)", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "immutable": { - "description": "是否不可变", - "type": "boolean" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "Secret名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "spec": { - "description": "完整规格配置" - }, - "stringData": { - "description": "字符串数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "Secret类型", - "type": "string" - }, - "usage": { - "description": "使用情况(哪些Pod在使用)", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.SecretListResponse": { - "type": "object", - "properties": { - "secrets": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sSecret" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.ServiceDetail": { - "type": "object", - "properties": { - "clusterIP": { - "description": "集群IP", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "endpoints": { - "description": "端点信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServiceEndpoint" - } - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "externalIPs": { - "description": "外部IP列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "服务名称", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "pods": { - "description": "关联的Pod列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sPodInfo" - } - }, - "ports": { - "description": "端口配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServicePort" - } - }, - "selector": { - "description": "选择器", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "spec": { - "description": "完整规格配置" - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "服务类型 ClusterIP/NodePort/LoadBalancer/ExternalName", - "type": "string" - } - } - }, - "model.ServiceEndpoint": { - "type": "object", - "properties": { - "hostname": { - "description": "主机名", - "type": "string" - }, - "ip": { - "description": "端点IP", - "type": "string" - }, - "nodeName": { - "description": "节点名称", - "type": "string" - }, - "ports": { - "description": "端口信息", - "type": "array", - "items": { - "$ref": "#/definitions/model.EndpointPort" - } - }, - "ready": { - "description": "就绪状态", - "type": "boolean" - } - } - }, - "model.ServiceJenkinsEnv": { - "type": "object", - "properties": { - "env_name": { - "description": "环境名称", - "type": "string" - }, - "id": { - "description": "环境配置ID", - "type": "integer" - }, - "is_configured": { - "description": "是否已配置完整", - "type": "boolean" - }, - "jenkins_server_id": { - "description": "Jenkins服务器ID", - "type": "integer" - }, - "job_name": { - "description": "Jenkins任务名称", - "type": "string" - } - } - }, - "model.ServiceListResponse": { - "type": "object", - "properties": { - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sService" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.ServicePort": { - "type": "object", - "properties": { - "name": { - "description": "端口名称", - "type": "string" - }, - "nodePort": { - "description": "节点端口(NodePort类型时使用)", - "type": "integer" - }, - "port": { - "description": "服务端口", - "type": "integer" - }, - "protocol": { - "description": "协议 TCP/UDP", - "type": "string" - }, - "targetPort": { - "description": "目标端口", - "type": "string" - } - } - }, - "model.ServicePortSpec": { - "type": "object", - "required": [ - "port", - "protocol" - ], - "properties": { - "name": { - "description": "端口名称", - "type": "string" - }, - "nodePort": { - "description": "节点端口(NodePort类型时使用)", - "type": "integer" - }, - "port": { - "description": "服务端口", - "type": "integer" - }, - "protocol": { - "description": "协议", - "type": "string" - }, - "targetPort": { - "description": "目标端口", - "type": "string" - } - } - }, - "model.ServiceStats": { - "type": "object", - "properties": { - "businessLines": { - "description": "业务线数量", - "type": "integer" - }, - "total": { - "description": "服务总数", - "type": "integer" - } - } - }, - "model.ServiceTreeNode": { - "type": "object", - "properties": { - "business_dept_id": { - "description": "业务部门ID", - "type": "integer" - }, - "business_dept_name": { - "description": "业务部门名称", - "type": "string" - }, - "code": { - "description": "应用编码", - "type": "string" - }, - "created_at": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "应用ID", - "type": "integer" - }, - "jenkins_envs": { - "description": "Jenkins环境配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServiceJenkinsEnv" - } - }, - "name": { - "description": "应用名称", - "type": "string" - }, - "programming_lang": { - "description": "编程语言", - "type": "string" - }, - "status": { - "description": "应用状态", - "type": "integer" - }, - "status_text": { - "description": "状态文本", - "type": "string" - } - } - }, - "model.StartJobRequest": { - "type": "object", - "properties": { - "parameters": { - "description": "构建参数", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "reason": { - "description": "构建原因", - "type": "string" - } - } - }, - "model.StartJobResponse": { - "type": "object", - "properties": { - "buildNumber": { - "description": "构建编号(如果已知)", - "type": "integer" - }, - "jobName": { - "description": "任务名称", - "type": "string" - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "queueId": { - "description": "队列ID", - "type": "integer" - }, - "server": { - "description": "服务器名称", - "type": "string" - }, - "success": { - "description": "是否启动成功", - "type": "boolean" - } - } - }, - "model.StopBuildRequest": { - "type": "object", - "properties": { - "reason": { - "description": "停止原因", - "type": "string" - } - } - }, - "model.StopBuildResponse": { - "type": "object", - "properties": { - "buildNumber": { - "description": "构建编号", - "type": "integer" - }, - "jobName": { - "description": "任务名称", - "type": "string" - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "server": { - "description": "服务器名称", - "type": "string" - }, - "success": { - "description": "是否停止成功", - "type": "boolean" - } - } - }, - "model.StorageClassDetail": { - "type": "object", - "properties": { - "allowVolumeExpansion": { - "description": "允许卷扩展", - "type": "boolean" - }, - "allowedTopologies": { - "description": "允许的拓扑", - "type": "array", - "items": { - "$ref": "#/definitions/model.StorageClassTopology" - } - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "events": { - "description": "相关事件", - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sEvent" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "description": "存储类名称", - "type": "string" - }, - "parameters": { - "description": "参数", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "provisioner": { - "description": "提供者", - "type": "string" - }, - "reclaimPolicy": { - "description": "回收策略", - "type": "string" - }, - "spec": { - "description": "完整规格配置" - }, - "volumeBindingMode": { - "description": "卷绑定模式", - "type": "string" - } - } - }, - "model.StorageClassListResponse": { - "type": "object", - "properties": { - "storageClasses": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sStorageClass" - } - }, - "total": { - "type": "integer" - } - } - }, - "model.StorageClassTopology": { - "type": "object", - "properties": { - "matchLabelExpressions": { - "description": "匹配标签表达式", - "type": "array", - "items": { - "$ref": "#/definitions/model.StorageClassTopologyExp" - } - } - } - }, - "model.StorageClassTopologyExp": { - "type": "object", - "properties": { - "key": { - "description": "键", - "type": "string" - }, - "values": { - "description": "值", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.StorageMetrics": { - "type": "object", - "properties": { - "boundPVs": { - "description": "已绑定PV数", - "type": "integer" - }, - "storageClasses": { - "description": "存储类列表", - "type": "array", - "items": { - "type": "string" - } - }, - "totalPVCs": { - "description": "PVC总数", - "type": "integer" - }, - "totalPVs": { - "description": "PV总数", - "type": "integer" - } - } - }, - "model.SyncSchedule": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "cronExpr": { - "description": "cron表达式", - "type": "string" - }, - "id": { - "type": "integer" - }, - "keyTypes": { - "description": "要同步的云厂商类型(JSON数组格式:[1,2,3])", - "type": "string" - }, - "lastRunTime": { - "description": "上次执行时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "nextRunTime": { - "description": "下次执行时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "remark": { - "description": "备注信息", - "type": "string" - }, - "status": { - "description": "状态:1=启用,0=禁用", - "type": "integer" - }, - "syncLog": { - "description": "最近一次同步日志", - "type": "string" - }, - "updatedAt": { - "description": "更新时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - } - } - }, - "model.SysAdminIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.SysDept": { - "type": "object", - "properties": { - "children": { - "description": "子集", - "type": "array", - "items": { - "$ref": "#/definitions/model.SysDept" - } - }, - "createTime": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "deptName": { - "description": "部门名称", - "type": "string" - }, - "deptStatus": { - "description": "部门状态(1-\u003e正常 2-\u003e停用)", - "type": "integer" - }, - "deptType": { - "description": "部门类型(1-\u003e公司, 2-\u003e中心,3-\u003e部门)", - "type": "integer" - }, - "id": { - "description": "ID", - "type": "integer" - }, - "parentId": { - "description": "父id", - "type": "integer" - } - } - }, - "model.SysDeptIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.SysLoginInfoIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.SysMenu": { - "type": "object", - "properties": { - "children": { - "description": "子集", - "type": "array", - "items": { - "$ref": "#/definitions/model.SysMenu" - } - }, - "createTime": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "icon": { - "description": "菜单图标", - "type": "string" - }, - "id": { - "description": "ID", - "type": "integer" - }, - "menuName": { - "description": "菜单名称", - "type": "string" - }, - "menuStatus": { - "description": "启用状态;1-\u003e禁用;2-\u003e启用", - "type": "integer" - }, - "menuType": { - "description": "菜单类型:1-\u003e目录;2-\u003e菜单;3-\u003e按钮", - "type": "integer" - }, - "parentId": { - "description": "父菜单id", - "type": "integer" - }, - "sort": { - "description": "排序", - "type": "integer" - }, - "url": { - "description": "菜单url", - "type": "string" - }, - "value": { - "description": "权限值", - "type": "string" - } - } - }, - "model.SysMenuIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.SysOperationLogIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.SysPost": { - "type": "object", - "properties": { - "createTime": { - "description": "创建时间", - "allOf": [ - { - "$ref": "#/definitions/util.HTime" - } - ] - }, - "id": { - "description": "ID", - "type": "integer" - }, - "postCode": { - "description": "岗位编码", - "type": "string" - }, - "postName": { - "description": "岗位名称", - "type": "string" - }, - "postStatus": { - "description": "状态(1-\u003e正常 2-\u003e停用)", - "type": "integer" - }, - "remark": { - "description": "备注", - "type": "string" - } - } - }, - "model.SysPostIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.SysRoleIdDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - } - } - }, - "model.Task": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "cron_expr": { - "type": "string" - }, - "duration": { - "type": "integer" - }, - "end_time": { - "type": "string" - }, - "execute_count": { - "type": "integer" - }, - "host_ids": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "next_run_time": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "shell": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "task_count": { - "type": "integer" - }, - "tasklog": { - "type": "string" - }, - "type": { - "type": "integer" - } - } - }, - "model.TaskAnsible": { - "type": "object", - "properties": { - "allHostIDs": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "errorMsg": { - "type": "string" - }, - "gitRepo": { - "type": "string" - }, - "globalVars": { - "type": "string" - }, - "hostGroups": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "taskCount": { - "type": "integer" - }, - "totalDuration": { - "type": "integer" - }, - "type": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - }, - "works": { - "type": "array", - "items": { - "$ref": "#/definitions/model.TaskAnsibleWork" - } - } - } - }, - "model.TaskAnsibleWork": { - "type": "object", - "properties": { - "duration": { - "type": "integer" - }, - "endTime": { - "type": "string" - }, - "entryFileName": { - "type": "string" - }, - "entryFilePath": { - "type": "string" - }, - "errorMsg": { - "type": "string" - }, - "exitCode": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "logPath": { - "type": "string" - }, - "startTime": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "task": { - "$ref": "#/definitions/model.TaskAnsible" - }, - "taskID": { - "type": "integer" - } - } - }, - "model.TaskIDRequest": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - } - } - }, - "model.TaskStats": { - "type": "object", - "properties": { - "failed": { - "description": "失败次数", - "type": "integer" - }, - "success": { - "description": "成功次数", - "type": "integer" - }, - "successRate": { - "description": "成功率", - "type": "number" - }, - "total": { - "description": "任务执行总次数", - "type": "integer" - } - } - }, - "model.TaskStatusResponse": { - "type": "object", - "properties": { - "app_code": { - "description": "应用编码", - "type": "string" - }, - "app_name": { - "description": "应用名称", - "type": "string" - }, - "build_number": { - "description": "构建编号", - "type": "integer" - }, - "duration": { - "description": "耗时(秒)", - "type": "integer" - }, - "end_time": { - "description": "结束时间", - "type": "string" - }, - "environment": { - "description": "环境名称", - "type": "string" - }, - "error_message": { - "description": "错误信息", - "type": "string" - }, - "log_url": { - "description": "日志URL", - "type": "string" - }, - "progress": { - "description": "进度百分比(0-100)", - "type": "integer" - }, - "start_time": { - "description": "开始时间", - "type": "string" - }, - "status": { - "description": "任务状态: 1=未部署 2=部署中 3=成功 4=异常", - "type": "integer" - }, - "status_text": { - "description": "状态文本", - "type": "string" - }, - "task_id": { - "description": "任务ID", - "type": "integer" - } - } - }, - "model.TaskTemplate": { - "type": "object", - "properties": { - "content": { - "description": "任务内容", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "createdBy": { - "description": "创建人", - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "description": "任务名称", - "type": "string" - }, - "remark": { - "description": "备注信息", - "type": "string" - }, - "type": { - "description": "1=shell模板, 2=python模板, 3=ansible模板", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - }, - "updatedBy": { - "description": "更新人", - "type": "string" - } - } - }, - "model.TestJenkinsConnectionRequest": { - "type": "object", - "required": [ - "password", - "url", - "username" - ], - "properties": { - "password": { - "description": "密码或API Token", - "type": "string" - }, - "url": { - "description": "Jenkins服务器地址", - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.TestJenkinsConnectionResponse": { - "type": "object", - "properties": { - "error": { - "description": "错误信息", - "type": "string" - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "success": { - "description": "是否连接成功", - "type": "boolean" - }, - "systemInfo": { - "description": "系统信息", - "allOf": [ - { - "$ref": "#/definitions/model.JenkinsSystemInfo" - } - ] - } - } - }, - "model.Toleration": { - "type": "object", - "properties": { - "effect": { - "description": "效果", - "type": "string" - }, - "key": { - "description": "键", - "type": "string" - }, - "operator": { - "description": "操作符", - "type": "string" - }, - "value": { - "description": "值", - "type": "string" - } - } - }, - "model.UpdateApplicationRequest": { - "type": "object", - "properties": { - "business_dept_id": { - "description": "业务部门ID", - "type": "integer" - }, - "business_group_id": { - "description": "业务组ID", - "type": "integer" - }, - "databases": { - "description": "关联数据库ID", - "type": "array", - "items": { - "type": "integer" - } - }, - "description": { - "description": "应用介绍", - "type": "string" - }, - "dev_owners": { - "description": "负责人信息", - "type": "array", - "items": { - "type": "integer" - } - }, - "domains": { - "description": "关联资源", - "type": "array", - "items": { - "type": "string" - } - }, - "health_api": { - "description": "健康检查接口", - "type": "string" - }, - "hosts": { - "description": "关联主机ID", - "type": "array", - "items": { - "type": "integer" - } - }, - "jenkins_envs": { - "description": "Jenkins环境配置(可选,如果提供则完全替换现有配置)", - "type": "array", - "items": { - "$ref": "#/definitions/model.UpdateJenkinsEnvRequest" - } - }, - "name": { - "description": "应用名称", - "type": "string" - }, - "ops_owners": { - "description": "运维负责人ID数组", - "type": "array", - "items": { - "type": "integer" - } - }, - "other_res": { - "description": "其他资源", - "allOf": [ - { - "$ref": "#/definitions/model.OtherResources" - } - ] - }, - "programming_lang": { - "description": "技术信息", - "type": "string" - }, - "repo_url": { - "description": "仓库地址", - "type": "string" - }, - "start_command": { - "description": "启动命令", - "type": "string" - }, - "status": { - "description": "状态", - "type": "integer" - }, - "stop_command": { - "description": "停止命令", - "type": "string" - }, - "test_owners": { - "description": "测试负责人ID数组", - "type": "array", - "items": { - "type": "integer" - } - } - } - }, - "model.UpdateCmdbHostDto": { - "type": "object", - "required": [ - "groupId", - "hostName", - "sshIp", - "sshKeyId", - "sshName" - ], - "properties": { - "groupId": { - "description": "主机分组ID", - "type": "integer" - }, - "hostName": { - "description": "主机名称(唯一标识)", - "type": "string" - }, - "id": { - "description": "主机ID", - "type": "integer" - }, - "remark": { - "description": "备注信息(可选)", - "type": "string" - }, - "sshIp": { - "description": "SSH连接IP(公网或私网IP)", - "type": "string" - }, - "sshKeyId": { - "description": "SSH凭据ID(从ecsAuth表获取)", - "type": "integer" - }, - "sshName": { - "description": "SSH登录用户名", - "type": "string" - }, - "sshPort": { - "description": "SSH端口(默认22)", - "type": "integer" - }, - "vendor": { - "description": "厂商类型:1-\u003e自建,2-\u003e阿里云,3-\u003e腾讯云", - "type": "integer" - } - } - }, - "model.UpdateConfigMapRequest": { - "type": "object", - "properties": { - "binaryData": { - "description": "二进制数据", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "data": { - "description": "数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.UpdateEcsAuthDto": { - "type": "object", - "required": [ - "name", - "password", - "port", - "type", - "username" - ], - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "name": { - "description": "凭证名称", - "type": "string" - }, - "password": { - "description": "密码", - "type": "string" - }, - "port": { - "description": "端口号", - "type": "integer" - }, - "publicKey": { - "description": "公钥", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "type": { - "description": "认证类型:1-\u003e密码", - "type": "integer" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.UpdateIngressRequest": { - "type": "object", - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "class": { - "description": "Ingress类", - "type": "string" - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "rules": { - "description": "路由规则", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressRuleSpec" - } - }, - "tls": { - "description": "TLS配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.IngressTLSSpec" - } - } - } - }, - "model.UpdateJenkinsEnvRequest": { - "type": "object", - "properties": { - "env_name": { - "description": "环境名称", - "type": "string" - }, - "id": { - "description": "环境配置ID(可选,不提供则创建新的)", - "type": "integer" - }, - "jenkins_server_id": { - "description": "Jenkins服务器ID(关联account_auth表)", - "type": "integer" - }, - "job_name": { - "description": "Jenkins任务名称", - "type": "string" - } - } - }, - "model.UpdateKeyManageDto": { - "type": "object", - "required": [ - "id", - "keyId", - "keySecret", - "keyType" - ], - "properties": { - "id": { - "description": "密钥ID", - "type": "integer" - }, - "keyId": { - "description": "密钥ID", - "type": "string" - }, - "keySecret": { - "description": "密钥Secret", - "type": "string" - }, - "keyType": { - "description": "云厂商类型:1=阿里云,2=腾讯云,3=百度云,4=华为云,5=AWS云", - "type": "integer" - }, - "remark": { - "description": "备注信息", - "type": "string" - } - } - }, - "model.UpdateKubeClusterRequest": { - "type": "object", - "properties": { - "credential": { - "description": "K8s凭证(kubeconfig内容)", - "type": "string" - }, - "description": { - "description": "集群描述", - "type": "string" - }, - "name": { - "description": "集群名称", - "type": "string" - }, - "version": { - "description": "集群版本(可选,同步时会自动更新)", - "type": "string" - } - } - }, - "model.UpdateLimitRangeRequest": { - "type": "object", - "required": [ - "spec" - ], - "properties": { - "spec": { - "description": "LimitRange规格", - "allOf": [ - { - "$ref": "#/definitions/model.LimitRangeRequestSpec" - } - ] - } - } - }, - "model.UpdateNamespaceRequest": { - "type": "object", - "properties": { - "annotations": { - "description": "注释", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.UpdatePVCRequest": { - "type": "object", - "properties": { - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "resources": { - "description": "资源配置", - "allOf": [ - { - "$ref": "#/definitions/model.PVCResourcesSpec" - } - ] - } - } - }, - "model.UpdatePVRequest": { - "type": "object", - "properties": { - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "reclaimPolicy": { - "description": "回收策略", - "type": "string" - } - } - }, - "model.UpdatePersonalDto": { - "type": "object", - "required": [ - "email", - "nickname", - "note", - "phone", - "username" - ], - "properties": { - "email": { - "description": "邮箱", - "type": "string" - }, - "icon": { - "description": "头像", - "type": "string" - }, - "id": { - "description": "ID", - "type": "integer" - }, - "nickname": { - "description": "昵称", - "type": "string" - }, - "note": { - "description": "备注", - "type": "string" - }, - "phone": { - "description": "电话", - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.UpdatePersonalPasswordDto": { - "type": "object", - "required": [ - "newPassword", - "password", - "resetPassword" - ], - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "newPassword": { - "description": "新密码", - "type": "string" - }, - "password": { - "description": "密码", - "type": "string" - }, - "resetPassword": { - "description": "重复密码", - "type": "string" - } - } - }, - "model.UpdatePodYAMLRequest": { - "type": "object", - "required": [ - "yamlContent" - ], - "properties": { - "dryRun": { - "description": "是否只进行校验不实际更新", - "type": "boolean" - }, - "force": { - "description": "是否强制更新(删除重建)", - "type": "boolean" - }, - "validateOnly": { - "description": "是否只校验YAML格式", - "type": "boolean" - }, - "yamlContent": { - "description": "YAML内容", - "type": "string" - } - } - }, - "model.UpdatePodYAMLResponse": { - "type": "object", - "properties": { - "changes": { - "description": "变更说明", - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "Pod所在的命名空间", - "type": "string" - }, - "podName": { - "description": "更新的Pod名称", - "type": "string" - }, - "success": { - "description": "是否更新成功", - "type": "boolean" - }, - "updateStrategy": { - "description": "更新策略 (patch/recreate)", - "type": "string" - }, - "validationResult": { - "description": "校验结果(DryRun时返回)", - "allOf": [ - { - "$ref": "#/definitions/model.ValidateYAMLResponse" - } - ] - }, - "warnings": { - "description": "警告信息", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.UpdateResourceQuotaRequest": { - "type": "object", - "required": [ - "hard" - ], - "properties": { - "hard": { - "description": "硬限制", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "scopeSelector": { - "description": "作用域选择器", - "type": "object", - "additionalProperties": true - }, - "scopes": { - "description": "作用域", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.UpdateSecretRequest": { - "type": "object", - "properties": { - "data": { - "description": "数据(base64编码)", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "stringData": { - "description": "字符串数据", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.UpdateServiceRequest": { - "type": "object", - "properties": { - "externalIPs": { - "description": "外部IP列表", - "type": "array", - "items": { - "type": "string" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "ports": { - "description": "端口配置", - "type": "array", - "items": { - "$ref": "#/definitions/model.ServicePortSpec" - } - }, - "selector": { - "description": "选择器", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "服务类型", - "type": "string" - } - } - }, - "model.UpdateStorageClassRequest": { - "type": "object", - "properties": { - "allowVolumeExpansion": { - "description": "允许卷扩展", - "type": "boolean" - }, - "allowedTopologies": { - "description": "允许的拓扑", - "type": "array", - "items": { - "$ref": "#/definitions/model.StorageClassTopology" - } - }, - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mountOptions": { - "description": "挂载选项", - "type": "array", - "items": { - "type": "string" - } - }, - "parameters": { - "description": "参数", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "model.UpdateSyncScheduleDto": { - "type": "object", - "required": [ - "cronExpr", - "id", - "keyTypes", - "name" - ], - "properties": { - "cronExpr": { - "description": "cron表达式", - "type": "string" - }, - "id": { - "description": "配置ID", - "type": "integer" - }, - "keyTypes": { - "description": "要同步的云厂商类型(JSON数组格式:[1,2,3])", - "type": "string" - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "remark": { - "description": "备注信息", - "type": "string" - }, - "status": { - "description": "状态:1=启用,0=禁用", - "type": "integer" - } - } - }, - "model.UpdateSysAdminDto": { - "type": "object", - "properties": { - "deptId": { - "description": "部门id", - "type": "integer" - }, - "email": { - "description": "邮箱", - "type": "string" - }, - "id": { - "description": "ID", - "type": "integer" - }, - "nickname": { - "description": "昵称", - "type": "string" - }, - "note": { - "description": "备注", - "type": "string" - }, - "phone": { - "description": "手机号", - "type": "string" - }, - "postId": { - "description": "岗位id", - "type": "integer" - }, - "roleId": { - "description": "角色id", - "type": "integer" - }, - "status": { - "description": "状态:1-\u003e启用,2-\u003e禁用", - "type": "integer" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, - "model.UpdateSysAdminStatusDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "status": { - "description": "状态:1-\u003e启用,2-\u003e禁用", - "type": "integer" - } - } - }, - "model.UpdateSysPostStatusDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "postStatus": { - "description": "状态(1-\u003e正常 2-\u003e停用)", - "type": "integer" - } - } - }, - "model.UpdateSysRoleDto": { - "type": "object", - "properties": { - "description": { - "description": "描述", - "type": "string" - }, - "id": { - "description": "Id", - "type": "integer" - }, - "roleKey": { - "description": "角色key", - "type": "string" - }, - "roleName": { - "description": "角色名称", - "type": "string" - }, - "status": { - "description": "状态:1-\u003e启用,2-\u003e禁用", - "type": "integer" - } - } - }, - "model.UpdateSysRoleStatusDto": { - "type": "object", - "properties": { - "id": { - "description": "ID", - "type": "integer" - }, - "status": { - "description": "状态:1-\u003e启用,2-\u003e禁用", - "type": "integer" - } - } - }, - "model.UpdateToolDto": { - "type": "object", - "required": [ - "id", - "link", - "title" - ], - "properties": { - "icon": { - "description": "导航图标", - "type": "string" - }, - "id": { - "description": "ID", - "type": "integer" - }, - "link": { - "description": "链接地址", - "type": "string", - "maxLength": 500 - }, - "sort": { - "description": "排序", - "type": "integer" - }, - "title": { - "description": "导航标题", - "type": "string", - "maxLength": 100, - "minLength": 1 - } - } - }, - "model.UpdateWorkloadRequest": { - "type": "object", - "properties": { - "labels": { - "description": "标签", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "strategy": { - "description": "部署策略" - }, - "template": { - "description": "Pod模板", - "allOf": [ - { - "$ref": "#/definitions/model.PodTemplateSpec" - } - ] - } - } - }, - "model.UpdateWorkloadYAMLRequest": { - "type": "object", - "required": [ - "workloadName", - "workloadType", - "yamlContent" - ], - "properties": { - "dryRun": { - "description": "是否只进行校验不实际更新", - "type": "boolean" - }, - "force": { - "description": "是否强制更新", - "type": "boolean" - }, - "validateOnly": { - "description": "是否只校验YAML格式", - "type": "boolean" - }, - "workloadName": { - "description": "工作负载名称", - "type": "string" - }, - "workloadType": { - "description": "工作负载类型: deployment,statefulset,daemonset,job,cronjob", - "type": "string" - }, - "yamlContent": { - "description": "YAML内容", - "type": "string" - } - } - }, - "model.UpdateWorkloadYAMLResponse": { - "type": "object", - "properties": { - "appliedAt": { - "description": "应用时间", - "type": "string" - }, - "changes": { - "description": "变更说明", - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "description": "响应消息", - "type": "string" - }, - "namespace": { - "description": "命名空间", - "type": "string" - }, - "success": { - "description": "是否更新成功", - "type": "boolean" - }, - "updateStrategy": { - "description": "更新策略 (patch/update/rolling)", - "type": "string" - }, - "validationResult": { - "description": "校验结果(DryRun时返回)", - "allOf": [ - { - "$ref": "#/definitions/model.ValidateYAMLResponse" - } - ] - }, - "warnings": { - "description": "警告信息", - "type": "array", - "items": { - "type": "string" - } - }, - "workloadName": { - "description": "工作负载名称", - "type": "string" - }, - "workloadType": { - "description": "工作负载类型", - "type": "string" - } - } - }, - "model.User": { - "type": "object", - "properties": { - "absoluteUrl": { - "description": "绝对URL", - "type": "string" - }, - "fullName": { - "description": "全名", - "type": "string" - } - } - }, - "model.ValidateJenkinsJobRequest": { - "type": "object", - "required": [ - "jenkins_server_id", - "job_name" - ], - "properties": { - "jenkins_server_id": { - "description": "Jenkins服务器ID", - "type": "integer" - }, - "job_name": { - "description": "任务名称", - "type": "string" - } - } - }, - "model.ValidateJenkinsJobResponse": { - "type": "object", - "properties": { - "exists": { - "description": "任务是否存在", - "type": "boolean" - }, - "job_name": { - "description": "任务名称", - "type": "string" - }, - "job_url": { - "description": "任务URL(如果存在)", - "type": "string" - }, - "message": { - "description": "验证消息", - "type": "string" - }, - "server_id": { - "description": "服务器ID", - "type": "integer" - } - } - }, - "model.ValidateYAMLRequest": { - "type": "object", - "required": [ - "yamlContent" - ], - "properties": { - "resourceType": { - "description": "资源类型,如pod、deployment等", - "type": "string" - }, - "yamlContent": { - "description": "YAML内容", - "type": "string" - } - } - }, - "model.ValidateYAMLResponse": { - "type": "object", - "properties": { - "errors": { - "description": "错误列表", - "type": "array", - "items": { - "type": "string" - } - }, - "parsedObject": { - "description": "解析后的对象", - "type": "object", - "additionalProperties": true - }, - "suggestions": { - "description": "建议列表", - "type": "array", - "items": { - "type": "string" - } - }, - "valid": { - "description": "是否有效", - "type": "boolean" - }, - "warnings": { - "description": "警告列表", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "model.VolumeInfo": { - "type": "object", - "properties": { - "mountPath": { - "description": "挂载路径", - "type": "string" - }, - "name": { - "description": "卷名称", - "type": "string" - }, - "readOnly": { - "description": "只读状态", - "type": "boolean" - }, - "type": { - "description": "卷类型", - "type": "string" - } - } - }, - "model.VolumeMount": { - "type": "object", - "required": [ - "mountPath", - "name" - ], - "properties": { - "mountPath": { - "description": "挂载路径", - "type": "string" - }, - "name": { - "description": "卷名称", - "type": "string" - }, - "readOnly": { - "description": "只读模式", - "type": "boolean" - } - } - }, - "model.VolumeSpec": { - "type": "object", - "required": [ - "name", - "type" - ], - "properties": { - "config": { - "description": "卷配置", - "type": "object", - "additionalProperties": true - }, - "name": { - "description": "卷名称", - "type": "string" - }, - "type": { - "description": "卷类型", - "type": "string" - } - } - }, - "model.WorkloadCondition": { - "type": "object", - "properties": { - "lastTransitionTime": { - "description": "最后转换时间", - "type": "string" - }, - "message": { - "description": "消息", - "type": "string" - }, - "reason": { - "description": "原因", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "type": { - "description": "条件类型", - "type": "string" - } - } - }, - "model.WorkloadListResponse": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "workloads": { - "type": "array", - "items": { - "$ref": "#/definitions/model.K8sWorkload" - } - } - } - }, - "model.WorkloadResources": { - "type": "object", - "properties": { - "limits": { - "description": "资源限制", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceSpec" - } - ] - }, - "requests": { - "description": "资源请求", - "allOf": [ - { - "$ref": "#/definitions/model.ResourceSpec" - } - ] - } - } - }, - "model.WorkloadSummary": { - "type": "object", - "properties": { - "runningPods": { - "description": "运行中的Pod数", - "type": "integer" - }, - "totalCronJobs": { - "description": "CronJob总数", - "type": "integer" - }, - "totalDaemonSets": { - "description": "DaemonSet总数", - "type": "integer" - }, - "totalDeployments": { - "description": "Deployment总数", - "type": "integer" - }, - "totalJobs": { - "description": "Job总数", - "type": "integer" - }, - "totalPods": { - "description": "Pod总数", - "type": "integer" - }, - "totalStatefulSets": { - "description": "StatefulSet总数", - "type": "integer" - } - } - }, - "model.WorkloadType": { - "type": "string", - "enum": [ - "Deployment", - "StatefulSet", - "DaemonSet", - "Job", - "CronJob", - "Pod" - ], - "x-enum-varnames": [ - "WorkloadTypeDeployment", - "WorkloadTypeStatefulSet", - "WorkloadTypeDaemonSet", - "WorkloadTypeJob", - "WorkloadTypeCronJob", - "WorkloadTypePod" - ] - }, - "result.PageResult": { - "type": "object", - "properties": { - "list": { - "description": "数据列表" - }, - "page": { - "description": "当前页码", - "type": "integer" - }, - "pageSize": { - "description": "每页数量", - "type": "integer" - }, - "total": { - "description": "总记录数", - "type": "integer" - } - } - }, - "result.Result": { - "type": "object", - "properties": { - "code": { - "description": "状态码", - "type": "integer" - }, - "data": { - "description": "返回的数据" - }, - "message": { - "description": "提示信息", - "type": "string" - } - } - }, - "util.HTime": { - "type": "object", - "properties": { - "time.Time": { - "type": "string" - } - } - } - }, + "paths": {` + docscmdb.CmdbPaths + "," + docsconfigcenter.ConfigcenterPaths + "," + docsdashboard.DashboardPaths + "," + docsk8s.K8sPaths + "," + docsmonitor.MonitorPaths + "," + docssystem.SystemPaths + "," + docstask.TaskPaths + "," + docstool.ToolPaths + `}, + "definitions": {` + docsapp.AppDefinitions + "," + docscmdb.CmdbDefinitions + "," + docsconfigcenter.ConfigcenterDefinitions + "," + docsdashboard.DashboardDefinitions + "," + docsk8s.K8sDefinitions + "," + docsmonitor.MonitorDefinitions + "," + docssystem.SystemDefinitions + "," + docstask.TaskDefinitions + "," + docstool.ToolDefinitions + `}, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } - } + } }` // SwaggerInfo holds exported Swagger Info so clients can modify it diff --git a/dodevops-api/docs/k8s/k8s_docs.go b/dodevops-api/docs/k8s/k8s_docs.go new file mode 100644 index 0000000..2916d24 --- /dev/null +++ b/dodevops-api/docs/k8s/k8s_docs.go @@ -0,0 +1,6972 @@ +package docsk8s + +const K8sPaths = ` + "/api/v1/k8s/cluster": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页获取K8s集群列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "获取K8s集群列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页数量", + "name": "size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KubeClusterListResponse" + } + } + } + ] + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建K8s集群,可选择是否自动部署", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "创建K8s集群", + "parameters": [ + { + "description": "集群创建参数", + "name": "cluster", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateKubeClusterRequest" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KubeCluster" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据集群ID获取集群详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "获取K8s集群详情", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KubeCluster" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新集群的基本信息(名称、描述、kubeconfig等)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "更新K8s集群信息", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "集群更新参数", + "name": "cluster", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateKubeClusterRequest" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KubeCluster" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定的K8s集群(只能删除已停止的集群)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "删除K8s集群", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误或集群状态不允许删除", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取集群的完整详细信息,包括节点、工作负载、组件、网络配置、监控信息等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "获取K8s集群详细信息", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ClusterDetailResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/events": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取整个集群的事件列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s事件管理" + ], + "summary": "获取集群事件列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 100, + "description": "限制返回数量", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.EventListResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定集群的所有命名空间信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "获取K8s命名空间列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.NamespaceListResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "在指定集群中创建新的命名空间", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "创建K8s命名空间", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "命名空间信息", + "name": "namespace", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateNamespaceRequest" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sNamespace" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定命名空间的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "获取K8s命名空间详情", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sNamespace" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新指定命名空间的标签和注释", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "更新K8s命名空间", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "更新信息", + "name": "namespace", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateNamespaceRequest" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sNamespace" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定的命名空间(会同时删除其中的所有资源)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "删除K8s命名空间", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/events": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定命名空间的事件列表,支持按资源类型和名称过滤", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s事件管理" + ], + "summary": "获取K8s事件列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "enum": [ + "Pod", + "Deployment", + "StatefulSet", + "DaemonSet", + "Service" + ], + "type": "string", + "description": "资源类型", + "name": "kind", + "in": "query" + }, + { + "type": "string", + "description": "资源名称", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "default": 100, + "description": "限制返回数量", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.EventListResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/limitranges": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定命名空间的所有默认资源限制", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "获取默认资源限制列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.LimitRangeListResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "为指定命名空间创建默认资源限制", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "创建默认资源限制", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "默认资源限制信息", + "name": "limitrange", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateLimitRangeRequest" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.LimitRangeDetail" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/limitranges/{limitRangeName}": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新指定的默认资源限制", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "更新默认资源限制", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "LimitRange名称", + "name": "limitRangeName", + "in": "path", + "required": true + }, + { + "description": "更新信息", + "name": "limitrange", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateLimitRangeRequest" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.LimitRangeDetail" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "默认资源限制不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定的默认资源限制", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "删除默认资源限制", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "LimitRange名称", + "name": "limitRangeName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "默认资源限制不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/resourcequotas": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定命名空间的所有资源配额", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "获取资源配额列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ResourceQuotaListResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "为指定命名空间创建资源配额", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "创建资源配额", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "资源配额信息", + "name": "quota", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateResourceQuotaRequest" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ResourceQuotaDetail" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "命名空间不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/namespaces/{namespaceName}/resourcequotas/{quotaName}": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新指定的资源配额", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "更新资源配额", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ResourceQuota名称", + "name": "quotaName", + "in": "path", + "required": true + }, + { + "description": "更新信息", + "name": "quota", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateResourceQuotaRequest" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ResourceQuotaDetail" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "资源配额不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定的资源配额", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s命名空间管理" + ], + "summary": "删除资源配额", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ResourceQuota名称", + "name": "quotaName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "资源配额不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定集群的所有节点详细信息,包括名称/IP地址、状态、配置、资源使用情况等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "获取K8s节点信息", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sNode" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定节点的详细信息,包括容器组、资源使用详情等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "获取单个节点详细信息", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sNodeDetail" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/cordon": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "设置节点的可调度状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "封锁/解封节点", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + }, + { + "description": "封锁信息", + "name": "cordon", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CordonNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "操作成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/drain": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "驱逐节点上的所有Pod", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "驱逐节点", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + }, + { + "description": "驱逐配置", + "name": "drain", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.DrainNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "驱逐成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/enhanced": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取节点的完整详细信息,包括基本信息、系统信息、K8s组件版本、资源使用情况、监控信息、Pod列表等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "获取增强的节点详细信息", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.NodeDetailResponse" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/labels": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "为指定节点添加标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "为节点添加标签", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + }, + { + "description": "标签信息", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AddLabelRequest" + } + } + ], + "responses": { + "200": { + "description": "添加成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "移除指定节点的标签", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "移除节点标签", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + }, + { + "description": "标签信息", + "name": "label", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.RemoveLabelRequest" + } + } + ], + "responses": { + "200": { + "description": "移除成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/resources": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取节点的资源容量、分配情况和Pod资源使用详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "获取节点资源分配详情", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.NodeResourceAllocation" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/nodes/{nodeName}/taints": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "为指定节点添加污点,控制Pod调度", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "为节点添加污点", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + }, + { + "description": "污点信息", + "name": "taint", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AddTaintRequest" + } + } + ], + "responses": { + "200": { + "description": "添加成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "移除指定节点的污点", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s节点管理" + ], + "summary": "移除节点污点", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + }, + { + "description": "污点信息", + "name": "taint", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.RemoveTaintRequest" + } + } + ], + "responses": { + "200": { + "description": "移除成功", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "节点不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取集群运行状态和节点信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "获取K8s集群状态", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "获取成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/k8s/cluster/{id}/sync": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "通过K8s API同步集群版本、节点数量、集群状态等信息并更新数据库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s集群管理" + ], + "summary": "同步K8s集群信息", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "同步成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.KubeCluster" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "集群不存在", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "服务器错误", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const K8sDefinitions = ` + "model.ApplicationForDeployment": { + "type": "object", + "properties": { + "can_deploy": { + "description": "是否可以部署", + "type": "boolean" + }, + "code": { + "description": "应用编码", + "type": "string" + }, + "environment": { + "description": "环境名称", + "type": "string" + }, + "id": { + "description": "应用ID", + "type": "integer" + }, + "jenkins_env_id": { + "description": "Jenkins环境配置ID", + "type": "integer" + }, + "job_name": { + "description": "Jenkins任务名称", + "type": "string" + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "reason": { + "description": "不能部署的原因", + "type": "string" + } + } + }, + "model.BusinessLineServiceTree": { + "type": "object", + "properties": { + "business_group_id": { + "description": "业务组ID", + "type": "integer" + }, + "business_group_name": { + "description": "业务组名称", + "type": "string" + }, + "service_count": { + "description": "服务数量", + "type": "integer" + }, + "services": { + "description": "服务列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceTreeNode" + } + } + } + }, + "model.ContainerInfo": { + "type": "object", + "properties": { + "env": { + "description": "环境变量", + "type": "array", + "items": { + "$ref": "#/definitions/model.EnvVar" + } + }, + "image": { + "description": "镜像", + "type": "string" + }, + "name": { + "description": "容器名称", + "type": "string" + }, + "ports": { + "description": "端口配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerPort" + } + }, + "ready": { + "description": "就绪状态", + "type": "boolean" + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadResources" + } + ] + }, + "restartCount": { + "description": "重启次数", + "type": "integer" + }, + "state": { + "description": "状态", + "type": "string" + } + } + }, + "model.ContainerMetricsInfo": { + "type": "object", + "properties": { + "limits": { + "description": "资源限制量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "name": { + "description": "容器名称", + "type": "string" + }, + "requests": { + "description": "资源请求量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "restartCount": { + "description": "重启次数", + "type": "integer" + }, + "state": { + "description": "容器状态", + "type": "string" + }, + "usage": { + "description": "资源使用量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "usageRate": { + "description": "使用率", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsageRate" + } + ] + } + } + }, + "model.ContainerPort": { + "type": "object", + "properties": { + "containerPort": { + "description": "容器端口", + "type": "integer" + }, + "name": { + "description": "端口名称", + "type": "string" + }, + "protocol": { + "description": "协议", + "type": "string" + } + } + }, + "model.ContainerSpec": { + "type": "object", + "required": [ + "image", + "name" + ], + "properties": { + "args": { + "description": "启动参数", + "type": "array", + "items": { + "type": "string" + } + }, + "command": { + "description": "启动命令", + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "description": "环境变量", + "type": "array", + "items": { + "$ref": "#/definitions/model.EnvVar" + } + }, + "image": { + "description": "镜像", + "type": "string" + }, + "name": { + "description": "容器名称", + "type": "string" + }, + "ports": { + "description": "端口配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerPort" + } + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadResources" + } + ] + }, + "volumeMounts": { + "description": "存储卷挂载", + "type": "array", + "items": { + "$ref": "#/definitions/model.VolumeMount" + } + } + } + }, + "model.ContainerStatus": { + "type": "object", + "properties": { + "image": { + "description": "镜像", + "type": "string" + }, + "name": { + "description": "容器名称", + "type": "string" + }, + "ready": { + "description": "就绪状态", + "type": "boolean" + }, + "restartCount": { + "description": "重启次数", + "type": "integer" + }, + "state": { + "description": "状态", + "type": "string" + } + } + }, + "model.CordonNodeRequest": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "unschedulable": { + "type": "boolean" + } + } + }, + "model.CreateDeploymentRequest": { + "type": "object", + "required": [ + "name", + "template" + ], + "properties": { + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Deployment名称", + "type": "string" + }, + "replicas": { + "description": "副本数,默认1", + "type": "integer" + }, + "strategy": { + "description": "部署策略", + "allOf": [ + { + "$ref": "#/definitions/model.DeploymentStrategy" + } + ] + }, + "template": { + "description": "Pod模板", + "allOf": [ + { + "$ref": "#/definitions/model.PodTemplateSpec" + } + ] + } + } + }, + "model.CreateIngressRequest": { + "type": "object", + "required": [ + "name", + "rules" + ], + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "class": { + "description": "Ingress类", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Ingress名称", + "type": "string" + }, + "rules": { + "description": "路由规则", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressRuleSpec" + } + }, + "tls": { + "description": "TLS配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressTLSSpec" + } + } + } + }, + "model.CreateNamespaceRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "命名空间名称", + "type": "string" + } + } + }, + "model.CreatePVCRequest": { + "type": "object", + "required": [ + "accessModes", + "name", + "resources" + ], + "properties": { + "accessModes": { + "description": "访问模式", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "PVC名称", + "type": "string" + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.PVCResourcesSpec" + } + ] + }, + "selector": { + "description": "标签选择器", + "allOf": [ + { + "$ref": "#/definitions/model.PVCSelectorSpec" + } + ] + }, + "storageClass": { + "description": "存储类名称", + "type": "string" + }, + "volumeMode": { + "description": "卷模式", + "type": "string" + } + } + }, + "model.CreatePVRequest": { + "type": "object", + "required": [ + "accessModes", + "capacity", + "name", + "persistentVolumeSource" + ], + "properties": { + "accessModes": { + "description": "访问模式", + "type": "array", + "items": { + "type": "string" + } + }, + "capacity": { + "description": "容量", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "PV名称", + "type": "string" + }, + "nodeAffinity": { + "description": "节点亲和性", + "allOf": [ + { + "$ref": "#/definitions/model.PVNodeAffinity" + } + ] + }, + "persistentVolumeSource": { + "description": "存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVSourceSpec" + } + ] + }, + "reclaimPolicy": { + "description": "回收策略", + "type": "string" + }, + "storageClassName": { + "description": "存储类名称", + "type": "string" + }, + "volumeMode": { + "description": "卷模式", + "type": "string" + } + } + }, + "model.CreatePodFromYAMLRequest": { + "type": "object", + "required": [ + "yamlContent" + ], + "properties": { + "dryRun": { + "description": "是否只进行校验不实际创建", + "type": "boolean" + }, + "validateOnly": { + "description": "是否只校验YAML格式", + "type": "boolean" + }, + "yamlContent": { + "description": "YAML内容", + "type": "string" + } + } + }, + "model.CreatePodFromYAMLResponse": { + "type": "object", + "properties": { + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "Pod所在的命名空间", + "type": "string" + }, + "parsedObject": { + "description": "解析的对象信息", + "type": "object", + "additionalProperties": true + }, + "podName": { + "description": "创建的Pod名称", + "type": "string" + }, + "success": { + "description": "是否创建成功", + "type": "boolean" + }, + "validationResult": { + "description": "校验结果(DryRun时返回)", + "allOf": [ + { + "$ref": "#/definitions/model.ValidateYAMLResponse" + } + ] + } + } + }, + "model.CreateQuickDeploymentRequest": { + "type": "object", + "required": [ + "applications", + "business_dept_id", + "business_group_id", + "title" + ], + "properties": { + "applications": { + "description": "应用列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.QuickDeploymentAppRequest" + } + }, + "business_dept_id": { + "description": "业务部门ID", + "type": "integer" + }, + "business_group_id": { + "description": "业务组ID", + "type": "integer" + }, + "description": { + "description": "发布描述", + "type": "string" + }, + "title": { + "description": "发布标题", + "type": "string" + } + } + }, + "model.CreateServiceRequest": { + "type": "object", + "required": [ + "name", + "ports", + "selector", + "type" + ], + "properties": { + "externalIPs": { + "description": "外部IP列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "服务名称", + "type": "string" + }, + "ports": { + "description": "端口配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServicePortSpec" + } + }, + "selector": { + "description": "选择器", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "服务类型", + "type": "string" + } + } + }, + "model.DeploymentRevision": { + "type": "object", + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "changeReason": { + "description": "变更原因", + "type": "string" + }, + "creationTime": { + "description": "创建时间", + "type": "string" + }, + "images": { + "description": "镜像列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "replicasSummary": { + "description": "副本统计", + "allOf": [ + { + "$ref": "#/definitions/model.ReplicasSummary" + } + ] + }, + "revision": { + "description": "版本号", + "type": "integer" + }, + "status": { + "description": "版本状态 (current/historical)", + "type": "string" + } + } + }, + "model.DeploymentRevisionDetail": { + "type": "object", + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "changeReason": { + "description": "变更原因", + "type": "string" + }, + "conditions": { + "description": "状态条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkloadCondition" + } + }, + "creationTime": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "images": { + "description": "镜像列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "podTemplate": { + "description": "Pod模板", + "allOf": [ + { + "$ref": "#/definitions/model.PodTemplateSpec" + } + ] + }, + "replicaSets": { + "description": "关联的ReplicaSet信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.ReplicaSetInfo" + } + }, + "replicasSummary": { + "description": "副本统计", + "allOf": [ + { + "$ref": "#/definitions/model.ReplicasSummary" + } + ] + }, + "revision": { + "description": "版本号", + "type": "integer" + }, + "status": { + "description": "版本状态 (current/historical)", + "type": "string" + }, + "strategy": { + "description": "部署策略", + "allOf": [ + { + "$ref": "#/definitions/model.DeploymentStrategy" + } + ] + } + } + }, + "model.DeploymentRolloutHistoryResponse": { + "type": "object", + "properties": { + "currentRevision": { + "description": "当前版本号", + "type": "integer" + }, + "deploymentName": { + "description": "Deployment名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "revisions": { + "description": "版本列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.DeploymentRevision" + } + }, + "totalRevisions": { + "description": "总版本数", + "type": "integer" + } + } + }, + "model.DeploymentRolloutStatusResponse": { + "type": "object", + "properties": { + "availableReplicas": { + "description": "可用副本数", + "type": "integer" + }, + "conditions": { + "description": "状态条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkloadCondition" + } + }, + "currentRevision": { + "description": "当前版本号", + "type": "integer" + }, + "deploymentName": { + "description": "Deployment名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "observedGeneration": { + "description": "观察到的代数", + "type": "integer" + }, + "paused": { + "description": "是否已暂停", + "type": "boolean" + }, + "progressDeadline": { + "description": "进度截止时间", + "type": "integer" + }, + "readyReplicas": { + "description": "就绪副本数", + "type": "integer" + }, + "rolloutComplete": { + "description": "是否滚动发布完成", + "type": "boolean" + }, + "status": { + "description": "总体状态 (Progressing/Complete/Failed/Paused)", + "type": "string" + }, + "strategy": { + "description": "部署策略", + "allOf": [ + { + "$ref": "#/definitions/model.DeploymentStrategy" + } + ] + }, + "updatedReplicas": { + "description": "已更新副本数", + "type": "integer" + } + } + }, + "model.DeploymentStats": { + "type": "object", + "properties": { + "failed": { + "description": "失败次数", + "type": "integer" + }, + "success": { + "description": "成功次数", + "type": "integer" + }, + "successRate": { + "description": "成功率", + "type": "number" + }, + "total": { + "description": "发布总次数", + "type": "integer" + } + } + }, + "model.DeploymentStrategy": { + "type": "object", + "properties": { + "rollingUpdate": { + "description": "滚动更新配置", + "allOf": [ + { + "$ref": "#/definitions/model.RollingUpdateDeployment" + } + ] + }, + "type": { + "description": "策略类型", + "type": "string" + } + } + }, + "model.DrainNodeRequest": { + "type": "object", + "properties": { + "deleteLocalData": { + "description": "删除本地数据", + "type": "boolean" + }, + "force": { + "description": "强制驱逐", + "type": "boolean" + }, + "gracePeriodSeconds": { + "description": "优雅终止时间", + "type": "integer" + }, + "ignoreDaemonSets": { + "description": "忽略DaemonSet", + "type": "boolean" + } + } + }, + "model.ExecuteQuickDeploymentRequest": { + "type": "object", + "required": [ + "deployment_id" + ], + "properties": { + "deployment_id": { + "description": "发布ID", + "type": "integer" + }, + "execution_mode": { + "description": "执行模式: 1=并行(默认) 2=串行", + "type": "integer", + "default": 1, + "enum": [ + 1, + 2 + ] + } + } + }, + "model.IngressBackend": { + "type": "object", + "properties": { + "service": { + "description": "服务后端", + "allOf": [ + { + "$ref": "#/definitions/model.IngressServiceBackend" + } + ] + } + } + }, + "model.IngressDetail": { + "type": "object", + "properties": { + "class": { + "description": "Ingress类/控制器类型", + "type": "string" + }, + "controllerName": { + "description": "Controller名称", + "type": "string" + }, + "controllerVersion": { + "description": "Controller版本", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "endpoints": { + "description": "访问端点", + "type": "array", + "items": { + "type": "string" + } + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "loadBalancer": { + "description": "负载均衡器信息", + "allOf": [ + { + "$ref": "#/definitions/model.IngressLoadBalancer" + } + ] + }, + "name": { + "description": "Ingress名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "rules": { + "description": "路由规则", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressRule" + } + }, + "spec": { + "description": "完整规格配置" + }, + "status": { + "description": "状态", + "type": "string" + }, + "tls": { + "description": "TLS配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressTLS" + } + }, + "type": { + "description": "Ingress类型:公网Nginx/内网Nginx等", + "type": "string" + } + } + }, + "model.IngressListResponse": { + "type": "object", + "properties": { + "ingresses": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sIngress" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.IngressLoadBalancer": { + "type": "object", + "properties": { + "ingress": { + "description": "入口信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressLoadBalancerIngress" + } + } + } + }, + "model.IngressLoadBalancerIngress": { + "type": "object", + "properties": { + "hostname": { + "description": "主机名", + "type": "string" + }, + "ip": { + "description": "IP地址", + "type": "string" + }, + "ports": { + "description": "端口信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressLoadBalancerPort" + } + } + } + }, + "model.IngressLoadBalancerPort": { + "type": "object", + "properties": { + "port": { + "description": "端口号", + "type": "integer" + }, + "protocol": { + "description": "协议", + "type": "string" + } + } + }, + "model.IngressPath": { + "type": "object", + "properties": { + "backend": { + "description": "后端服务", + "allOf": [ + { + "$ref": "#/definitions/model.IngressBackend" + } + ] + }, + "path": { + "description": "路径", + "type": "string" + }, + "pathType": { + "description": "路径类型 Exact/Prefix/ImplementationSpecific", + "type": "string" + } + } + }, + "model.IngressPathSpec": { + "type": "object", + "required": [ + "path", + "pathType", + "serviceName", + "servicePort" + ], + "properties": { + "path": { + "description": "路径", + "type": "string" + }, + "pathType": { + "description": "路径类型", + "type": "string" + }, + "serviceName": { + "description": "服务名称", + "type": "string" + }, + "servicePort": { + "description": "服务端口", + "type": "integer" + } + } + }, + "model.IngressRule": { + "type": "object", + "properties": { + "host": { + "description": "主机名", + "type": "string" + }, + "http": { + "description": "HTTP规则", + "allOf": [ + { + "$ref": "#/definitions/model.IngressRuleValue" + } + ] + } + } + }, + "model.IngressRuleSpec": { + "type": "object", + "required": [ + "host", + "paths" + ], + "properties": { + "host": { + "description": "主机名", + "type": "string" + }, + "paths": { + "description": "路径规则", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressPathSpec" + } + } + } + }, + "model.IngressRuleValue": { + "type": "object", + "properties": { + "paths": { + "description": "路径规则", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressPath" + } + } + } + }, + "model.IngressServiceBackend": { + "type": "object", + "properties": { + "name": { + "description": "服务名称", + "type": "string" + }, + "port": { + "description": "服务端口", + "allOf": [ + { + "$ref": "#/definitions/model.IngressServicePort" + } + ] + } + } + }, + "model.IngressServicePort": { + "type": "object", + "properties": { + "name": { + "description": "端口名称", + "type": "string" + }, + "number": { + "description": "端口号", + "type": "integer" + } + } + }, + "model.IngressTLS": { + "type": "object", + "properties": { + "hosts": { + "description": "主机列表", + "type": "array", + "items": { + "type": "string" + } + }, + "secretName": { + "description": "证书Secret名称", + "type": "string" + } + } + }, + "model.IngressTLSSpec": { + "type": "object", + "required": [ + "hosts", + "secretName" + ], + "properties": { + "hosts": { + "description": "主机列表", + "type": "array", + "items": { + "type": "string" + } + }, + "secretName": { + "description": "证书Secret名称", + "type": "string" + } + } + }, + "model.K8sClusterStats": { + "type": "object", + "properties": { + "healthy": { + "description": "健康数量", + "type": "integer" + }, + "offline": { + "description": "离线数量", + "type": "integer" + }, + "total": { + "description": "集群总数", + "type": "integer" + } + } + }, + "model.K8sConfigMap": { + "type": "object", + "properties": { + "binaryData": { + "description": "二进制数据", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "createdTime": { + "description": "创建时间", + "type": "string" + }, + "data": { + "description": "数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "immutable": { + "description": "是否不可变", + "type": "boolean" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "ConfigMap名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + } + } + }, + "model.K8sEvent": { + "type": "object", + "properties": { + "count": { + "description": "发生次数", + "type": "integer" + }, + "firstTime": { + "description": "首次时间", + "type": "string" + }, + "lastTime": { + "description": "最后时间", + "type": "string" + }, + "message": { + "description": "消息", + "type": "string" + }, + "reason": { + "description": "原因", + "type": "string" + }, + "source": { + "description": "事件源", + "type": "string" + }, + "type": { + "description": "事件类型", + "type": "string" + } + } + }, + "model.K8sIngress": { + "type": "object", + "properties": { + "class": { + "description": "Ingress类/控制器类型", + "type": "string" + }, + "controllerName": { + "description": "Controller名称", + "type": "string" + }, + "controllerVersion": { + "description": "Controller版本", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "endpoints": { + "description": "访问端点", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "loadBalancer": { + "description": "负载均衡器信息", + "allOf": [ + { + "$ref": "#/definitions/model.IngressLoadBalancer" + } + ] + }, + "name": { + "description": "Ingress名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "rules": { + "description": "路由规则", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressRule" + } + }, + "status": { + "description": "状态", + "type": "string" + }, + "tls": { + "description": "TLS配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressTLS" + } + }, + "type": { + "description": "Ingress类型:公网Nginx/内网Nginx等", + "type": "string" + } + } + }, + "model.K8sNamespace": { + "type": "object", + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "limitRanges": { + "description": "默认资源限制列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.LimitRangeDetail" + } + }, + "name": { + "description": "命名空间名称", + "type": "string" + }, + "resourceCount": { + "description": "资源统计", + "allOf": [ + { + "$ref": "#/definitions/model.NamespaceResourceCount" + } + ] + }, + "resourceQuotas": { + "description": "资源配额列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.ResourceQuotaDetail" + } + }, + "status": { + "description": "状态 Active/Terminating", + "type": "string" + } + } + }, + "model.K8sNode": { + "type": "object", + "properties": { + "conditions": { + "description": "节点状态详细条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeCondition" + } + }, + "configuration": { + "description": "节点配置信息", + "allOf": [ + { + "$ref": "#/definitions/model.NodeConfiguration" + } + ] + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "externalIP": { + "description": "外部IP地址", + "type": "string" + }, + "internalIP": { + "description": "内部IP地址", + "type": "string" + }, + "name": { + "description": "节点名称", + "type": "string" + }, + "podMetrics": { + "description": "容器组统计", + "allOf": [ + { + "$ref": "#/definitions/model.PodMetrics" + } + ] + }, + "resources": { + "description": "CPU和内存资源", + "allOf": [ + { + "$ref": "#/definitions/model.NodeResources" + } + ] + }, + "roles": { + "description": "节点角色 control-plane,master 或 worker", + "type": "string" + }, + "runtime": { + "description": "运行时和版本信息", + "allOf": [ + { + "$ref": "#/definitions/model.RuntimeInfo" + } + ] + }, + "scheduling": { + "description": "调度相关信息(污点、是否可调度等)", + "allOf": [ + { + "$ref": "#/definitions/model.NodeSchedulingInfo" + } + ] + }, + "status": { + "description": "节点状态 Ready/NotReady", + "type": "string" + } + } + }, + "model.K8sNodeDetail": { + "type": "object", + "properties": { + "conditions": { + "description": "节点状态详细条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeCondition" + } + }, + "configuration": { + "description": "节点配置信息", + "allOf": [ + { + "$ref": "#/definitions/model.NodeConfiguration" + } + ] + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.EventInfo" + } + }, + "externalIP": { + "description": "外部IP地址", + "type": "string" + }, + "internalIP": { + "description": "内部IP地址", + "type": "string" + }, + "metrics": { + "description": "详细监控指标", + "allOf": [ + { + "$ref": "#/definitions/model.NodeMetrics" + } + ] + }, + "name": { + "description": "节点名称", + "type": "string" + }, + "podMetrics": { + "description": "容器组统计", + "allOf": [ + { + "$ref": "#/definitions/model.PodMetrics" + } + ] + }, + "pods": { + "description": "节点上运行的Pod列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.PodInfo" + } + }, + "resources": { + "description": "CPU和内存资源", + "allOf": [ + { + "$ref": "#/definitions/model.NodeResources" + } + ] + }, + "roles": { + "description": "节点角色 control-plane,master 或 worker", + "type": "string" + }, + "runtime": { + "description": "运行时和版本信息", + "allOf": [ + { + "$ref": "#/definitions/model.RuntimeInfo" + } + ] + }, + "scheduling": { + "description": "调度相关信息(污点、是否可调度等)", + "allOf": [ + { + "$ref": "#/definitions/model.NodeSchedulingInfo" + } + ] + }, + "status": { + "description": "节点状态 Ready/NotReady", + "type": "string" + } + } + }, + "model.K8sPersistentVolume": { + "type": "object", + "properties": { + "accessModes": { + "description": "访问模式", + "type": "array", + "items": { + "type": "string" + } + }, + "capacity": { + "description": "总量", + "type": "string" + }, + "claimRef": { + "description": "绑定存储声明", + "allOf": [ + { + "$ref": "#/definitions/model.PVClaimRef" + } + ] + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "PV名称", + "type": "string" + }, + "nodeAffinity": { + "description": "节点亲和性", + "allOf": [ + { + "$ref": "#/definitions/model.PVNodeAffinity" + } + ] + }, + "persistentVolumeSource": { + "description": "存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVSource" + } + ] + }, + "reclaimPolicy": { + "description": "回收策略 Retain/Delete/Recycle", + "type": "string" + }, + "status": { + "description": "状态 Available/Bound/Released/Failed", + "type": "string" + }, + "storageClass": { + "description": "存储类型", + "type": "string" + }, + "volumeMode": { + "description": "卷模式", + "type": "string" + } + } + }, + "model.K8sPersistentVolumeClaim": { + "type": "object", + "properties": { + "accessModes": { + "description": "访问模式", + "type": "array", + "items": { + "type": "string" + } + }, + "capacity": { + "description": "总量", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "PVC名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "status": { + "description": "状态 Pending/Bound/Lost", + "type": "string" + }, + "storageClass": { + "description": "存储类型", + "type": "string" + }, + "volumeMode": { + "description": "卷模式 Filesystem/Block", + "type": "string" + }, + "volumeName": { + "description": "关联的存储卷", + "type": "string" + } + } + }, + "model.K8sPodDetail": { + "type": "object", + "properties": { + "conditions": { + "description": "Pod状态条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.PodCondition" + } + }, + "containers": { + "description": "容器信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerInfo" + } + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "hostIP": { + "description": "主机IP", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "实例名称", + "type": "string" + }, + "nodeName": { + "description": "节点名称", + "type": "string" + }, + "phase": { + "description": "阶段", + "type": "string" + }, + "podIP": { + "description": "Pod IP", + "type": "string" + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadResources" + } + ] + }, + "restartCount": { + "description": "重启次数", + "type": "integer" + }, + "runningTime": { + "description": "运行时间", + "type": "string" + }, + "spec": { + "description": "完整规格配置" + }, + "status": { + "description": "状态", + "type": "string" + }, + "volumes": { + "description": "挂载卷信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.VolumeInfo" + } + } + } + }, + "model.K8sPodInfo": { + "type": "object", + "properties": { + "containers": { + "description": "容器信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerInfo" + } + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "hostIP": { + "description": "主机IP", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "实例名称", + "type": "string" + }, + "nodeName": { + "description": "节点名称", + "type": "string" + }, + "phase": { + "description": "阶段", + "type": "string" + }, + "podIP": { + "description": "Pod IP", + "type": "string" + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadResources" + } + ] + }, + "restartCount": { + "description": "重启次数", + "type": "integer" + }, + "runningTime": { + "description": "运行时间", + "type": "string" + }, + "status": { + "description": "状态", + "type": "string" + } + } + }, + "model.K8sSecret": { + "type": "object", + "properties": { + "createdTime": { + "description": "创建时间", + "type": "string" + }, + "data": { + "description": "数据(base64编码)", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "immutable": { + "description": "是否不可变", + "type": "boolean" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Secret名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "stringData": { + "description": "字符串数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "Secret类型", + "type": "string" + } + } + }, + "model.K8sService": { + "type": "object", + "properties": { + "clusterIP": { + "description": "集群IP", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "endpoints": { + "description": "端点信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceEndpoint" + } + }, + "externalIPs": { + "description": "外部IP列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "服务名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "ports": { + "description": "端口配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServicePort" + } + }, + "selector": { + "description": "选择器", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "服务类型 ClusterIP/NodePort/LoadBalancer/ExternalName", + "type": "string" + } + } + }, + "model.K8sStorageClass": { + "type": "object", + "properties": { + "allowVolumeExpansion": { + "description": "允许卷扩展", + "type": "boolean" + }, + "allowedTopologies": { + "description": "允许的拓扑", + "type": "array", + "items": { + "$ref": "#/definitions/model.StorageClassTopology" + } + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "存储类名称", + "type": "string" + }, + "parameters": { + "description": "参数", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "provisioner": { + "description": "提供者", + "type": "string" + }, + "reclaimPolicy": { + "description": "回收策略", + "type": "string" + }, + "volumeBindingMode": { + "description": "卷绑定模式", + "type": "string" + } + } + }, + "model.K8sWorkload": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "images": { + "description": "镜像列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "readyReplicas": { + "description": "就绪副本数", + "type": "integer" + }, + "replicas": { + "description": "副本数", + "type": "integer" + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadResources" + } + ] + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "类型", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadType" + } + ] + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.K8sWorkloadDetail": { + "type": "object", + "properties": { + "conditions": { + "description": "状态条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.WorkloadCondition" + } + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "images": { + "description": "镜像列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "pods": { + "description": "Pod列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sPodInfo" + } + }, + "readyReplicas": { + "description": "就绪副本数", + "type": "integer" + }, + "replicas": { + "description": "副本数", + "type": "integer" + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadResources" + } + ] + }, + "spec": { + "description": "完整规格配置" + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "类型", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadType" + } + ] + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.NamespaceListResponse": { + "type": "object", + "properties": { + "namespaces": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sNamespace" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.NamespaceMetricsInfo": { + "type": "object", + "properties": { + "namespace": { + "description": "命名空间名称", + "type": "string" + }, + "podCount": { + "description": "Pod总数", + "type": "integer" + }, + "podMetrics": { + "description": "Pod监控列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.PodMetricsSummary" + } + }, + "resourceQuota": { + "description": "命名空间资源配额", + "allOf": [ + { + "$ref": "#/definitions/model.NamespaceResourceQuota" + } + ] + }, + "runningPods": { + "description": "运行中的Pod数", + "type": "integer" + }, + "timestamp": { + "description": "采集时间", + "type": "string" + }, + "totalUsage": { + "description": "总资源使用量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "usageRate": { + "description": "资源使用率", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsageRate" + } + ] + } + } + }, + "model.NamespaceResourceCount": { + "type": "object", + "properties": { + "configMapCount": { + "description": "ConfigMap数量", + "type": "integer" + }, + "podCount": { + "description": "Pod数量", + "type": "integer" + }, + "secretCount": { + "description": "Secret数量", + "type": "integer" + }, + "serviceCount": { + "description": "Service数量", + "type": "integer" + } + } + }, + "model.NamespaceResourceQuota": { + "type": "object", + "properties": { + "hard": { + "description": "硬限制", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "used": { + "description": "已使用", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + } + } + }, + "model.NodeCondition": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "model.NodeConfig": { + "type": "object", + "required": [ + "etcdHostIds", + "masterHostIds" + ], + "properties": { + "etcdHostIds": { + "description": "ETCD节点主机ID", + "type": "array", + "items": { + "type": "integer" + } + }, + "masterHostIds": { + "description": "Master节点主机ID", + "type": "array", + "items": { + "type": "integer" + } + }, + "workerHostIds": { + "description": "Worker节点主机ID", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "model.NodeConfiguration": { + "type": "object", + "properties": { + "annotations": { + "description": "节点注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "architecture": { + "description": "系统架构", + "type": "string" + }, + "kernelVersion": { + "description": "内核版本", + "type": "string" + }, + "labels": { + "description": "节点标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "osImage": { + "description": "操作系统镜像", + "type": "string" + }, + "role": { + "description": "节点角色 master/worker", + "type": "string" + } + } + }, + "model.NodeDetailResponse": { + "type": "object", + "properties": { + "allocatable": { + "description": "可分配资源", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "architecture": { + "description": "架构", + "type": "string" + }, + "bootID": { + "description": "启动ID", + "type": "string" + }, + "capacity": { + "description": "资源信息", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "conditions": { + "description": "状态条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeCondition" + } + }, + "containerRuntimeVersion": { + "description": "容器运行时版本", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "externalIP": { + "description": "外部IP", + "type": "string" + }, + "hostname": { + "description": "主机名", + "type": "string" + }, + "internalIP": { + "description": "IP地址信息", + "type": "string" + }, + "kernelVersion": { + "description": "内核版本", + "type": "string" + }, + "kubeProxyVersion": { + "description": "Kube-Proxy版本", + "type": "string" + }, + "kubeletVersion": { + "description": "K8s组件版本", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "machineID": { + "description": "机器ID", + "type": "string" + }, + "monitoring": { + "description": "监控信息", + "allOf": [ + { + "$ref": "#/definitions/model.NodeMonitoringInfo" + } + ] + }, + "name": { + "description": "基本信息", + "type": "string" + }, + "operatingSystem": { + "description": "操作系统", + "type": "string" + }, + "osImage": { + "description": "系统信息", + "type": "string" + }, + "podCIDR": { + "description": "CIDR信息", + "type": "string" + }, + "podCIDRs": { + "description": "容器组CIDR列表", + "type": "array", + "items": { + "type": "string" + } + }, + "podInfo": { + "description": "Pod信息", + "allOf": [ + { + "$ref": "#/definitions/model.NodePodInfo" + } + ] + }, + "podList": { + "description": "节点上的Pod列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodePodDetail" + } + }, + "providerID": { + "description": "提供者ID", + "type": "string" + }, + "status": { + "description": "状态信息", + "type": "string" + }, + "systemUUID": { + "description": "系统UUID", + "type": "string" + }, + "taints": { + "description": "污点列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeTaint" + } + }, + "uid": { + "description": "UID", + "type": "string" + }, + "unschedulable": { + "description": "调度信息", + "type": "boolean" + } + } + }, + "model.NodeInfo": { + "type": "object", + "properties": { + "allocatable": { + "description": "可分配资源", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "capacity": { + "description": "CPU、内存等资源容量", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "conditions": { + "description": "节点状态条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeCondition" + } + }, + "externalIP": { + "type": "string" + }, + "internalIP": { + "type": "string" + }, + "name": { + "type": "string" + }, + "os": { + "type": "string" + }, + "role": { + "description": "master/worker/etcd", + "type": "string" + }, + "status": { + "description": "Ready/NotReady", + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "model.NodeMetrics": { + "type": "object", + "properties": { + "cpuUsagePercentage": { + "type": "number" + }, + "diskUsagePercentage": { + "type": "number" + }, + "memoryUsagePercentage": { + "type": "number" + }, + "networkInBytes": { + "type": "integer" + }, + "networkOutBytes": { + "type": "integer" + } + } + }, + "model.NodeMetricsInfo": { + "type": "object", + "properties": { + "allocatable": { + "description": "可分配量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "capacity": { + "description": "总容量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "nodeName": { + "description": "节点名称", + "type": "string" + }, + "podCount": { + "description": "Pod数量", + "type": "integer" + }, + "podMetrics": { + "description": "Pod监控摘要", + "type": "array", + "items": { + "$ref": "#/definitions/model.PodMetricsSummary" + } + }, + "systemInfo": { + "description": "系统信息", + "allOf": [ + { + "$ref": "#/definitions/model.NodeSystemInfo" + } + ] + }, + "timestamp": { + "description": "采集时间", + "type": "string" + }, + "usage": { + "description": "资源使用量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "usageRate": { + "description": "使用率", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsageRate" + } + ] + } + } + }, + "model.NodeMonitoringInfo": { + "type": "object", + "properties": { + "cpu": { + "description": "CPU使用情况", + "allOf": [ + { + "$ref": "#/definitions/model.NodeResourceUsage" + } + ] + }, + "memory": { + "description": "内存使用情况", + "allOf": [ + { + "$ref": "#/definitions/model.NodeResourceUsage" + } + ] + }, + "network": { + "description": "网络使用情况", + "allOf": [ + { + "$ref": "#/definitions/model.NodeNetworkUsage" + } + ] + }, + "storage": { + "description": "存储使用情况", + "allOf": [ + { + "$ref": "#/definitions/model.NodeResourceUsage" + } + ] + } + } + }, + "model.NodeNetworkUsage": { + "type": "object", + "properties": { + "inboundBytes": { + "description": "入站字节数", + "type": "integer" + }, + "inboundPackets": { + "description": "入站包数", + "type": "integer" + }, + "outboundBytes": { + "description": "出站字节数", + "type": "integer" + }, + "outboundPackets": { + "description": "出站包数", + "type": "integer" + } + } + }, + "model.NodePodDetail": { + "type": "object", + "properties": { + "containers": { + "description": "容器状态", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerStatus" + } + }, + "cpuLimits": { + "description": "CPU限制", + "type": "string" + }, + "cpuRequests": { + "description": "CPU请求", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "memoryLimits": { + "description": "内存限制", + "type": "string" + }, + "memoryRequests": { + "description": "内存请求", + "type": "string" + }, + "name": { + "description": "Pod名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "phase": { + "description": "阶段", + "type": "string" + }, + "restartCount": { + "description": "重启次数", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "string" + } + } + }, + "model.NodePodInfo": { + "type": "object", + "properties": { + "failedPods": { + "description": "失败的Pod数", + "type": "integer" + }, + "pendingPods": { + "description": "等待中的Pod数", + "type": "integer" + }, + "runningPods": { + "description": "运行中的Pod数", + "type": "integer" + }, + "succeededPods": { + "description": "成功的Pod数", + "type": "integer" + }, + "totalPods": { + "description": "Pod总数", + "type": "integer" + } + } + }, + "model.NodeResourceAllocation": { + "type": "object", + "properties": { + "allocatable": { + "description": "可分配资源", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "allocated": { + "description": "已分配资源", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "capacity": { + "description": "节点总容量", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "nodeName": { + "type": "string" + }, + "podList": { + "description": "Pod资源使用详情", + "type": "array", + "items": { + "$ref": "#/definitions/model.PodResourceInfo" + } + } + } + }, + "model.NodeResourceUsage": { + "type": "object", + "properties": { + "available": { + "description": "可用量", + "type": "string" + }, + "limits": { + "description": "限制量", + "type": "string" + }, + "requestRate": { + "description": "请求率 (0-100)", + "type": "number" + }, + "requests": { + "description": "请求量", + "type": "string" + }, + "total": { + "description": "总量", + "type": "string" + }, + "usageRate": { + "description": "使用率 (0-100)", + "type": "number" + }, + "used": { + "description": "已使用", + "type": "string" + } + } + }, + "model.NodeResources": { + "type": "object", + "properties": { + "cpu": { + "description": "CPU资源", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceInfo" + } + ] + }, + "memory": { + "description": "内存资源", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceInfo" + } + ] + } + } + }, + "model.NodeSchedulingInfo": { + "type": "object", + "properties": { + "taints": { + "description": "节点污点", + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeTaint" + } + }, + "unschedulable": { + "description": "是否不可调度", + "type": "boolean" + } + } + }, + "model.NodeSystemInfo": { + "type": "object", + "properties": { + "architecture": { + "description": "系统架构", + "type": "string" + }, + "containerRuntimeVersion": { + "description": "容器运行时版本", + "type": "string" + }, + "kernelVersion": { + "description": "内核版本", + "type": "string" + }, + "kubeProxyVersion": { + "description": "KubeProxy版本", + "type": "string" + }, + "kubeletVersion": { + "description": "Kubelet版本", + "type": "string" + }, + "osImage": { + "description": "操作系统镜像", + "type": "string" + } + } + }, + "model.NodeTaint": { + "type": "object", + "properties": { + "effect": { + "description": "NoSchedule, PreferNoSchedule, NoExecute", + "type": "string" + }, + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "model.PVAWSElasticBlockStoreVolumeSource": { + "type": "object", + "properties": { + "fsType": { + "description": "文件系统类型", + "type": "string" + }, + "partition": { + "description": "分区", + "type": "integer" + }, + "readOnly": { + "description": "只读", + "type": "boolean" + }, + "volumeID": { + "description": "卷ID", + "type": "string" + } + } + }, + "model.PVCDetail": { + "type": "object", + "properties": { + "accessModes": { + "description": "访问模式", + "type": "array", + "items": { + "type": "string" + } + }, + "capacity": { + "description": "总量", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "PVC名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "spec": { + "description": "完整规格配置" + }, + "status": { + "description": "状态 Pending/Bound/Lost", + "type": "string" + }, + "storageClass": { + "description": "存储类型", + "type": "string" + }, + "volumeMode": { + "description": "卷模式 Filesystem/Block", + "type": "string" + }, + "volumeName": { + "description": "关联的存储卷", + "type": "string" + } + } + }, + "model.PVCListResponse": { + "type": "object", + "properties": { + "pvcs": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sPersistentVolumeClaim" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.PVCMatchExp": { + "type": "object", + "properties": { + "key": { + "description": "键", + "type": "string" + }, + "operator": { + "description": "操作符", + "type": "string" + }, + "values": { + "description": "值", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.PVCResourcesSpec": { + "type": "object", + "required": [ + "requests" + ], + "properties": { + "limits": { + "description": "资源限制", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "requests": { + "description": "资源请求", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.PVCSIVolumeSource": { + "type": "object", + "properties": { + "driver": { + "description": "驱动名称", + "type": "string" + }, + "fsType": { + "description": "文件系统类型", + "type": "string" + }, + "readOnly": { + "description": "只读", + "type": "boolean" + }, + "volumeAttributes": { + "description": "卷属性", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "volumeHandle": { + "description": "卷句柄", + "type": "string" + } + } + }, + "model.PVCSelectorSpec": { + "type": "object", + "properties": { + "matchExpressions": { + "description": "匹配表达式", + "type": "array", + "items": { + "$ref": "#/definitions/model.PVCMatchExp" + } + }, + "matchLabels": { + "description": "匹配标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.PVClaimRef": { + "type": "object", + "properties": { + "apiVersion": { + "description": "API版本", + "type": "string" + }, + "kind": { + "description": "类型", + "type": "string" + }, + "name": { + "description": "名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "uid": { + "description": "UID", + "type": "string" + } + } + }, + "model.PVDetail": { + "type": "object", + "properties": { + "accessModes": { + "description": "访问模式", + "type": "array", + "items": { + "type": "string" + } + }, + "capacity": { + "description": "总量", + "type": "string" + }, + "claimRef": { + "description": "绑定存储声明", + "allOf": [ + { + "$ref": "#/definitions/model.PVClaimRef" + } + ] + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "PV名称", + "type": "string" + }, + "nodeAffinity": { + "description": "节点亲和性", + "allOf": [ + { + "$ref": "#/definitions/model.PVNodeAffinity" + } + ] + }, + "persistentVolumeSource": { + "description": "存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVSource" + } + ] + }, + "reclaimPolicy": { + "description": "回收策略 Retain/Delete/Recycle", + "type": "string" + }, + "spec": { + "description": "完整规格配置" + }, + "status": { + "description": "状态 Available/Bound/Released/Failed", + "type": "string" + }, + "storageClass": { + "description": "存储类型", + "type": "string" + }, + "volumeMode": { + "description": "卷模式", + "type": "string" + } + } + }, + "model.PVHostPathVolumeSource": { + "type": "object", + "properties": { + "path": { + "description": "主机路径", + "type": "string" + }, + "type": { + "description": "类型", + "type": "string" + } + } + }, + "model.PVISCSIVolumeSource": { + "type": "object", + "properties": { + "fsType": { + "description": "文件系统类型", + "type": "string" + }, + "iqn": { + "description": "IQN", + "type": "string" + }, + "iscsiInterface": { + "description": "iSCSI接口", + "type": "string" + }, + "lun": { + "description": "LUN", + "type": "integer" + }, + "portals": { + "description": "门户列表", + "type": "array", + "items": { + "type": "string" + } + }, + "readOnly": { + "description": "只读", + "type": "boolean" + }, + "targetPortal": { + "description": "目标门户", + "type": "string" + } + } + }, + "model.PVListResponse": { + "type": "object", + "properties": { + "pvs": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sPersistentVolume" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.PVLocalVolumeSource": { + "type": "object", + "properties": { + "fsType": { + "description": "文件系统类型", + "type": "string" + }, + "path": { + "description": "本地路径", + "type": "string" + } + } + }, + "model.PVNFSVolumeSource": { + "type": "object", + "properties": { + "path": { + "description": "NFS路径", + "type": "string" + }, + "readOnly": { + "description": "只读", + "type": "boolean" + }, + "server": { + "description": "NFS服务器", + "type": "string" + } + } + }, + "model.PVNodeAffinity": { + "type": "object", + "properties": { + "required": { + "description": "必需的节点选择器", + "allOf": [ + { + "$ref": "#/definitions/model.PVNodeSelector" + } + ] + } + } + }, + "model.PVNodeSelector": { + "type": "object", + "properties": { + "nodeSelectorTerms": { + "description": "节点选择器条件", + "type": "array", + "items": { + "$ref": "#/definitions/model.PVNodeSelectorTerm" + } + } + } + }, + "model.PVNodeSelectorRequirement": { + "type": "object", + "properties": { + "key": { + "description": "键", + "type": "string" + }, + "operator": { + "description": "操作符", + "type": "string" + }, + "values": { + "description": "值", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.PVNodeSelectorTerm": { + "type": "object", + "properties": { + "matchExpressions": { + "description": "匹配表达式", + "type": "array", + "items": { + "$ref": "#/definitions/model.PVNodeSelectorRequirement" + } + }, + "matchFields": { + "description": "匹配字段", + "type": "array", + "items": { + "$ref": "#/definitions/model.PVNodeSelectorRequirement" + } + } + } + }, + "model.PVSource": { + "type": "object", + "properties": { + "awsElasticBlockStore": { + "description": "AWS EBS", + "allOf": [ + { + "$ref": "#/definitions/model.PVAWSElasticBlockStoreVolumeSource" + } + ] + }, + "csi": { + "description": "CSI存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVCSIVolumeSource" + } + ] + }, + "hostPath": { + "description": "HostPath存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVHostPathVolumeSource" + } + ] + }, + "iscsi": { + "description": "iSCSI存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVISCSIVolumeSource" + } + ] + }, + "local": { + "description": "Local存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVLocalVolumeSource" + } + ] + }, + "nfs": { + "description": "NFS存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVNFSVolumeSource" + } + ] + } + } + }, + "model.PVSourceSpec": { + "type": "object", + "properties": { + "awsElasticBlockStore": { + "description": "AWS EBS", + "allOf": [ + { + "$ref": "#/definitions/model.PVAWSElasticBlockStoreVolumeSource" + } + ] + }, + "csi": { + "description": "CSI存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVCSIVolumeSource" + } + ] + }, + "hostPath": { + "description": "HostPath存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVHostPathVolumeSource" + } + ] + }, + "iscsi": { + "description": "iSCSI存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVISCSIVolumeSource" + } + ] + }, + "local": { + "description": "Local存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVLocalVolumeSource" + } + ] + }, + "nfs": { + "description": "NFS存储源", + "allOf": [ + { + "$ref": "#/definitions/model.PVNFSVolumeSource" + } + ] + } + } + }, + "model.PauseDeploymentResponse": { + "type": "object", + "properties": { + "deploymentName": { + "description": "Deployment名称", + "type": "string" + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "status": { + "description": "当前状态", + "type": "string" + }, + "success": { + "description": "是否暂停成功", + "type": "boolean" + } + } + }, + "model.PodCondition": { + "type": "object", + "properties": { + "lastTransitionTime": { + "description": "最后转换时间", + "type": "string" + }, + "message": { + "description": "消息", + "type": "string" + }, + "reason": { + "description": "原因", + "type": "string" + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "条件类型", + "type": "string" + } + } + }, + "model.PodInfo": { + "type": "object", + "properties": { + "cpuUsage": { + "type": "string" + }, + "memUsage": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "model.PodMetrics": { + "type": "object", + "properties": { + "allocated": { + "description": "已分配的Pod数量", + "type": "integer" + }, + "total": { + "description": "总的Pod容量", + "type": "integer" + } + } + }, + "model.PodMetricsInfo": { + "type": "object", + "properties": { + "containers": { + "description": "容器监控信息列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerMetricsInfo" + } + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "nodeName": { + "description": "节点名称", + "type": "string" + }, + "podName": { + "description": "Pod名称", + "type": "string" + }, + "resourceQuota": { + "description": "资源配额信息", + "allOf": [ + { + "$ref": "#/definitions/model.PodResourceQuota" + } + ] + }, + "timestamp": { + "description": "采集时间", + "type": "string" + }, + "totalUsage": { + "description": "总使用量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "usageRate": { + "description": "使用率信息", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsageRate" + } + ] + } + } + }, + "model.PodMetricsSummary": { + "type": "object", + "properties": { + "namespace": { + "description": "命名空间", + "type": "string" + }, + "podName": { + "description": "Pod名称", + "type": "string" + }, + "usage": { + "description": "资源使用量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "usageRate": { + "description": "使用率", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsageRate" + } + ] + } + } + }, + "model.PodResourceInfo": { + "type": "object", + "properties": { + "limits": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "requests": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.PodResourceQuota": { + "type": "object", + "properties": { + "limits": { + "description": "资源限制量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + }, + "requests": { + "description": "资源请求量", + "allOf": [ + { + "$ref": "#/definitions/model.ResourceUsage" + } + ] + } + } + }, + "model.PodTemplateSpec": { + "type": "object", + "required": [ + "containers" + ], + "properties": { + "containers": { + "description": "容器规格", + "type": "array", + "items": { + "$ref": "#/definitions/model.ContainerSpec" + } + }, + "labels": { + "description": "Pod标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "nodeSelector": { + "description": "节点选择器", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "tolerations": { + "description": "容忍度", + "type": "array", + "items": { + "$ref": "#/definitions/model.Toleration" + } + }, + "volumes": { + "description": "存储卷规格", + "type": "array", + "items": { + "$ref": "#/definitions/model.VolumeSpec" + } + } + } + }, + "model.QuickDeployment": { + "type": "object", + "properties": { + "business_dept_id": { + "description": "业务部门ID", + "type": "integer" + }, + "business_group_id": { + "description": "业务组ID", + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "creator_id": { + "description": "创建人ID", + "type": "integer" + }, + "creator_name": { + "description": "创建人姓名", + "type": "string" + }, + "description": { + "description": "发布描述", + "type": "string" + }, + "duration": { + "description": "发布耗时(秒)", + "type": "integer" + }, + "end_time": { + "description": "结束发布时间", + "type": "string" + }, + "execution_mode": { + "description": "执行模式: 1=并行 2=串行", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "start_time": { + "description": "开始发布时间", + "type": "string" + }, + "status": { + "description": "发布状态: 1=待发布 2=发布中 3=发布成功 4=发布失败 5=已取消", + "type": "integer" + }, + "task_count": { + "description": "任务数量,记录用户提交的发布任务数量", + "type": "integer" + }, + "tasks": { + "description": "关联的发布任务", + "type": "array", + "items": { + "$ref": "#/definitions/model.QuickDeploymentTask" + } + }, + "title": { + "description": "发布标题", + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "model.QuickDeploymentAppRequest": { + "type": "object", + "required": [ + "app_id", + "environment" + ], + "properties": { + "app_id": { + "description": "应用ID(按数组顺序执行)", + "type": "integer" + }, + "environment": { + "description": "应用发布环境", + "type": "string" + } + } + }, + "model.QuickDeploymentListResponse": { + "type": "object", + "properties": { + "list": { + "description": "列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.QuickDeployment" + } + }, + "total": { + "description": "总数", + "type": "integer" + } + } + }, + "model.QuickDeploymentTask": { + "type": "object", + "properties": { + "app_code": { + "description": "应用编码", + "type": "string" + }, + "app_id": { + "description": "应用ID", + "type": "integer" + }, + "app_name": { + "description": "应用名称", + "type": "string" + }, + "application": { + "description": "关联", + "allOf": [ + { + "$ref": "#/definitions/model.Application" + } + ] + }, + "build_number": { + "description": "构建编号", + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "deployment_id": { + "description": "发布ID", + "type": "integer" + }, + "duration": { + "description": "任务耗时(秒)", + "type": "integer" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "environment": { + "description": "环境名称", + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "execute_order": { + "description": "执行顺序", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "jenkins_env": { + "$ref": "#/definitions/model.JenkinsEnv" + }, + "jenkins_env_id": { + "description": "Jenkins环境配置ID", + "type": "integer" + }, + "jenkins_job_url": { + "description": "Jenkins任务URL", + "type": "string" + }, + "log_url": { + "description": "日志URL", + "type": "string" + }, + "start_time": { + "description": "任务开始时间", + "type": "string" + }, + "status": { + "description": "任务状态: 1=未部署 2=部署中 3=成功 4=异常", + "type": "integer" + }, + "updated_at": { + "type": "string" + } + } + }, + "model.ResumeDeploymentResponse": { + "type": "object", + "properties": { + "deploymentName": { + "description": "Deployment名称", + "type": "string" + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "status": { + "description": "当前状态", + "type": "string" + }, + "success": { + "description": "是否恢复成功", + "type": "boolean" + } + } + }, + "model.RollbackDeploymentRequest": { + "type": "object", + "properties": { + "toRevision": { + "description": "目标版本号,0表示回滚到上一版本", + "type": "integer" + } + } + }, + "model.RollbackDeploymentResponse": { + "type": "object", + "properties": { + "deploymentName": { + "description": "Deployment名称", + "type": "string" + }, + "fromRevision": { + "description": "回滚前版本号", + "type": "integer" + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "rolloutStatus": { + "description": "滚动发布状态", + "type": "string" + }, + "success": { + "description": "是否回滚成功", + "type": "boolean" + }, + "toRevision": { + "description": "回滚后版本号", + "type": "integer" + } + } + }, + "model.RollingUpdateDeployment": { + "type": "object", + "properties": { + "maxSurge": { + "description": "最大激增数量", + "type": "string" + }, + "maxUnavailable": { + "description": "最大不可用数量", + "type": "string" + } + } + }, + "model.ServiceDetail": { + "type": "object", + "properties": { + "clusterIP": { + "description": "集群IP", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "endpoints": { + "description": "端点信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceEndpoint" + } + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "externalIPs": { + "description": "外部IP列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "服务名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "pods": { + "description": "关联的Pod列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sPodInfo" + } + }, + "ports": { + "description": "端口配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServicePort" + } + }, + "selector": { + "description": "选择器", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "spec": { + "description": "完整规格配置" + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "服务类型 ClusterIP/NodePort/LoadBalancer/ExternalName", + "type": "string" + } + } + }, + "model.ServiceEndpoint": { + "type": "object", + "properties": { + "hostname": { + "description": "主机名", + "type": "string" + }, + "ip": { + "description": "端点IP", + "type": "string" + }, + "nodeName": { + "description": "节点名称", + "type": "string" + }, + "ports": { + "description": "端口信息", + "type": "array", + "items": { + "$ref": "#/definitions/model.EndpointPort" + } + }, + "ready": { + "description": "就绪状态", + "type": "boolean" + } + } + }, + "model.ServiceJenkinsEnv": { + "type": "object", + "properties": { + "env_name": { + "description": "环境名称", + "type": "string" + }, + "id": { + "description": "环境配置ID", + "type": "integer" + }, + "is_configured": { + "description": "是否已配置完整", + "type": "boolean" + }, + "jenkins_server_id": { + "description": "Jenkins服务器ID", + "type": "integer" + }, + "job_name": { + "description": "Jenkins任务名称", + "type": "string" + } + } + }, + "model.ServiceListResponse": { + "type": "object", + "properties": { + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sService" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.ServicePort": { + "type": "object", + "properties": { + "name": { + "description": "端口名称", + "type": "string" + }, + "nodePort": { + "description": "节点端口(NodePort类型时使用)", + "type": "integer" + }, + "port": { + "description": "服务端口", + "type": "integer" + }, + "protocol": { + "description": "协议 TCP/UDP", + "type": "string" + }, + "targetPort": { + "description": "目标端口", + "type": "string" + } + } + }, + "model.ServicePortSpec": { + "type": "object", + "required": [ + "port", + "protocol" + ], + "properties": { + "name": { + "description": "端口名称", + "type": "string" + }, + "nodePort": { + "description": "节点端口(NodePort类型时使用)", + "type": "integer" + }, + "port": { + "description": "服务端口", + "type": "integer" + }, + "protocol": { + "description": "协议", + "type": "string" + }, + "targetPort": { + "description": "目标端口", + "type": "string" + } + } + }, + "model.ServiceStats": { + "type": "object", + "properties": { + "businessLines": { + "description": "业务线数量", + "type": "integer" + }, + "total": { + "description": "服务总数", + "type": "integer" + } + } + }, + "model.ServiceTreeNode": { + "type": "object", + "properties": { + "business_dept_id": { + "description": "业务部门ID", + "type": "integer" + }, + "business_dept_name": { + "description": "业务部门名称", + "type": "string" + }, + "code": { + "description": "应用编码", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "应用ID", + "type": "integer" + }, + "jenkins_envs": { + "description": "Jenkins环境配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServiceJenkinsEnv" + } + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "programming_lang": { + "description": "编程语言", + "type": "string" + }, + "status": { + "description": "应用状态", + "type": "integer" + }, + "status_text": { + "description": "状态文本", + "type": "string" + } + } + }, + "model.UpdateIngressRequest": { + "type": "object", + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "class": { + "description": "Ingress类", + "type": "string" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "rules": { + "description": "路由规则", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressRuleSpec" + } + }, + "tls": { + "description": "TLS配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.IngressTLSSpec" + } + } + } + }, + "model.UpdateNamespaceRequest": { + "type": "object", + "properties": { + "annotations": { + "description": "注释", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.UpdatePVCRequest": { + "type": "object", + "properties": { + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "resources": { + "description": "资源配置", + "allOf": [ + { + "$ref": "#/definitions/model.PVCResourcesSpec" + } + ] + } + } + }, + "model.UpdatePVRequest": { + "type": "object", + "properties": { + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "reclaimPolicy": { + "description": "回收策略", + "type": "string" + } + } + }, + "model.UpdatePodYAMLRequest": { + "type": "object", + "required": [ + "yamlContent" + ], + "properties": { + "dryRun": { + "description": "是否只进行校验不实际更新", + "type": "boolean" + }, + "force": { + "description": "是否强制更新(删除重建)", + "type": "boolean" + }, + "validateOnly": { + "description": "是否只校验YAML格式", + "type": "boolean" + }, + "yamlContent": { + "description": "YAML内容", + "type": "string" + } + } + }, + "model.UpdatePodYAMLResponse": { + "type": "object", + "properties": { + "changes": { + "description": "变更说明", + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "Pod所在的命名空间", + "type": "string" + }, + "podName": { + "description": "更新的Pod名称", + "type": "string" + }, + "success": { + "description": "是否更新成功", + "type": "boolean" + }, + "updateStrategy": { + "description": "更新策略 (patch/recreate)", + "type": "string" + }, + "validationResult": { + "description": "校验结果(DryRun时返回)", + "allOf": [ + { + "$ref": "#/definitions/model.ValidateYAMLResponse" + } + ] + }, + "warnings": { + "description": "警告信息", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.UpdateServiceRequest": { + "type": "object", + "properties": { + "externalIPs": { + "description": "外部IP列表", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "ports": { + "description": "端口配置", + "type": "array", + "items": { + "$ref": "#/definitions/model.ServicePortSpec" + } + }, + "selector": { + "description": "选择器", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "服务类型", + "type": "string" + } + } + }` diff --git a/dodevops-api/docs/monitor/monitor_docs.go b/dodevops-api/docs/monitor/monitor_docs.go new file mode 100644 index 0000000..faf8ff7 --- /dev/null +++ b/dodevops-api/docs/monitor/monitor_docs.go @@ -0,0 +1,617 @@ +package docsmonitor + +const MonitorPaths = ` + "/api/v1/monitor/agent/delete/{id}": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定的agent数据,用于服务器离线无法正常卸载的情况", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "删除agent数据", + "parameters": [ + { + "type": "integer", + "description": "Agent ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/deploy": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "自动编译agent二进制文件,拷贝到目标主机并启动服务,单个主机传[hostId],多个主机传[hostId1,hostId2,hostId3]", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "部署agent到指定主机(支持单个或多个)", + "parameters": [ + { + "description": "部署参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.BatchDeployAgentDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/heartbeat": { + "post": { + "description": "Agent主动上报心跳信息,通过IP自动识别主机", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "更新Agent心跳", + "parameters": [ + { + "description": "心跳数据", + "name": "heartbeat", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AgentHeartbeatDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取所有Agent的列表信息,支持分页和筛选", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取Agent列表", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "hostId", + "in": "query" + }, + { + "type": "integer", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "页大小", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/restart/{id}": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "重启指定主机上的agent服务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "重启agent", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取Agent的统计信息,包括各状态数量、平台分布等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取Agent统计信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/status/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定主机上agent的运行状态、版本信息等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取agent状态", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/agent/uninstall": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "停止agent服务并删除相关文件,单个主机传[hostId],多个主机传[hostId1,hostId2,hostId3]", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "卸载指定主机的agent(支持单个或多个)", + "parameters": [ + { + "description": "卸载参数(只需hostIds字段)", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.BatchDeployAgentDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/host/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取主机的CPU、内存、磁盘使用率", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取主机监控数据", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/hosts": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "批量获取主机的CPU、内存、磁盘使用率", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "批量获取主机监控数据,主机ID列表,逗号分隔,如:1,2,3", + "parameters": [ + { + "type": "string", + "description": "主机ID列表,逗号分隔,如:1,2,3", + "name": "ids", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/hosts/{id}/all-metrics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取主机的CPU、内存、磁盘、网络等所有指标的历史数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取主机所有指标历史数据", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "example": "\"2025-08-02 15:00:00\"", + "description": "开始时间(格式: 2025-08-02 15:00:00)", + "name": "start", + "in": "query" + }, + { + "type": "string", + "example": "\"2025-08-02 16:00:00\"", + "description": "结束时间(格式: 2025-08-02 16:00:00)", + "name": "end", + "in": "query" + }, + { + "type": "string", + "example": "\"1h\"", + "description": "时间范围(30m/1h/3h/6h/12h/24h)", + "name": "duration", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/hosts/{id}/history": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取主机的CPU、内存、磁盘使用率历史数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取主机指标历史数据-CPU、内存、磁盘", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "指标类型(cpu/memory/disk)", + "name": "metric", + "in": "query" + }, + { + "type": "string", + "example": "\"2025-08-02 15:00:00\"", + "description": "开始时间(格式: 2025-08-02 15:00:00)", + "name": "start", + "in": "query" + }, + { + "type": "string", + "example": "\"2025-08-02 16:00:00\"", + "description": "结束时间(格式: 2025-08-02 16:00:00)", + "name": "end", + "in": "query" + }, + { + "type": "string", + "example": "\"1h\"", + "description": "时间范围(30m/1h/3h/6h/12h/24h)", + "name": "duration", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/hosts/{id}/ports": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取主机所有TCP端口的监听状态、服务名称和进程信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取主机端口信息", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/monitor/hosts/{id}/top-processes": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取主机CPU和内存使用率前5名的进程信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "监控" + ], + "summary": "获取主机TOP进程使用率", + "parameters": [ + { + "type": "integer", + "description": "主机ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const MonitorDefinitions = ` + "model.MonitoringInfo": { + "type": "object", + "properties": { + "cpu": { + "description": "CPU监控", + "allOf": [ + { + "$ref": "#/definitions/model.ClusterResourceMetrics" + } + ] + }, + "memory": { + "description": "内存监控", + "allOf": [ + { + "$ref": "#/definitions/model.ClusterResourceMetrics" + } + ] + }, + "network": { + "description": "网络监控", + "allOf": [ + { + "$ref": "#/definitions/model.NetworkMetrics" + } + ] + }, + "storage": { + "description": "存储监控", + "allOf": [ + { + "$ref": "#/definitions/model.StorageMetrics" + } + ] + } + } + }` diff --git a/dodevops-api/docs/scheduler_crash_fix.md b/dodevops-api/docs/scheduler_crash_fix.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/swagger.json b/dodevops-api/docs/swagger.json old mode 100644 new mode 100755 index 0f2f482..71c8b88 --- a/dodevops-api/docs/swagger.json +++ b/dodevops-api/docs/swagger.json @@ -7688,6 +7688,12 @@ "name": "variables", "in": "formData" }, + { + "type": "string", + "description": "playbook路径JSON数组(type=2时使用,如[\"site.yml\",\"deploy/app.yml\"])", + "name": "playbooks", + "in": "formData" + }, { "type": "file", "description": "playbook文件(type=1时上传)", diff --git a/dodevops-api/docs/swagger.yaml b/dodevops-api/docs/swagger.yaml old mode 100644 new mode 100755 index 99ca24d..0f29068 --- a/dodevops-api/docs/swagger.yaml +++ b/dodevops-api/docs/swagger.yaml @@ -11478,6 +11478,10 @@ paths: in: formData name: variables type: string + - description: playbook路径JSON数组(type=2时使用,如["site.yml","deploy/app.yml"]) + in: formData + name: playbooks + type: string - description: playbook文件(type=1时上传) in: formData name: playbooks diff --git a/dodevops-api/docs/swagger_model.go b/dodevops-api/docs/swagger_model.go old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/sync_schedule_example.md b/dodevops-api/docs/sync_schedule_example.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/system/system_docs.go b/dodevops-api/docs/system/system_docs.go new file mode 100644 index 0000000..e6bea97 --- /dev/null +++ b/dodevops-api/docs/system/system_docs.go @@ -0,0 +1,14533 @@ +package docssystem + +const SystemPaths = ` + + "/api/v1/admin/add": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "新增用户接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "新增用户接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AddSysAdminDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id删除用户接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAdminIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id查询用户接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id查询用户接口", + "parameters": [ + { + "type": "integer", + "description": "Id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页获取用户列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "分页获取用户列表接口", + "parameters": [ + { + "type": "integer", + "description": "分页数", + "name": "pageNum", + "in": "query" + }, + { + "type": "integer", + "description": "每页数", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户名", + "name": "username", + "in": "query" + }, + { + "type": "string", + "description": "帐号启用状态:1-\u003e启用,2-\u003e禁用", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "beginTime", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "endTime", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/update": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改用户接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改用户接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSysAdminDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/updatePassword": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "重置密码接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "重置密码接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ResetSysAdminPasswordDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/updatePersonal": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改个人信息接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改个人信息接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdatePersonalDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/updatePersonalPassword": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改用户密码接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改用户密码接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdatePersonalPasswordDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/admin/updateStatus": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "用户状态启用/停用接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "用户状态启用/停用接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSysAdminStatusDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/captcha": { + "get": { + "description": "验证码接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "验证码接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/add": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "新增部门接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "新增部门接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysDept" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除部门接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id删除部门接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysDeptIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id查询部门接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id查询部门接口", + "parameters": [ + { + "type": "integer", + "description": "ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询部门列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "查询部门列表接口", + "parameters": [ + { + "type": "string", + "description": "部门名称", + "name": "deptName", + "in": "query" + }, + { + "type": "string", + "description": "部门状态", + "name": "deptStatus", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/update": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改部门接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改部门接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysDept" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/users": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取某部门下的所有用户", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "获取某部门下的所有用户接口", + "parameters": [ + { + "type": "integer", + "description": "部门ID", + "name": "deptId", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/dept/vo/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "部门下拉列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "部门下拉列表接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/login": { + "post": { + "description": "用户登录接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "用户登录接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.LoginDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/menu/add": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "新增菜单接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "新增菜单接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysMenu" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/menu/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除菜单接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id删除菜单接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysMenuIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/menu/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id查询菜单", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id查询菜单", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/menu/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询菜单列表", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "查询菜单列表", + "parameters": [ + { + "type": "string", + "description": "菜单名称", + "name": "menuName", + "in": "query" + }, + { + "type": "string", + "description": "菜单状态", + "name": "menuStatus", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/menu/update": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改菜单接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改菜单接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysMenu" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/menu/vo/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询新增选项列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "查询新增选项列表接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/add": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "新增岗位接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "新增岗位接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysPost" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/batch/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "批量删除岗位接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "批量删除岗位接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.DelSysPostDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除岗位接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id删除岗位接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysPostIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id查询岗位", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id查询岗位", + "parameters": [ + { + "type": "integer", + "description": "ID", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页查询岗位列表", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "分页查询岗位列表", + "parameters": [ + { + "type": "integer", + "description": "分页数", + "name": "pageNum", + "in": "query" + }, + { + "type": "integer", + "description": "每页数", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "岗位名称", + "name": "postName", + "in": "query" + }, + { + "type": "string", + "description": "状态:1-\u003e启用,2-\u003e禁用", + "name": "postStatus", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "beginTime", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "endTime", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/update": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改岗位接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改岗位接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysPost" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/updateStatus": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "岗位状态修改接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "岗位状态修改接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSysPostStatusDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/post/vo/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "岗位下拉列表", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "岗位下拉列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/add": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "新增角色接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "新增角色接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AddSysRoleDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/assignPermissions": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分配权限接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "分配权限接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.RoleMenu" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除角色接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id删除角色接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysRoleIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id查询角色接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id查询角色接口", + "parameters": [ + { + "type": "integer", + "description": "Id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页查询角色列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "分页查询角色列表接口", + "parameters": [ + { + "type": "integer", + "description": "分页数", + "name": "pageNum", + "in": "query" + }, + { + "type": "integer", + "description": "每页数", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "角色名称", + "name": "roleName", + "in": "query" + }, + { + "type": "string", + "description": "帐号启用状态:1-\u003e启用,2-\u003e禁用", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "beginTime", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "endTime", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/update": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改角色", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "修改角色", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSysRoleDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/updateStatus": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "角色状态启用/停用接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "角色状态启用/停用接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSysRoleStatusDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/vo/idList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据角色id查询菜单数据接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据角色id查询菜单数据接口", + "parameters": [ + { + "type": "integer", + "description": "Id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/role/vo/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "角色下拉列表", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "角色下拉列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysLoginInfo/batch/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "批量删除登录日志接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "批量删除登录日志接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.DelSysLoginInfoDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysLoginInfo/clean": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "清空登录日志接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "清空登录日志接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysLoginInfo/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据ID删除登录日志接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据ID删除登录日志接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysLoginInfoIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysLoginInfo/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页获取登录日志列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "分页获取登录日志列表接口", + "parameters": [ + { + "type": "integer", + "description": "分页数", + "name": "pageNum", + "in": "query" + }, + { + "type": "integer", + "description": "每页数", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户名", + "name": "username", + "in": "query" + }, + { + "type": "string", + "description": "登录状态(1-成功 2-失败)", + "name": "loginStatus", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "beginTime", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "endTime", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysOperationLog/batch/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "批量删除操作日志接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "批量删除操作日志接口", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.BatchDeleteSysOperationLogDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysOperationLog/clean": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "清空操作日志接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "清空操作日志接口", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysOperationLog/delete": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据id删除操作日志", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "根据id删除操作日志", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationLogIdDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/sysOperationLog/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分页获取操作日志列表接口", + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "分页获取操作日志列表接口", + "parameters": [ + { + "type": "integer", + "description": "每页数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "分页数", + "name": "pageNum", + "in": "query" + }, + { + "type": "string", + "description": "用户名", + "name": "username", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "beginTime", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "endTime", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/upload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "单图片上传接口", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "System系统管理" + ], + "summary": "单图片上传接口", + "parameters": [ + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/apps": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取应用列表,支持分页和筛选", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "获取应用列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页数量", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "应用名称(模糊查询)", + "name": "name", + "in": "query" + }, + { + "type": "string", + "description": "应用编码(模糊查询)", + "name": "code", + "in": "query" + }, + { + "type": "string", + "description": "应用类型", + "name": "app_type", + "in": "query" + }, + { + "type": "integer", + "description": "状态", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ApplicationListResponse" + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建新的应用,应用编码(code)为可选参数,不提供则根据应用名称自动生成", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "创建应用", + "parameters": [ + { + "description": "创建应用请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateApplicationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.Application" + } + } + } + ] + } + } + } + } + }, + "/apps/business-group-options": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取业务组和业务部门的树形选择器数据,支持二级分组", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ServiceTree" + ], + "summary": "获取业务组选项", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/applications": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据业务组、部门和环境获取可发布的应用列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "获取可发布的应用列表", + "parameters": [ + { + "type": "integer", + "description": "业务组ID", + "name": "business_group_id", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "业务部门ID", + "name": "business_dept_id", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "环境名称", + "name": "environment", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ApplicationForDeployment" + } + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/execute": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "启动快速发布流程,支持串行或并行执行模式", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "执行快速发布", + "parameters": [ + { + "description": "执行快速发布请求,支持选择执行模式", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ExecuteQuickDeploymentRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速发布列表,支持分页和筛选", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "获取快速发布列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页数量", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "业务组ID", + "name": "business_group_id", + "in": "query" + }, + { + "type": "integer", + "description": "业务部门ID", + "name": "business_dept_id", + "in": "query" + }, + { + "type": "string", + "description": "环境名称", + "name": "environment", + "in": "query" + }, + { + "type": "integer", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "创建人ID", + "name": "creator_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.QuickDeploymentListResponse" + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/quick": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建快速发布流程,包含多个应用的发布任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "创建快速发布", + "parameters": [ + { + "description": "创建快速发布请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateQuickDeploymentRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.QuickDeployment" + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/tasks/{task_id}/log": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速发布任务的Jenkins构建日志", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "获取任务构建日志", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "task_id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 0, + "description": "日志起始位置", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/tasks/{task_id}/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速发布任务的实时状态信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "获取任务状态", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "task_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TaskStatusResponse" + } + } + } + ] + } + } + } + } + }, + "/apps/deployment/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速发布详情,包含所有任务信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "QuickDeployment" + ], + "summary": "获取快速发布详情", + "parameters": [ + { + "type": "integer", + "description": "发布ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.QuickDeployment" + } + } + } + ] + } + } + } + } + }, + "/apps/environment": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定应用在指定环境的详细配置信息,包括Jenkins配置状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "获取应用环境配置", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "app_id", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "环境名称", + "name": "environment", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AppEnvironmentResponse" + } + } + } + ] + } + } + } + } + }, + "/apps/jenkins-job/validate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "验证指定Jenkins服务器中是否存在指定的任务名称", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "验证Jenkins任务是否存在", + "parameters": [ + { + "description": "验证Jenkins任务请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ValidateJenkinsJobRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ValidateJenkinsJobResponse" + } + } + } + ] + } + } + } + } + }, + "/apps/jenkins-servers": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取所有类型为Jenkins(type=4)的服务器配置信息,用于Jenkins环境配置选择", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "获取Jenkins服务器列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsServerOption" + } + } + } + } + ] + } + } + } + } + }, + "/apps/service-tree": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据业务线查询服务,按业务线重新组装排序服务,类似于服务树结构", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ServiceTree" + ], + "summary": "获取业务线服务树", + "parameters": [ + { + "type": "array", + "items": { + "type": "integer" + }, + "collectionFormat": "csv", + "description": "业务组ID列表,为空则查询所有", + "name": "business_group_ids", + "in": "query" + }, + { + "type": "integer", + "description": "应用状态筛选,为空则查询所有状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "环境名称筛选,为空则不筛选环境配置", + "name": "environment", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BusinessLineServiceTree" + } + } + } + } + ] + } + } + } + } + }, + "/apps/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据应用ID获取应用详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "获取应用详情", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.Application" + } + } + } + ] + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新应用信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "更新应用", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "更新应用请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateApplicationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.Application" + } + } + } + ] + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定的应用", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "删除应用", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + } + } + } + }, + "/apps/{id}/jenkins-envs": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据应用ID获取所有Jenkins环境配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "JenkinsEnv" + ], + "summary": "获取应用的所有Jenkins环境配置", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsEnv" + } + } + } + } + ] + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "为指定应用添加新的Jenkins环境配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "为应用添加Jenkins环境配置", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "Jenkins环境配置请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateJenkinsEnvRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsEnv" + } + } + } + ] + } + } + } + } + }, + "/apps/{id}/jenkins-envs/{env_id}": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新指定应用的Jenkins环境配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "更新应用的Jenkins环境配置", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Jenkins环境配置ID", + "name": "env_id", + "in": "path", + "required": true + }, + { + "description": "更新Jenkins环境配置请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateJenkinsEnvRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsEnv" + } + } + } + ] + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除指定应用的Jenkins环境配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Application" + ], + "summary": "删除应用的Jenkins环境配置", + "parameters": [ + { + "type": "integer", + "description": "应用ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Jenkins环境配置ID", + "name": "env_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + } + } + } + }, + "/jenkins/servers": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取所有配置的Jenkins服务器", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins服务器列表", + "parameters": [ + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页数量", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsServerListResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/servers/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据服务器ID获取Jenkins服务器详情", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins服务器详情", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsServerInfo" + } + } + } + ] + } + } + } + } + }, + "/jenkins/test-connection": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "测试Jenkins服务器连接是否正常", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "测试Jenkins连接", + "parameters": [ + { + "description": "连接测试请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.TestJenkinsConnectionRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TestJenkinsConnectionResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定Jenkins服务器的所有任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins任务列表", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsJobListResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据关键词模糊搜索指定Jenkins服务器的任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "搜索Jenkins任务", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "搜索关键词", + "name": "keyword", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsJobListResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs/{jobName}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定任务的详细信息和构建历史", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins任务详情", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "任务名称", + "name": "jobName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsJobDetailResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs/{jobName}/builds/{buildNumber}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定构建的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins构建详情", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "任务名称", + "name": "jobName", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "构建编号", + "name": "buildNumber", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsBuildDetailResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs/{jobName}/builds/{buildNumber}/log": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定构建的日志信息,支持分页获取", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins构建日志", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "任务名称", + "name": "jobName", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "构建编号", + "name": "buildNumber", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 0, + "description": "开始位置", + "name": "start", + "in": "query" + }, + { + "type": "boolean", + "default": false, + "description": "是否返回HTML格式", + "name": "html", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.GetBuildLogResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs/{jobName}/builds/{buildNumber}/stop": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "停止指定的Jenkins构建任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "停止Jenkins构建", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "任务名称", + "name": "jobName", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "构建编号", + "name": "buildNumber", + "in": "path", + "required": true + }, + { + "description": "停止构建请求", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/model.StopBuildRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.StopBuildResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/jobs/{jobName}/start": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "启动指定的Jenkins任务,支持带参数构建", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "启动Jenkins任务", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "任务名称", + "name": "jobName", + "in": "path", + "required": true + }, + { + "description": "启动任务请求", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/model.StartJobRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.StartJobResponse" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/queue": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定Jenkins服务器的构建队列信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins队列信息", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsQueue" + } + } + } + ] + } + } + } + } + }, + "/jenkins/{serverId}/system-info": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取指定Jenkins服务器的系统信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Jenkins" + ], + "summary": "获取Jenkins系统信息", + "parameters": [ + { + "type": "integer", + "description": "服务器ID", + "name": "serverId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.JenkinsSystemInfo" + } + } + } + ] + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/configmaps": { + "get": { + "description": "获取指定集群和命名空间下的ConfigMap列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "获取ConfigMap列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页大小", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigMapListResponse" + } + } + } + ] + } + } + } + }, + "post": { + "description": "创建新的ConfigMap", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "创建ConfigMap", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "创建ConfigMap请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateConfigMapRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sConfigMap" + } + } + } + ] + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/configmaps/{configMapName}": { + "get": { + "description": "获取指定ConfigMap的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "获取ConfigMap详情", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ConfigMap名称", + "name": "configMapName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigMapDetail" + } + } + } + ] + } + } + } + }, + "put": { + "description": "更新指定的ConfigMap", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "更新ConfigMap", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ConfigMap名称", + "name": "configMapName", + "in": "path", + "required": true + }, + { + "description": "更新ConfigMap请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateConfigMapRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sConfigMap" + } + } + } + ] + } + } + } + }, + "delete": { + "description": "删除指定的ConfigMap", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "删除ConfigMap", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ConfigMap名称", + "name": "configMapName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/configmaps/{configMapName}/yaml": { + "get": { + "description": "获取指定ConfigMap的YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "获取ConfigMap YAML", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ConfigMap名称", + "name": "configMapName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + } + } + }, + "put": { + "description": "通过YAML更新ConfigMap配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "更新ConfigMap YAML", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ConfigMap名称", + "name": "configMapName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "request", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sConfigMap" + } + } + } + ] + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments": { + "post": { + "description": "在指定命名空间中创建新的Deployment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment管理" + ], + "summary": "创建Deployment", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "Deployment配置", + "name": "deployment", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateDeploymentRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sWorkload" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}": { + "put": { + "description": "更新指定的Deployment配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment管理" + ], + "summary": "更新Deployment", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + }, + { + "description": "更新配置", + "name": "deployment", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateWorkloadRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sWorkload" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的Deployment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment管理" + ], + "summary": "删除Deployment", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/history": { + "get": { + "description": "获取指定Deployment的所有版本历史信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment版本管理" + ], + "summary": "获取Deployment版本历史", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DeploymentRolloutHistoryResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/pause": { + "post": { + "description": "暂停正在进行的Deployment滚动更新过程", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment版本管理" + ], + "summary": "暂停Deployment滚动更新", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.PauseDeploymentResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/restart": { + "post": { + "description": "通过更新Pod模板来重启Deployment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment管理" + ], + "summary": "重启Deployment", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/resume": { + "post": { + "description": "恢复被暂停的Deployment滚动更新过程", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment版本管理" + ], + "summary": "恢复Deployment滚动更新", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ResumeDeploymentResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/revisions/{revision}": { + "get": { + "description": "获取指定Deployment特定版本的详细配置信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment版本管理" + ], + "summary": "获取Deployment指定版本详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "版本号", + "name": "revision", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DeploymentRevisionDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/rollback": { + "post": { + "description": "将Deployment回滚到指定的历史版本", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment版本管理" + ], + "summary": "回滚Deployment到指定版本", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + }, + { + "description": "回滚请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.RollbackDeploymentRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.RollbackDeploymentResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/rollout-status": { + "get": { + "description": "获取指定Deployment的当前滚动发布状态和进度信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment版本管理" + ], + "summary": "获取Deployment滚动发布状态", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DeploymentRolloutStatusResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/deployments/{deploymentName}/scale": { + "post": { + "description": "调整Deployment的副本数", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Deployment管理" + ], + "summary": "伸缩Deployment", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Deployment名称", + "name": "deploymentName", + "in": "path", + "required": true + }, + { + "description": "伸缩配置", + "name": "scale", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ScaleWorkloadRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses": { + "get": { + "description": "获取指定命名空间的Ingress列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "获取Ingress列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.IngressListResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "description": "在指定命名空间中创建新的Ingress", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "创建Ingress", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "Ingress配置", + "name": "ingress", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateIngressRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sIngress" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}": { + "get": { + "description": "获取指定Ingress的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "获取Ingress详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.IngressDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "更新指定的Ingress配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "更新Ingress", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + }, + { + "description": "更新配置", + "name": "ingress", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateIngressRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sIngress" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的Ingress", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "删除Ingress", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}/events": { + "get": { + "description": "获取指定Ingress的相关事件列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "获取Ingress事件", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}/monitoring": { + "get": { + "description": "获取指定Ingress的监控指标和状态信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "获取Ingress监控信息", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/ingresses/{ingressName}/yaml": { + "get": { + "description": "获取指定Ingress的完整YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "获取Ingress的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "通过提供的YAML内容更新Ingress配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Ingress管理" + ], + "summary": "通过YAML更新Ingress", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Ingress名称", + "name": "ingressName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "yaml", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/metrics": { + "get": { + "description": "获取指定命名空间下所有Pod的CPU、内存等监控指标汇总", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s监控" + ], + "summary": "获取命名空间监控指标", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.NamespaceMetricsInfo" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods": { + "get": { + "description": "获取指定命名空间的Pod列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "获取Pod列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/yaml": { + "post": { + "description": "通过提供的YAML内容创建Pod,支持校验模式和DryRun模式", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "通过YAML创建Pod", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "创建请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreatePodFromYAMLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.CreatePodFromYAMLResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}": { + "get": { + "description": "获取指定Pod的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "获取Pod详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sPodDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的Pod", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "删除Pod", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/containers": { + "get": { + "description": "获取指定Pod中所有容器的名称列表,用于终端连接时选择容器", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s容器终端" + ], + "summary": "获取Pod中的容器列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/events": { + "get": { + "description": "获取指定Pod的相关事件列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "获取Pod事件", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/logs": { + "get": { + "description": "获取指定Pod容器的日志", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "获取Pod日志", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "容器名称", + "name": "container", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/metrics": { + "get": { + "description": "获取指定Pod的CPU、内存等监控指标和使用率", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s监控" + ], + "summary": "获取Pod监控指标", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.PodMetricsInfo" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/terminal": { + "get": { + "description": "通过WebSocket连接到指定Pod的终端", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s容器终端" + ], + "summary": "连接到Pod终端", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "容器名称(默认为Pod中第一个容器)", + "name": "containerName", + "in": "query" + }, + { + "type": "string", + "description": "执行命令(默认为/bin/bash)", + "name": "command", + "in": "query" + } + ], + "responses": { + "101": { + "description": "Switching Protocols" + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/yaml": { + "get": { + "description": "获取指定Pod的完整YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "获取Pod的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "通过YAML内容更新指定的Pod配置,支持校验模式和DryRun模式", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "更新Pod的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Pod名称", + "name": "podName", + "in": "path", + "required": true + }, + { + "description": "更新请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdatePodYAMLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.UpdatePodYAMLResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pvcs": { + "get": { + "description": "获取指定命名空间的PVC列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "获取PVC列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.PVCListResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "description": "在指定命名空间中创建新的PVC", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "创建PVC", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "PVC配置", + "name": "pvc", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreatePVCRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sPersistentVolumeClaim" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pvcs/{pvcName}": { + "get": { + "description": "获取指定PVC的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "获取PVC详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PVC名称", + "name": "pvcName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.PVCDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "更新指定的PVC配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "更新PVC", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PVC名称", + "name": "pvcName", + "in": "path", + "required": true + }, + { + "description": "更新配置", + "name": "pvc", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdatePVCRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sPersistentVolumeClaim" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的PVC", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "删除PVC", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PVC名称", + "name": "pvcName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/pvcs/{pvcName}/yaml": { + "get": { + "description": "获取指定PVC的完整YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "获取PVC的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PVC名称", + "name": "pvcName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "通过提供的YAML内容更新PVC配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PVC" + ], + "summary": "通过YAML更新PVC", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PVC名称", + "name": "pvcName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "yaml", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/secrets": { + "get": { + "description": "获取指定集群和命名空间下的Secret列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "获取Secret列表", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 1, + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "default": 10, + "description": "每页大小", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.SecretListResponse" + } + } + } + ] + } + } + } + }, + "post": { + "description": "创建新的Secret", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "创建Secret", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "创建Secret请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateSecretRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sSecret" + } + } + } + ] + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/secrets/{secretName}": { + "get": { + "description": "获取指定Secret的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "获取Secret详情", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret名称", + "name": "secretName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.SecretDetail" + } + } + } + ] + } + } + } + }, + "put": { + "description": "更新指定的Secret", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "更新Secret", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret名称", + "name": "secretName", + "in": "path", + "required": true + }, + { + "description": "更新Secret请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateSecretRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sSecret" + } + } + } + ] + } + } + } + }, + "delete": { + "description": "删除指定的Secret", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "删除Secret", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret名称", + "name": "secretName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/secrets/{secretName}/yaml": { + "get": { + "description": "获取指定Secret的YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "获取Secret YAML", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret名称", + "name": "secretName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + } + } + }, + "put": { + "description": "通过YAML更新Secret配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s配置管理" + ], + "summary": "更新Secret YAML", + "parameters": [ + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret名称", + "name": "secretName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "request", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sSecret" + } + } + } + ] + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/services": { + "get": { + "description": "获取指定命名空间的Service列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "获取Service列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ServiceListResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "description": "在指定命名空间中创建新的Service", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "创建Service", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "Service配置", + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateServiceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sService" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/services/{serviceName}": { + "get": { + "description": "获取指定Service的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "获取Service详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Service名称", + "name": "serviceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ServiceDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "更新指定的Service配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "更新Service", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Service名称", + "name": "serviceName", + "in": "path", + "required": true + }, + { + "description": "更新配置", + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateServiceRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sService" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的Service", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "删除Service", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Service名称", + "name": "serviceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/services/{serviceName}/events": { + "get": { + "description": "获取指定Service的相关事件列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "获取Service事件", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Service名称", + "name": "serviceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/services/{serviceName}/yaml": { + "get": { + "description": "获取指定Service的完整YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "获取Service的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Service名称", + "name": "serviceName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "通过提供的YAML内容更新Service配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s Service管理" + ], + "summary": "通过YAML更新Service", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Service名称", + "name": "serviceName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "yaml", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads": { + "get": { + "description": "获取指定命名空间的工作负载列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s工作负载管理" + ], + "summary": "获取工作负载列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "enum": [ + "deployment", + "statefulset", + "daemonset", + "job", + "cronjob", + "all" + ], + "type": "string", + "description": "工作负载类型", + "name": "type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.WorkloadListResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/yaml": { + "put": { + "description": "通过YAML内容更新指定的工作负载配置,支持deployment,statefulset,daemonset,job,cronjob", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作负载YAML管理" + ], + "summary": "更新工作负载的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "description": "更新请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateWorkloadYAMLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.UpdateWorkloadYAMLResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/{type}/{workloadName}": { + "get": { + "description": "获取指定工作负载的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s工作负载管理" + ], + "summary": "获取工作负载详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "enum": [ + "deployment", + "statefulset", + "daemonset", + "job", + "cronjob" + ], + "type": "string", + "description": "工作负载类型", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "工作负载名称", + "name": "workloadName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sWorkloadDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/{type}/{workloadName}/pods": { + "get": { + "description": "获取指定工作负载下的所有Pod信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Pod管理" + ], + "summary": "获取工作负载下的Pod列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "enum": [ + "deployment", + "statefulset", + "daemonset", + "job", + "cronjob" + ], + "type": "string", + "description": "工作负载类型", + "name": "type", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "工作负载名称", + "name": "workloadName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sPodInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/namespaces/{namespaceName}/workloads/{workloadType}/{workloadName}/yaml": { + "get": { + "description": "获取指定工作负载的完整YAML配置,支持deployment,statefulset,daemonset,job,cronjob", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "工作负载YAML管理" + ], + "summary": "获取工作负载的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "命名空间名称", + "name": "namespaceName", + "in": "path", + "required": true + }, + { + "enum": [ + "deployment", + "statefulset", + "daemonset", + "job", + "cronjob" + ], + "type": "string", + "description": "工作负载类型", + "name": "workloadType", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "工作负载名称", + "name": "workloadName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.GetWorkloadYAMLResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/nodes/{nodeName}/metrics": { + "get": { + "description": "获取指定节点的CPU、内存等监控指标和使用率", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s监控" + ], + "summary": "获取节点监控指标", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "节点名称", + "name": "nodeName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.NodeMetricsInfo" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/pvs": { + "get": { + "description": "获取集群中的PV列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "获取PV列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.PVListResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "description": "在集群中创建新的PV", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "创建PV", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "PV配置", + "name": "pv", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreatePVRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sPersistentVolume" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/pvs/{pvName}": { + "get": { + "description": "获取指定PV的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "获取PV详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PV名称", + "name": "pvName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.PVDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "更新指定的PV配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "更新PV", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PV名称", + "name": "pvName", + "in": "path", + "required": true + }, + { + "description": "更新配置", + "name": "pv", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdatePVRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sPersistentVolume" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的PV", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "删除PV", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PV名称", + "name": "pvName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/pvs/{pvName}/yaml": { + "get": { + "description": "获取指定PV的完整YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "获取PV的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PV名称", + "name": "pvName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "通过提供的YAML内容更新PV配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-PV" + ], + "summary": "通过YAML更新PV", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "PV名称", + "name": "pvName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "yaml", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/storageclasses": { + "get": { + "description": "获取集群中的存储类列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "获取存储类列表", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.StorageClassListResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "description": "在集群中创建新的存储类", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "创建存储类", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "存储类配置", + "name": "storageClass", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateStorageClassRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sStorageClass" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/storageclasses/{storageClassName}": { + "get": { + "description": "获取指定存储类的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "获取存储类详情", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "存储类名称", + "name": "storageClassName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.StorageClassDetail" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "更新指定的存储类配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "更新存储类", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "存储类名称", + "name": "storageClassName", + "in": "path", + "required": true + }, + { + "description": "更新配置", + "name": "storageClass", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateStorageClassRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.K8sStorageClass" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "description": "删除指定的存储类", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "删除存储类", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "存储类名称", + "name": "storageClassName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/storageclasses/{storageClassName}/yaml": { + "get": { + "description": "获取指定存储类的完整YAML配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "获取存储类的YAML配置", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "存储类名称", + "name": "storageClassName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "additionalProperties": true + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "put": { + "description": "通过提供的YAML内容更新存储类配置", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "K8s存储管理-StorageClass" + ], + "summary": "通过YAML更新存储类", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "存储类名称", + "name": "storageClassName", + "in": "path", + "required": true + }, + { + "description": "YAML内容", + "name": "yaml", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": true + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/k8s/cluster/{id}/yaml/validate": { + "post": { + "description": "校验提供的YAML内容是否符合Kubernetes资源规范", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "YAML校验" + ], + "summary": "校验YAML格式", + "parameters": [ + { + "type": "string", + "description": "Bearer 用户Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "integer", + "description": "集群ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "校验请求", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.ValidateYAMLRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/result.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ValidateYAMLResponse" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/queue/clear-failed": { + "post": { + "description": "清空失败任务队列中的所有任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "清空失败队列", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/queue/details": { + "get": { + "description": "获取各个优先级队列的详细信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "获取队列详细信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/queue/metrics": { + "get": { + "description": "获取任务队列的运行指标,包括队列长度、处理统计等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "获取任务队列指标", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/queue/retry-failed": { + "post": { + "description": "将失败队列中的任务重新提交到正常队列", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "重试失败队列中的任务", + "parameters": [ + { + "type": "integer", + "description": "重试任务数量限制,默认10,最大100", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/scheduled/pause": { + "post": { + "description": "暂停正在运行的定时任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "暂停定时任务", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "task_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/scheduled/reset": { + "post": { + "description": "将定时任务的所有子任务状态重置为等待中(1),用于修复状态异常的情况", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "重置定时任务子任务状态", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "task_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/scheduled/resume": { + "post": { + "description": "恢复已暂停的定时任务", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "恢复定时任务", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "task_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/scheduler/stats": { + "get": { + "description": "获取全局调度器的统计信息,包括活跃任务数、下次运行时间等", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "获取调度器统计信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/system/status": { + "get": { + "description": "获取任务队列和调度器的整体运行状态", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "获取任务系统整体状态", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/task/monitor/task/status": { + "get": { + "description": "获取任务的详细状态信息,包括可执行的操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "任务监控" + ], + "summary": "获取任务状态详情", + "parameters": [ + { + "type": "integer", + "description": "任务ID", + "name": "task_id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/result.Result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const SystemDefinitions = ` + "controller.ListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TaskAnsible" + } + }, + "total": { + "type": "integer" + } + } + }, + "controller.SQLRequest": { + "type": "object", + "properties": { + "databaseId": { + "description": "数据库ID", + "type": "integer" + }, + "databaseName": { + "description": "数据库名称", + "type": "string" + }, + "sql": { + "description": "SQL语句", + "type": "string" + } + } + }, + "model.AddLabelRequest": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "model.AddSysAdminDto": { + "type": "object", + "required": [ + "deptId", + "email", + "nickname", + "password", + "phone", + "postId", + "roleId", + "status", + "username" + ], + "properties": { + "deptId": { + "description": "部门id", + "type": "integer" + }, + "email": { + "description": "邮箱", + "type": "string" + }, + "nickname": { + "description": "昵称", + "type": "string" + }, + "note": { + "description": "备注", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "postId": { + "description": "岗位id", + "type": "integer" + }, + "roleId": { + "description": "角色id", + "type": "integer" + }, + "status": { + "description": "状态:1-\u003e启用,2-\u003e禁用", + "type": "integer" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.AddSysRoleDto": { + "type": "object", + "properties": { + "description": { + "description": "描述", + "type": "string" + }, + "roleKey": { + "description": "角色key", + "type": "string" + }, + "roleName": { + "description": "角色名称", + "type": "string" + }, + "status": { + "description": "状态:1-\u003e启用,2-\u003e禁用", + "type": "integer" + } + } + }, + "model.AddTaintRequest": { + "type": "object", + "required": [ + "effect", + "key" + ], + "properties": { + "effect": { + "type": "string", + "enum": [ + "NoSchedule", + "PreferNoSchedule", + "NoExecute" + ] + }, + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "model.AgentHeartbeatDto": { + "type": "object", + "properties": { + "hostname": { + "description": "Agent所在主机的hostname", + "type": "string" + }, + "ip": { + "description": "Agent所在主机的IP地址 (内网IP)", + "type": "string" + }, + "pid": { + "description": "Agent进程ID", + "type": "integer" + }, + "port": { + "description": "Agent监听端口", + "type": "integer" + }, + "token": { + "description": "认证token", + "type": "string" + } + } + }, + "model.AssetCategoryStats": { + "type": "object", + "properties": { + "category": { + "description": "资产分类名称 (主机/数据库/K8s集群)", + "type": "string" + }, + "items": { + "description": "具体资产项统计", + "type": "array", + "items": { + "$ref": "#/definitions/model.AssetItemStats" + } + }, + "total": { + "description": "该分类总数", + "type": "integer" + } + } + }, + "model.AssetItemStats": { + "type": "object", + "properties": { + "count": { + "description": "数量", + "type": "integer" + }, + "name": { + "description": "资产项名称 (自建主机/阿里云/MySQL等)", + "type": "string" + } + } + }, + "model.AssetStats": { + "type": "object", + "properties": { + "categories": { + "description": "资产分类统计", + "type": "array", + "items": { + "$ref": "#/definitions/model.AssetCategoryStats" + } + }, + "totalAssets": { + "description": "总资产数量", + "type": "integer" + } + } + }, + "model.BatchDeleteSysOperationLogDto": { + "type": "object", + "properties": { + "ids": { + "description": "id列表", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "model.BatchDeployAgentDto": { + "type": "object", + "required": [ + "hostIds" + ], + "properties": { + "hostIds": { + "description": "主机ID列表", + "type": "array", + "items": { + "type": "integer" + } + }, + "version": { + "description": "版本", + "type": "string" + } + } + }, + "model.BuildAction": { + "type": "object", + "properties": { + "_class": { + "description": "操作类型", + "type": "string" + } + } + }, + "model.BuildExecutor": { + "type": "object", + "properties": { + "node": { + "description": "节点名称", + "type": "string" + }, + "number": { + "description": "执行器编号", + "type": "integer" + } + } + }, + "model.BusinessDistributionStats": { + "type": "object", + "properties": { + "businessLines": { + "description": "业务线列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.BusinessLineStats" + } + }, + "totalServices": { + "description": "总服务数量", + "type": "integer" + } + } + }, + "model.BusinessLineStats": { + "type": "object", + "properties": { + "id": { + "description": "业务组ID", + "type": "integer" + }, + "name": { + "description": "业务线名称", + "type": "string" + }, + "percentage": { + "description": "占比", + "type": "number" + }, + "serviceCount": { + "description": "服务数量", + "type": "integer" + } + } + }, + "model.ChangeSet": { + "type": "object", + "properties": { + "items": { + "description": "变更项目", + "type": "array", + "items": { + "$ref": "#/definitions/model.ChangeSetItem" + } + }, + "kind": { + "description": "变更类型", + "type": "string" + } + } + }, + "model.ChangeSetItem": { + "type": "object", + "properties": { + "affectedPaths": { + "description": "影响路径", + "type": "array", + "items": { + "type": "string" + } + }, + "author": { + "description": "作者", + "allOf": [ + { + "$ref": "#/definitions/model.User" + } + ] + }, + "comment": { + "description": "提交注释", + "type": "string" + }, + "date": { + "description": "提交日期", + "type": "string" + }, + "id": { + "description": "提交ID", + "type": "string" + }, + "msg": { + "description": "提交消息", + "type": "string" + }, + "timestamp": { + "description": "时间戳", + "type": "integer" + } + } + }, + "model.ClusterDetailResponse": { + "type": "object", + "properties": { + "cluster": { + "$ref": "#/definitions/model.KubeCluster" + }, + "components": { + "description": "安装的组件", + "type": "array", + "items": { + "$ref": "#/definitions/model.ComponentInfo" + } + }, + "events": { + "description": "集群事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.ClusterEvent" + } + }, + "monitoring": { + "description": "监控信息", + "allOf": [ + { + "$ref": "#/definitions/model.MonitoringInfo" + } + ] + }, + "network": { + "description": "网络配置", + "allOf": [ + { + "$ref": "#/definitions/model.NetworkInfo" + } + ] + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/model.NodeInfo" + } + }, + "runtime": { + "description": "运行时信息", + "allOf": [ + { + "$ref": "#/definitions/model.RuntimeSummary" + } + ] + }, + "summary": { + "$ref": "#/definitions/model.ClusterSummary" + }, + "workloads": { + "description": "工作负载统计", + "allOf": [ + { + "$ref": "#/definitions/model.WorkloadSummary" + } + ] + } + } + }, + "model.ClusterEvent": { + "type": "object", + "properties": { + "count": { + "description": "发生次数", + "type": "integer" + }, + "firstTime": { + "description": "首次时间", + "type": "string" + }, + "involvedObject": { + "description": "相关对象", + "type": "string" + }, + "lastTime": { + "description": "最后时间", + "type": "string" + }, + "message": { + "description": "消息", + "type": "string" + }, + "reason": { + "description": "原因", + "type": "string" + }, + "source": { + "description": "事件源", + "type": "string" + }, + "type": { + "description": "事件类型", + "type": "string" + } + } + }, + "model.ClusterSummary": { + "type": "object", + "properties": { + "masterNodes": { + "type": "integer" + }, + "readyNodes": { + "type": "integer" + }, + "totalNodes": { + "type": "integer" + }, + "workerNodes": { + "type": "integer" + } + } + }, + "model.ComponentInfo": { + "type": "object", + "properties": { + "name": { + "description": "组件名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "组件类型 (system/addon)", + "type": "string" + }, + "version": { + "description": "版本", + "type": "string" + } + } + }, + "model.CreateDeployDto": { + "type": "object", + "required": [ + "hostId", + "installDir", + "serviceId", + "version" + ], + "properties": { + "autoStart": { + "description": "是否自动启动", + "type": "boolean" + }, + "envVars": { + "description": "环境变量", + "type": "object", + "additionalProperties": true + }, + "hostId": { + "description": "主机ID", + "type": "integer" + }, + "installDir": { + "description": "安装目录", + "type": "string" + }, + "serviceId": { + "description": "服务ID (如: mysql)", + "type": "string" + }, + "version": { + "description": "版本 (如: 5.7)", + "type": "string" + } + } + }, + "model.CreateEcsPasswordAuthDto": { + "type": "object", + "required": [ + "name", + "password", + "port", + "type", + "username" + ], + "properties": { + "name": { + "description": "凭证名称", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "port": { + "description": "端口号", + "type": "integer" + }, + "publicKey": { + "description": "公钥", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "type": { + "description": "认证类型:1-\u003e密码", + "type": "integer" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.CreateJenkinsEnvRequest": { + "type": "object", + "required": [ + "env_name" + ], + "properties": { + "app_id": { + "description": "应用ID(由控制器自动设置)", + "type": "integer" + }, + "env_name": { + "description": "环境名称", + "type": "string" + }, + "jenkins_server_id": { + "description": "Jenkins服务器ID(关联account_auth表)", + "type": "integer" + }, + "job_name": { + "description": "Jenkins任务名称", + "type": "string" + } + } + }, + "model.CreateKeyManageDto": { + "type": "object", + "required": [ + "keyId", + "keySecret", + "keyType" + ], + "properties": { + "keyId": { + "description": "密钥ID", + "type": "string" + }, + "keySecret": { + "description": "密钥Secret", + "type": "string" + }, + "keyType": { + "description": "云厂商类型:1=阿里云,2=腾讯云,3=百度云,4=华为云,5=AWS云", + "type": "integer" + }, + "remark": { + "description": "备注信息", + "type": "string" + } + } + }, + "model.CreateKubeClusterRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "autoDeploy": { + "description": "是否自动部署", + "type": "boolean" + }, + "clusterType": { + "description": "集群类型:1-自建,2-导入(默认为自建)", + "type": "integer" + }, + "deploymentMode": { + "description": "部署模式:1-单Master,2-多Master", + "type": "integer" + }, + "description": { + "description": "集群描述", + "type": "string" + }, + "enabledComponents": { + "description": "启用组件", + "type": "array", + "items": { + "type": "string" + } + }, + "kubeconfig": { + "description": "导入集群参数", + "type": "string" + }, + "name": { + "description": "集群名称", + "type": "string" + }, + "nodeConfig": { + "description": "节点配置", + "allOf": [ + { + "$ref": "#/definitions/model.NodeConfig" + } + ] + }, + "privateRegistry": { + "description": "私有镜像仓库地址(兼容旧版本)", + "type": "string" + }, + "registryConfig": { + "description": "镜像仓库配置(新版本)", + "allOf": [ + { + "$ref": "#/definitions/model.RegistryConfig" + } + ] + }, + "registryPassword": { + "description": "镜像仓库密码(兼容旧版本)", + "type": "string" + }, + "registryUsername": { + "description": "镜像仓库用户名(兼容旧版本)", + "type": "string" + }, + "taskDescription": { + "description": "任务描述", + "type": "string" + }, + "taskName": { + "description": "任务名称", + "type": "string" + }, + "version": { + "description": "自建集群参数", + "type": "string" + } + } + }, + "model.CreateLimitRangeRequest": { + "type": "object", + "required": [ + "name", + "spec" + ], + "properties": { + "name": { + "description": "LimitRange名称", + "type": "string" + }, + "spec": { + "description": "LimitRange规格", + "allOf": [ + { + "$ref": "#/definitions/model.LimitRangeRequestSpec" + } + ] + } + } + }, + "model.CreateSecretRequest": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "data": { + "description": "数据(base64编码)", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "immutable": { + "description": "是否不可变", + "type": "boolean" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Secret名称", + "type": "string" + }, + "stringData": { + "description": "字符串数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "Secret类型", + "type": "string" + } + } + }, + "model.CreateStorageClassRequest": { + "type": "object", + "required": [ + "name", + "provisioner" + ], + "properties": { + "allowVolumeExpansion": { + "description": "允许卷扩展", + "type": "boolean" + }, + "allowedTopologies": { + "description": "允许的拓扑", + "type": "array", + "items": { + "$ref": "#/definitions/model.StorageClassTopology" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "存储类名称", + "type": "string" + }, + "parameters": { + "description": "参数", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "provisioner": { + "description": "提供者", + "type": "string" + }, + "reclaimPolicy": { + "description": "回收策略", + "type": "string" + }, + "volumeBindingMode": { + "description": "卷绑定模式", + "type": "string" + } + } + }, + "model.CreateSyncScheduleDto": { + "type": "object", + "required": [ + "cronExpr", + "keyTypes", + "name" + ], + "properties": { + "cronExpr": { + "description": "cron表达式", + "type": "string" + }, + "keyTypes": { + "description": "要同步的云厂商类型(JSON数组格式:[1,2,3])", + "type": "string" + }, + "name": { + "description": "配置名称", + "type": "string" + }, + "remark": { + "description": "备注信息", + "type": "string" + }, + "status": { + "description": "状态:1=启用,0=禁用", + "type": "integer" + } + } + }, + "model.DatabaseStats": { + "type": "object", + "properties": { + "byType": { + "description": "按类型统计", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "total": { + "description": "数据库总数", + "type": "integer" + } + } + }, + "model.DelSysLoginInfoDto": { + "type": "object", + "properties": { + "ids": { + "description": "Id列表", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "model.DelSysPostDto": { + "type": "object", + "properties": { + "ids": { + "description": "Id列表", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "model.EcsAuthIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.EcsAuthVo": { + "type": "object", + "properties": { + "createTime": { + "$ref": "#/definitions/util.HTime" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "publicKey": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "type": { + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, + "model.EndpointPort": { + "type": "object", + "properties": { + "name": { + "description": "端口名称", + "type": "string" + }, + "port": { + "description": "端口号", + "type": "integer" + }, + "protocol": { + "description": "协议", + "type": "string" + } + } + }, + "model.EnvVar": { + "type": "object", + "properties": { + "name": { + "description": "变量名", + "type": "string" + }, + "value": { + "description": "变量值", + "type": "string" + } + } + }, + "model.EventInfo": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "firstTime": { + "type": "string" + }, + "lastTime": { + "type": "string" + }, + "message": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "model.EventListResponse": { + "type": "object", + "properties": { + "events": { + "description": "事件列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "filter": { + "description": "过滤条件", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "namespace": { + "description": "命名空间(如果是命名空间级别的查询)", + "type": "string" + }, + "total": { + "description": "事件总数", + "type": "integer" + } + } + }, + "model.GetBuildLogResponse": { + "type": "object", + "properties": { + "buildNumber": { + "description": "构建编号", + "type": "integer" + }, + "hasMore": { + "description": "是否有更多日志", + "type": "boolean" + }, + "jobName": { + "description": "任务名称", + "type": "string" + }, + "log": { + "description": "日志内容", + "type": "string" + }, + "moreData": { + "description": "是否有更多数据", + "type": "boolean" + }, + "server": { + "description": "服务器名称", + "type": "string" + }, + "textSize": { + "description": "文本大小", + "type": "integer" + } + } + }, + "model.GetWorkloadYAMLResponse": { + "type": "object", + "properties": { + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "success": { + "description": "是否获取成功", + "type": "boolean" + }, + "workloadName": { + "description": "工作负载名称", + "type": "string" + }, + "workloadType": { + "description": "工作负载类型", + "type": "string" + }, + "yamlContent": { + "description": "YAML内容", + "type": "string" + } + } + }, + "model.HostStats": { + "type": "object", + "properties": { + "offline": { + "description": "离线数量", + "type": "integer" + }, + "online": { + "description": "在线数量", + "type": "integer" + }, + "total": { + "description": "主机总数", + "type": "integer" + } + } + }, + "model.JenkinsBuild": { + "type": "object", + "properties": { + "actions": { + "description": "构建操作", + "type": "array", + "items": { + "$ref": "#/definitions/model.BuildAction" + } + }, + "building": { + "description": "是否正在构建", + "type": "boolean" + }, + "changeSet": { + "description": "变更集", + "allOf": [ + { + "$ref": "#/definitions/model.ChangeSet" + } + ] + }, + "culprits": { + "description": "责任人", + "type": "array", + "items": { + "$ref": "#/definitions/model.User" + } + }, + "description": { + "description": "构建描述", + "type": "string" + }, + "displayName": { + "description": "显示名称", + "type": "string" + }, + "duration": { + "description": "构建时长(毫秒)", + "type": "integer" + }, + "estimatedDuration": { + "description": "预计时长(毫秒)", + "type": "integer" + }, + "executor": { + "description": "执行器信息", + "allOf": [ + { + "$ref": "#/definitions/model.BuildExecutor" + } + ] + }, + "fullDisplayName": { + "description": "完整显示名称", + "type": "string" + }, + "keepLog": { + "description": "是否保留日志", + "type": "boolean" + }, + "number": { + "description": "构建编号", + "type": "integer" + }, + "queueId": { + "description": "队列ID", + "type": "integer" + }, + "result": { + "description": "构建结果 SUCCESS/FAILURE/UNSTABLE/ABORTED", + "type": "string" + }, + "timestamp": { + "description": "开始时间戳", + "type": "integer" + }, + "url": { + "description": "构建URL", + "type": "string" + } + } + }, + "model.JenkinsBuildDetailResponse": { + "type": "object", + "properties": { + "build": { + "$ref": "#/definitions/model.JenkinsBuild" + }, + "log": { + "description": "构建日志", + "type": "string" + }, + "server": { + "description": "服务器名称", + "type": "string" + } + } + }, + "model.JenkinsComputer": { + "type": "object", + "properties": { + "displayName": { + "description": "显示名称", + "type": "string" + }, + "executors": { + "description": "执行器列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsExecutor" + } + }, + "icon": { + "description": "图标", + "type": "string" + }, + "iconClassName": { + "description": "图标类名", + "type": "string" + }, + "idle": { + "description": "是否空闲", + "type": "boolean" + }, + "jnlpAgent": { + "description": "是否JNLP代理", + "type": "boolean" + }, + "launchSupported": { + "description": "是否支持启动", + "type": "boolean" + }, + "loadStatistics": { + "description": "负载统计", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsLoadStatistics" + } + ] + }, + "manualLaunchAllowed": { + "description": "是否允许手动启动", + "type": "boolean" + }, + "monitorData": { + "description": "监控数据", + "type": "object", + "additionalProperties": true + }, + "numExecutors": { + "description": "执行器数量", + "type": "integer" + }, + "offline": { + "description": "是否离线", + "type": "boolean" + }, + "offlineCause": { + "description": "离线原因" + }, + "oneOffExecutors": { + "description": "一次性执行器", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsExecutor" + } + }, + "temporarilyOffline": { + "description": "是否临时离线", + "type": "boolean" + } + } + }, + "model.JenkinsEnv": { + "type": "object", + "properties": { + "app_id": { + "description": "应用ID", + "type": "integer" + }, + "application": { + "description": "关联", + "allOf": [ + { + "$ref": "#/definitions/model.Application" + } + ] + }, + "created_at": { + "type": "string" + }, + "env_name": { + "description": "环境名称", + "type": "string" + }, + "id": { + "type": "integer" + }, + "jenkins_server_id": { + "description": "Jenkins服务器ID(关联account_auth)", + "type": "integer" + }, + "job_name": { + "description": "Jenkins任务名称", + "type": "string" + }, + "updated_at": { + "type": "string" + } + } + }, + "model.JenkinsExecutor": { + "type": "object", + "properties": { + "currentExecutable": { + "description": "当前执行的任务" + }, + "currentWorkUnit": { + "description": "当前工作单元" + }, + "idle": { + "description": "是否空闲", + "type": "boolean" + }, + "likelyStuck": { + "description": "是否可能卡住", + "type": "boolean" + }, + "number": { + "description": "执行器编号", + "type": "integer" + }, + "progress": { + "description": "进度", + "type": "integer" + } + } + }, + "model.JenkinsJob": { + "type": "object", + "properties": { + "_class": { + "description": "任务类型", + "type": "string" + }, + "actions": { + "description": "任务操作", + "type": "array", + "items": { + "$ref": "#/definitions/model.JobAction" + } + }, + "buildable": { + "description": "是否可构建", + "type": "boolean" + }, + "color": { + "description": "状态颜色(blue/red/yellow等)", + "type": "string" + }, + "description": { + "description": "任务描述", + "type": "string" + }, + "displayName": { + "description": "显示名称", + "type": "string" + }, + "lastBuild": { + "description": "最后一次构建", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsBuild" + } + ] + }, + "lastFailedBuild": { + "description": "最后一次失败构建", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsBuild" + } + ] + }, + "lastStableBuild": { + "description": "最后一次稳定构建", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsBuild" + } + ] + }, + "lastSuccessfulBuild": { + "description": "最后一次成功构建", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsBuild" + } + ] + }, + "name": { + "description": "任务名称", + "type": "string" + }, + "property": { + "description": "任务属性", + "type": "array", + "items": { + "$ref": "#/definitions/model.JobProperty" + } + }, + "url": { + "description": "任务URL", + "type": "string" + } + } + }, + "model.JenkinsJobDetailResponse": { + "type": "object", + "properties": { + "builds": { + "description": "构建历史", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsBuild" + } + }, + "job": { + "$ref": "#/definitions/model.JenkinsJob" + }, + "server": { + "description": "服务器名称", + "type": "string" + } + } + }, + "model.JenkinsJobListResponse": { + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsJob" + } + }, + "server": { + "description": "服务器名称", + "type": "string" + }, + "total": { + "type": "integer" + } + } + }, + "model.JenkinsLabel": { + "type": "object", + "properties": { + "name": { + "description": "标签名称", + "type": "string" + } + } + }, + "model.JenkinsLoadStatistics": { + "type": "object", + "properties": { + "busyExecutors": { + "description": "忙碌执行器数", + "type": "integer" + }, + "idleExecutors": { + "description": "空闲执行器数", + "type": "integer" + }, + "queueLength": { + "description": "队列长度", + "type": "integer" + }, + "totalExecutors": { + "description": "总执行器数", + "type": "integer" + } + } + }, + "model.JenkinsQueue": { + "type": "object", + "properties": { + "items": { + "description": "队列项目", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsQueueItem" + } + } + } + }, + "model.JenkinsQueueItem": { + "type": "object", + "properties": { + "actions": { + "description": "操作", + "type": "array", + "items": {} + }, + "blocked": { + "description": "是否阻塞", + "type": "boolean" + }, + "buildable": { + "description": "是否可构建", + "type": "boolean" + }, + "buildableStartMilliseconds": { + "description": "可构建开始时间", + "type": "integer" + }, + "id": { + "description": "队列项目ID", + "type": "integer" + }, + "inQueueSince": { + "description": "入队时间", + "type": "integer" + }, + "params": { + "description": "参数", + "type": "string" + }, + "stuck": { + "description": "是否卡住", + "type": "boolean" + }, + "task": { + "description": "任务信息", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsTask" + } + ] + }, + "url": { + "description": "URL", + "type": "string" + }, + "why": { + "description": "等待原因", + "type": "string" + } + } + }, + "model.JenkinsServerInfo": { + "type": "object", + "properties": { + "alias": { + "description": "别名(服务器名称)", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "description": { + "description": "描述(备注)", + "type": "string" + }, + "host": { + "description": "Jenkins服务器地址", + "type": "string" + }, + "id": { + "description": "账号ID", + "type": "integer" + }, + "port": { + "description": "端口", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.JenkinsServerListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsServerInfo" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.JenkinsServerOption": { + "type": "object", + "properties": { + "id": { + "description": "服务器ID", + "type": "integer" + }, + "name": { + "description": "服务器名称(别名)", + "type": "string" + } + } + }, + "model.JenkinsSystemInfo": { + "type": "object", + "properties": { + "assignedLabels": { + "description": "分配的标签", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsLabel" + } + }, + "computers": { + "description": "计算机列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsComputer" + } + }, + "mode": { + "description": "运行模式", + "type": "string" + }, + "nodeDescription": { + "description": "节点描述", + "type": "string" + }, + "nodeName": { + "description": "节点名称", + "type": "string" + }, + "numExecutors": { + "description": "执行器数量", + "type": "integer" + }, + "overallLoad": { + "description": "总体负载", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "primaryView": { + "description": "主视图", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsView" + } + ] + }, + "unlabeledLoad": { + "description": "未标记负载", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "useCrumbs": { + "description": "是否使用CSRF保护", + "type": "boolean" + }, + "useSecurity": { + "description": "是否使用安全", + "type": "boolean" + }, + "version": { + "description": "Jenkins版本", + "type": "string" + }, + "views": { + "description": "视图列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsView" + } + } + } + }, + "model.JenkinsView": { + "type": "object", + "properties": { + "description": { + "description": "视图描述", + "type": "string" + }, + "jobs": { + "description": "视图中的任务", + "type": "array", + "items": { + "$ref": "#/definitions/model.JenkinsJob" + } + }, + "name": { + "description": "视图名称", + "type": "string" + }, + "url": { + "description": "视图URL", + "type": "string" + } + } + }, + "model.JobAction": { + "type": "object", + "properties": { + "_class": { + "description": "操作类型", + "type": "string" + } + } + }, + "model.JobProperty": { + "type": "object", + "properties": { + "_class": { + "description": "属性类型", + "type": "string" + } + } + }, + "model.KeyManage": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "id": { + "type": "integer" + }, + "keyId": { + "description": "密钥ID(加密存储)", + "type": "string" + }, + "keySecret": { + "description": "密钥Secret(加密存储)", + "type": "string" + }, + "keyType": { + "description": "云厂商类型:1=阿里云,2=腾讯云,3=百度云,4=华为云,5=AWS云", + "type": "integer" + }, + "remark": { + "description": "备注信息", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + } + } + }, + "model.KubeCluster": { + "type": "object", + "properties": { + "clusterType": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "credential": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "lastSyncAt": { + "type": "string" + }, + "masterNodes": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "nodeCount": { + "type": "integer" + }, + "readyNodes": { + "type": "integer" + }, + "status": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "version": { + "type": "string" + }, + "workerNodes": { + "type": "integer" + } + } + }, + "model.KubeClusterListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.KubeCluster" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.LimitRangeDetail": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "limits": { + "description": "限制项列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.LimitRangeItem" + } + }, + "name": { + "description": "LimitRange名称", + "type": "string" + } + } + }, + "model.LimitRangeItem": { + "type": "object", + "properties": { + "default": { + "description": "默认值", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "defaultRequest": { + "description": "默认请求值", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "max": { + "description": "最大限制", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "maxLimitRequestRatio": { + "description": "最大限制与请求比率", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "min": { + "description": "最小限制", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "限制类型 Container/Pod/PersistentVolumeClaim", + "type": "string" + } + } + }, + "model.LimitRangeListResponse": { + "type": "object", + "properties": { + "limitRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/model.LimitRangeDetail" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.LimitRangeRequestSpec": { + "type": "object", + "required": [ + "limits" + ], + "properties": { + "limits": { + "description": "限制项列表", + "type": "array", + "items": { + "$ref": "#/definitions/model.LimitRangeItem" + } + } + } + }, + "model.LoginDto": { + "type": "object", + "required": [ + "idKey", + "image", + "password", + "username" + ], + "properties": { + "idKey": { + "description": "uuid", + "type": "string" + }, + "image": { + "description": "验证码", + "type": "string", + "maxLength": 6, + "minLength": 4 + }, + "password": { + "description": "密码", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.NetworkInfo": { + "type": "object", + "properties": { + "apiServerEndpoint": { + "description": "API Server内网端点", + "type": "string" + }, + "dnsService": { + "description": "DNS服务", + "type": "string" + }, + "networkPlugin": { + "description": "网络插件", + "type": "string" + }, + "podCIDR": { + "description": "Pod CIDR", + "type": "string" + }, + "proxyMode": { + "description": "服务转发模式", + "type": "string" + }, + "serviceCIDR": { + "description": "Service CIDR", + "type": "string" + } + } + }, + "model.NetworkMetrics": { + "type": "object", + "properties": { + "inboundTraffic": { + "description": "入站流量", + "type": "string" + }, + "outboundTraffic": { + "description": "出站流量", + "type": "string" + }, + "packetsIn": { + "description": "入站包数", + "type": "integer" + }, + "packetsOut": { + "description": "出站包数", + "type": "integer" + } + } + }, + "model.QuotaInfo": { + "type": "object", + "properties": { + "hard": { + "description": "限制值", + "type": "string" + }, + "used": { + "description": "已使用值", + "type": "string" + } + } + }, + "model.RemoveLabelRequest": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string" + } + } + }, + "model.RemoveTaintRequest": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "effect": { + "type": "string" + }, + "key": { + "type": "string" + } + } + }, + "model.ReplicaSetInfo": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "name": { + "description": "ReplicaSet名称", + "type": "string" + }, + "readyReplicas": { + "description": "就绪副本数", + "type": "integer" + }, + "replicas": { + "description": "副本数", + "type": "integer" + }, + "revision": { + "description": "版本号", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "string" + } + } + }, + "model.ReplicasSummary": { + "type": "object", + "properties": { + "available": { + "description": "可用副本数", + "type": "integer" + }, + "current": { + "description": "当前副本数", + "type": "integer" + }, + "desired": { + "description": "期望副本数", + "type": "integer" + }, + "ready": { + "description": "就绪副本数", + "type": "integer" + }, + "updated": { + "description": "已更新副本数", + "type": "integer" + } + } + }, + "model.ResetSysAdminPasswordDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "password": { + "description": "密码", + "type": "string" + } + } + }, + "model.RoleMenu": { + "type": "object", + "required": [ + "id", + "menuIds" + ], + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "menuIds": { + "description": "菜单id列表", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "model.RuntimeInfo": { + "type": "object", + "properties": { + "containerRuntimeVersion": { + "description": "容器运行时版本", + "type": "string" + }, + "kubeProxyVersion": { + "description": "KubeProxy版本", + "type": "string" + }, + "kubeletVersion": { + "description": "Kubelet版本", + "type": "string" + }, + "operatingSystem": { + "description": "操作系统", + "type": "string" + }, + "osImage": { + "description": "操作系统镜像", + "type": "string" + } + } + }, + "model.RuntimeSummary": { + "type": "object", + "properties": { + "apiServerVersion": { + "description": "API Server版本", + "type": "string" + }, + "containerRuntime": { + "description": "容器运行时", + "type": "string" + }, + "coreDNSVersion": { + "description": "CoreDNS版本", + "type": "string" + }, + "etcdVersion": { + "description": "etcd版本", + "type": "string" + }, + "kubeProxyVersion": { + "description": "kube-proxy版本", + "type": "string" + }, + "kubernetesVersion": { + "description": "Kubernetes版本", + "type": "string" + }, + "upTime": { + "description": "集群运行时间", + "type": "string" + } + } + }, + "model.ScaleWorkloadRequest": { + "type": "object", + "required": [ + "replicas" + ], + "properties": { + "replicas": { + "description": "目标副本数", + "type": "integer" + } + } + }, + "model.SecretDetail": { + "type": "object", + "properties": { + "createdTime": { + "description": "创建时间", + "type": "string" + }, + "data": { + "description": "数据(base64编码)", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "immutable": { + "description": "是否不可变", + "type": "boolean" + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "description": "Secret名称", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "spec": { + "description": "完整规格配置" + }, + "stringData": { + "description": "字符串数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "type": { + "description": "Secret类型", + "type": "string" + }, + "usage": { + "description": "使用情况(哪些Pod在使用)", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.SecretListResponse": { + "type": "object", + "properties": { + "secrets": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sSecret" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.StartJobRequest": { + "type": "object", + "properties": { + "parameters": { + "description": "构建参数", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "reason": { + "description": "构建原因", + "type": "string" + } + } + }, + "model.StartJobResponse": { + "type": "object", + "properties": { + "buildNumber": { + "description": "构建编号(如果已知)", + "type": "integer" + }, + "jobName": { + "description": "任务名称", + "type": "string" + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "queueId": { + "description": "队列ID", + "type": "integer" + }, + "server": { + "description": "服务器名称", + "type": "string" + }, + "success": { + "description": "是否启动成功", + "type": "boolean" + } + } + }, + "model.StopBuildRequest": { + "type": "object", + "properties": { + "reason": { + "description": "停止原因", + "type": "string" + } + } + }, + "model.StopBuildResponse": { + "type": "object", + "properties": { + "buildNumber": { + "description": "构建编号", + "type": "integer" + }, + "jobName": { + "description": "任务名称", + "type": "string" + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "server": { + "description": "服务器名称", + "type": "string" + }, + "success": { + "description": "是否停止成功", + "type": "boolean" + } + } + }, + "model.StorageClassDetail": { + "type": "object", + "properties": { + "allowVolumeExpansion": { + "description": "允许卷扩展", + "type": "boolean" + }, + "allowedTopologies": { + "description": "允许的拓扑", + "type": "array", + "items": { + "$ref": "#/definitions/model.StorageClassTopology" + } + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "events": { + "description": "相关事件", + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sEvent" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "description": "存储类名称", + "type": "string" + }, + "parameters": { + "description": "参数", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "provisioner": { + "description": "提供者", + "type": "string" + }, + "reclaimPolicy": { + "description": "回收策略", + "type": "string" + }, + "spec": { + "description": "完整规格配置" + }, + "volumeBindingMode": { + "description": "卷绑定模式", + "type": "string" + } + } + }, + "model.StorageClassListResponse": { + "type": "object", + "properties": { + "storageClasses": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sStorageClass" + } + }, + "total": { + "type": "integer" + } + } + }, + "model.StorageClassTopology": { + "type": "object", + "properties": { + "matchLabelExpressions": { + "description": "匹配标签表达式", + "type": "array", + "items": { + "$ref": "#/definitions/model.StorageClassTopologyExp" + } + } + } + }, + "model.StorageClassTopologyExp": { + "type": "object", + "properties": { + "key": { + "description": "键", + "type": "string" + }, + "values": { + "description": "值", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.StorageMetrics": { + "type": "object", + "properties": { + "boundPVs": { + "description": "已绑定PV数", + "type": "integer" + }, + "storageClasses": { + "description": "存储类列表", + "type": "array", + "items": { + "type": "string" + } + }, + "totalPVCs": { + "description": "PVC总数", + "type": "integer" + }, + "totalPVs": { + "description": "PV总数", + "type": "integer" + } + } + }, + "model.SyncSchedule": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "cronExpr": { + "description": "cron表达式", + "type": "string" + }, + "id": { + "type": "integer" + }, + "keyTypes": { + "description": "要同步的云厂商类型(JSON数组格式:[1,2,3])", + "type": "string" + }, + "lastRunTime": { + "description": "上次执行时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "name": { + "description": "配置名称", + "type": "string" + }, + "nextRunTime": { + "description": "下次执行时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "remark": { + "description": "备注信息", + "type": "string" + }, + "status": { + "description": "状态:1=启用,0=禁用", + "type": "integer" + }, + "syncLog": { + "description": "最近一次同步日志", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + } + } + }, + "model.SysAdminIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.SysDept": { + "type": "object", + "properties": { + "children": { + "description": "子集", + "type": "array", + "items": { + "$ref": "#/definitions/model.SysDept" + } + }, + "createTime": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "deptName": { + "description": "部门名称", + "type": "string" + }, + "deptStatus": { + "description": "部门状态(1-\u003e正常 2-\u003e停用)", + "type": "integer" + }, + "deptType": { + "description": "部门类型(1-\u003e公司, 2-\u003e中心,3-\u003e部门)", + "type": "integer" + }, + "id": { + "description": "ID", + "type": "integer" + }, + "parentId": { + "description": "父id", + "type": "integer" + } + } + }, + "model.SysDeptIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.SysLoginInfoIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.SysMenu": { + "type": "object", + "properties": { + "children": { + "description": "子集", + "type": "array", + "items": { + "$ref": "#/definitions/model.SysMenu" + } + }, + "createTime": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "icon": { + "description": "菜单图标", + "type": "string" + }, + "id": { + "description": "ID", + "type": "integer" + }, + "menuName": { + "description": "菜单名称", + "type": "string" + }, + "menuStatus": { + "description": "启用状态;1-\u003e禁用;2-\u003e启用", + "type": "integer" + }, + "menuType": { + "description": "菜单类型:1-\u003e目录;2-\u003e菜单;3-\u003e按钮", + "type": "integer" + }, + "parentId": { + "description": "父菜单id", + "type": "integer" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "url": { + "description": "菜单url", + "type": "string" + }, + "value": { + "description": "权限值", + "type": "string" + } + } + }, + "model.SysMenuIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.SysOperationLogIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.SysPost": { + "type": "object", + "properties": { + "createTime": { + "description": "创建时间", + "allOf": [ + { + "$ref": "#/definitions/util.HTime" + } + ] + }, + "id": { + "description": "ID", + "type": "integer" + }, + "postCode": { + "description": "岗位编码", + "type": "string" + }, + "postName": { + "description": "岗位名称", + "type": "string" + }, + "postStatus": { + "description": "状态(1-\u003e正常 2-\u003e停用)", + "type": "integer" + }, + "remark": { + "description": "备注", + "type": "string" + } + } + }, + "model.SysPostIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.SysRoleIdDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + } + } + }, + "model.TestJenkinsConnectionRequest": { + "type": "object", + "required": [ + "password", + "url", + "username" + ], + "properties": { + "password": { + "description": "密码或API Token", + "type": "string" + }, + "url": { + "description": "Jenkins服务器地址", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.TestJenkinsConnectionResponse": { + "type": "object", + "properties": { + "error": { + "description": "错误信息", + "type": "string" + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "success": { + "description": "是否连接成功", + "type": "boolean" + }, + "systemInfo": { + "description": "系统信息", + "allOf": [ + { + "$ref": "#/definitions/model.JenkinsSystemInfo" + } + ] + } + } + }, + "model.Toleration": { + "type": "object", + "properties": { + "effect": { + "description": "效果", + "type": "string" + }, + "key": { + "description": "键", + "type": "string" + }, + "operator": { + "description": "操作符", + "type": "string" + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "model.UpdateEcsAuthDto": { + "type": "object", + "required": [ + "name", + "password", + "port", + "type", + "username" + ], + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "name": { + "description": "凭证名称", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "port": { + "description": "端口号", + "type": "integer" + }, + "publicKey": { + "description": "公钥", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "type": { + "description": "认证类型:1-\u003e密码", + "type": "integer" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.UpdateJenkinsEnvRequest": { + "type": "object", + "properties": { + "env_name": { + "description": "环境名称", + "type": "string" + }, + "id": { + "description": "环境配置ID(可选,不提供则创建新的)", + "type": "integer" + }, + "jenkins_server_id": { + "description": "Jenkins服务器ID(关联account_auth表)", + "type": "integer" + }, + "job_name": { + "description": "Jenkins任务名称", + "type": "string" + } + } + }, + "model.UpdateKeyManageDto": { + "type": "object", + "required": [ + "id", + "keyId", + "keySecret", + "keyType" + ], + "properties": { + "id": { + "description": "密钥ID", + "type": "integer" + }, + "keyId": { + "description": "密钥ID", + "type": "string" + }, + "keySecret": { + "description": "密钥Secret", + "type": "string" + }, + "keyType": { + "description": "云厂商类型:1=阿里云,2=腾讯云,3=百度云,4=华为云,5=AWS云", + "type": "integer" + }, + "remark": { + "description": "备注信息", + "type": "string" + } + } + }, + "model.UpdateKubeClusterRequest": { + "type": "object", + "properties": { + "credential": { + "description": "K8s凭证(kubeconfig内容)", + "type": "string" + }, + "description": { + "description": "集群描述", + "type": "string" + }, + "name": { + "description": "集群名称", + "type": "string" + }, + "version": { + "description": "集群版本(可选,同步时会自动更新)", + "type": "string" + } + } + }, + "model.UpdateLimitRangeRequest": { + "type": "object", + "required": [ + "spec" + ], + "properties": { + "spec": { + "description": "LimitRange规格", + "allOf": [ + { + "$ref": "#/definitions/model.LimitRangeRequestSpec" + } + ] + } + } + }, + "model.UpdatePersonalDto": { + "type": "object", + "required": [ + "email", + "nickname", + "note", + "phone", + "username" + ], + "properties": { + "email": { + "description": "邮箱", + "type": "string" + }, + "icon": { + "description": "头像", + "type": "string" + }, + "id": { + "description": "ID", + "type": "integer" + }, + "nickname": { + "description": "昵称", + "type": "string" + }, + "note": { + "description": "备注", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.UpdatePersonalPasswordDto": { + "type": "object", + "required": [ + "newPassword", + "password", + "resetPassword" + ], + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "newPassword": { + "description": "新密码", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "resetPassword": { + "description": "重复密码", + "type": "string" + } + } + }, + "model.UpdateSecretRequest": { + "type": "object", + "properties": { + "data": { + "description": "数据(base64编码)", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "stringData": { + "description": "字符串数据", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.UpdateStorageClassRequest": { + "type": "object", + "properties": { + "allowVolumeExpansion": { + "description": "允许卷扩展", + "type": "boolean" + }, + "allowedTopologies": { + "description": "允许的拓扑", + "type": "array", + "items": { + "$ref": "#/definitions/model.StorageClassTopology" + } + }, + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "mountOptions": { + "description": "挂载选项", + "type": "array", + "items": { + "type": "string" + } + }, + "parameters": { + "description": "参数", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "model.UpdateSyncScheduleDto": { + "type": "object", + "required": [ + "cronExpr", + "id", + "keyTypes", + "name" + ], + "properties": { + "cronExpr": { + "description": "cron表达式", + "type": "string" + }, + "id": { + "description": "配置ID", + "type": "integer" + }, + "keyTypes": { + "description": "要同步的云厂商类型(JSON数组格式:[1,2,3])", + "type": "string" + }, + "name": { + "description": "配置名称", + "type": "string" + }, + "remark": { + "description": "备注信息", + "type": "string" + }, + "status": { + "description": "状态:1=启用,0=禁用", + "type": "integer" + } + } + }, + "model.UpdateSysAdminDto": { + "type": "object", + "properties": { + "deptId": { + "description": "部门id", + "type": "integer" + }, + "email": { + "description": "邮箱", + "type": "string" + }, + "id": { + "description": "ID", + "type": "integer" + }, + "nickname": { + "description": "昵称", + "type": "string" + }, + "note": { + "description": "备注", + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "postId": { + "description": "岗位id", + "type": "integer" + }, + "roleId": { + "description": "角色id", + "type": "integer" + }, + "status": { + "description": "状态:1-\u003e启用,2-\u003e禁用", + "type": "integer" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "model.UpdateSysAdminStatusDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "status": { + "description": "状态:1-\u003e启用,2-\u003e禁用", + "type": "integer" + } + } + }, + "model.UpdateSysPostStatusDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "postStatus": { + "description": "状态(1-\u003e正常 2-\u003e停用)", + "type": "integer" + } + } + }, + "model.UpdateSysRoleDto": { + "type": "object", + "properties": { + "description": { + "description": "描述", + "type": "string" + }, + "id": { + "description": "Id", + "type": "integer" + }, + "roleKey": { + "description": "角色key", + "type": "string" + }, + "roleName": { + "description": "角色名称", + "type": "string" + }, + "status": { + "description": "状态:1-\u003e启用,2-\u003e禁用", + "type": "integer" + } + } + }, + "model.UpdateSysRoleStatusDto": { + "type": "object", + "properties": { + "id": { + "description": "ID", + "type": "integer" + }, + "status": { + "description": "状态:1-\u003e启用,2-\u003e禁用", + "type": "integer" + } + } + }, + "model.UpdateWorkloadRequest": { + "type": "object", + "properties": { + "labels": { + "description": "标签", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "strategy": { + "description": "部署策略" + }, + "template": { + "description": "Pod模板", + "allOf": [ + { + "$ref": "#/definitions/model.PodTemplateSpec" + } + ] + } + } + }, + "model.UpdateWorkloadYAMLRequest": { + "type": "object", + "required": [ + "workloadName", + "workloadType", + "yamlContent" + ], + "properties": { + "dryRun": { + "description": "是否只进行校验不实际更新", + "type": "boolean" + }, + "force": { + "description": "是否强制更新", + "type": "boolean" + }, + "validateOnly": { + "description": "是否只校验YAML格式", + "type": "boolean" + }, + "workloadName": { + "description": "工作负载名称", + "type": "string" + }, + "workloadType": { + "description": "工作负载类型: deployment,statefulset,daemonset,job,cronjob", + "type": "string" + }, + "yamlContent": { + "description": "YAML内容", + "type": "string" + } + } + }, + "model.UpdateWorkloadYAMLResponse": { + "type": "object", + "properties": { + "appliedAt": { + "description": "应用时间", + "type": "string" + }, + "changes": { + "description": "变更说明", + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "description": "响应消息", + "type": "string" + }, + "namespace": { + "description": "命名空间", + "type": "string" + }, + "success": { + "description": "是否更新成功", + "type": "boolean" + }, + "updateStrategy": { + "description": "更新策略 (patch/update/rolling)", + "type": "string" + }, + "validationResult": { + "description": "校验结果(DryRun时返回)", + "allOf": [ + { + "$ref": "#/definitions/model.ValidateYAMLResponse" + } + ] + }, + "warnings": { + "description": "警告信息", + "type": "array", + "items": { + "type": "string" + } + }, + "workloadName": { + "description": "工作负载名称", + "type": "string" + }, + "workloadType": { + "description": "工作负载类型", + "type": "string" + } + } + }, + "model.User": { + "type": "object", + "properties": { + "absoluteUrl": { + "description": "绝对URL", + "type": "string" + }, + "fullName": { + "description": "全名", + "type": "string" + } + } + }, + "model.ValidateJenkinsJobRequest": { + "type": "object", + "required": [ + "jenkins_server_id", + "job_name" + ], + "properties": { + "jenkins_server_id": { + "description": "Jenkins服务器ID", + "type": "integer" + }, + "job_name": { + "description": "任务名称", + "type": "string" + } + } + }, + "model.ValidateJenkinsJobResponse": { + "type": "object", + "properties": { + "exists": { + "description": "任务是否存在", + "type": "boolean" + }, + "job_name": { + "description": "任务名称", + "type": "string" + }, + "job_url": { + "description": "任务URL(如果存在)", + "type": "string" + }, + "message": { + "description": "验证消息", + "type": "string" + }, + "server_id": { + "description": "服务器ID", + "type": "integer" + } + } + }, + "model.ValidateYAMLRequest": { + "type": "object", + "required": [ + "yamlContent" + ], + "properties": { + "resourceType": { + "description": "资源类型,如pod、deployment等", + "type": "string" + }, + "yamlContent": { + "description": "YAML内容", + "type": "string" + } + } + }, + "model.ValidateYAMLResponse": { + "type": "object", + "properties": { + "errors": { + "description": "错误列表", + "type": "array", + "items": { + "type": "string" + } + }, + "parsedObject": { + "description": "解析后的对象", + "type": "object", + "additionalProperties": true + }, + "suggestions": { + "description": "建议列表", + "type": "array", + "items": { + "type": "string" + } + }, + "valid": { + "description": "是否有效", + "type": "boolean" + }, + "warnings": { + "description": "警告列表", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "model.VolumeInfo": { + "type": "object", + "properties": { + "mountPath": { + "description": "挂载路径", + "type": "string" + }, + "name": { + "description": "卷名称", + "type": "string" + }, + "readOnly": { + "description": "只读状态", + "type": "boolean" + }, + "type": { + "description": "卷类型", + "type": "string" + } + } + }, + "model.VolumeMount": { + "type": "object", + "required": [ + "mountPath", + "name" + ], + "properties": { + "mountPath": { + "description": "挂载路径", + "type": "string" + }, + "name": { + "description": "卷名称", + "type": "string" + }, + "readOnly": { + "description": "只读模式", + "type": "boolean" + } + } + }, + "model.VolumeSpec": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "config": { + "description": "卷配置", + "type": "object", + "additionalProperties": true + }, + "name": { + "description": "卷名称", + "type": "string" + }, + "type": { + "description": "卷类型", + "type": "string" + } + } + }, + "model.WorkloadCondition": { + "type": "object", + "properties": { + "lastTransitionTime": { + "description": "最后转换时间", + "type": "string" + }, + "message": { + "description": "消息", + "type": "string" + }, + "reason": { + "description": "原因", + "type": "string" + }, + "status": { + "description": "状态", + "type": "string" + }, + "type": { + "description": "条件类型", + "type": "string" + } + } + }, + "model.WorkloadListResponse": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "workloads": { + "type": "array", + "items": { + "$ref": "#/definitions/model.K8sWorkload" + } + } + } + }, + "model.WorkloadSummary": { + "type": "object", + "properties": { + "runningPods": { + "description": "运行中的Pod数", + "type": "integer" + }, + "totalCronJobs": { + "description": "CronJob总数", + "type": "integer" + }, + "totalDaemonSets": { + "description": "DaemonSet总数", + "type": "integer" + }, + "totalDeployments": { + "description": "Deployment总数", + "type": "integer" + }, + "totalJobs": { + "description": "Job总数", + "type": "integer" + }, + "totalPods": { + "description": "Pod总数", + "type": "integer" + }, + "totalStatefulSets": { + "description": "StatefulSet总数", + "type": "integer" + } + } + }, + "model.WorkloadType": { + "type": "string", + "enum": [ + "Deployment", + "StatefulSet", + "DaemonSet", + "Job", + "CronJob", + "Pod" + ], + "x-enum-varnames": [ + "WorkloadTypeDeployment", + "WorkloadTypeStatefulSet", + "WorkloadTypeDaemonSet", + "WorkloadTypeJob", + "WorkloadTypeCronJob", + "WorkloadTypePod" + ] + }, + "result.PageResult": { + "type": "object", + "properties": { + "list": { + "description": "数据列表" + }, + "page": { + "description": "当前页码", + "type": "integer" + }, + "pageSize": { + "description": "每页数量", + "type": "integer" + }, + "total": { + "description": "总记录数", + "type": "integer" + } + } + }, + "result.Result": { + "type": "object", + "properties": { + "code": { + "description": "状态码", + "type": "integer" + }, + "data": { + "description": "返回的数据" + }, + "message": { + "description": "提示信息", + "type": "string" + } + } + }, + "util.HTime": { + "type": "object", + "properties": { + "time.Time": { + "type": "string" + } + } + }, + "dao.ListResponse": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ConfigAnsible" + } + }, + "total": { + "type": "integer" + } + } + }` diff --git a/dodevops-api/docs/task_execution_example.md b/dodevops-api/docs/task_execution_example.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/task_list_with_details_example.md b/dodevops-api/docs/task_list_with_details_example.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/task_pause_feature_migration.md b/dodevops-api/docs/task_pause_feature_migration.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/toggle_status_fix.md b/dodevops-api/docs/toggle_status_fix.md old mode 100644 new mode 100755 diff --git a/dodevops-api/docs/tool/tool_docs.go b/dodevops-api/docs/tool/tool_docs.go new file mode 100644 index 0000000..3821034 --- /dev/null +++ b/dodevops-api/docs/tool/tool_docs.go @@ -0,0 +1,501 @@ +package docstool + +const ToolPaths = ` + "/api/v1/tool": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新导航工具接口", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tool导航工具" + ], + "summary": "更新导航工具", + "parameters": [ + { + "description": "导航工具信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.UpdateToolDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建导航工具接口", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tool导航工具" + ], + "summary": "创建导航工具", + "parameters": [ + { + "description": "导航工具信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.AddToolDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/all": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取所有导航工具(不分页)", + "produces": [ + "application/json" + ], + "tags": [ + "Tool导航工具" + ], + "summary": "获取所有导航工具", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/deploy": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建一个服务部署任务,异步执行部署", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tool运维工具箱" + ], + "summary": "创建部署任务", + "parameters": [ + { + "description": "部署参数", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.CreateDeployDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/deploy/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取服务部署历史记录列表(分页)", + "produces": [ + "application/json" + ], + "tags": [ + "Tool运维工具箱" + ], + "summary": "获取部署历史列表", + "parameters": [ + { + "type": "string", + "description": "服务名称(模糊查询)", + "name": "serviceName", + "in": "query" + }, + { + "type": "integer", + "description": "主机ID", + "name": "hostId", + "in": "query" + }, + { + "type": "integer", + "description": "状态: 0=部署中, 1=运行中, 2=已停止, 3=部署失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "pageNum", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/deploy/{id}": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "停止并删除已部署的服务", + "produces": [ + "application/json" + ], + "tags": [ + "Tool运维工具箱" + ], + "summary": "卸载服务", + "parameters": [ + { + "type": "integer", + "description": "部署ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/deploy/{id}/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据部署ID获取部署状态和日志", + "produces": [ + "application/json" + ], + "tags": [ + "Tool运维工具箱" + ], + "summary": "获取部署状态", + "parameters": [ + { + "type": "integer", + "description": "部署ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取导航工具列表(分页)", + "produces": [ + "application/json" + ], + "tags": [ + "Tool导航工具" + ], + "summary": "获取导航工具列表", + "parameters": [ + { + "type": "string", + "description": "标题(模糊查询)", + "name": "title", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "pageNum", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/services": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取所有可部署的服务列表及分类", + "produces": [ + "application/json" + ], + "tags": [ + "Tool运维工具箱" + ], + "summary": "获取可部署服务列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/services/{serviceId}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据服务ID获取服务的详细信息", + "produces": [ + "application/json" + ], + "tags": [ + "Tool运维工具箱" + ], + "summary": "获取服务详情", + "parameters": [ + { + "type": "string", + "description": "服务ID", + "name": "serviceId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }, + "/api/v1/tool/{id}": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "根据ID获取导航工具详情", + "produces": [ + "application/json" + ], + "tags": [ + "Tool导航工具" + ], + "summary": "根据ID获取导航工具", + "parameters": [ + { + "type": "integer", + "description": "工具ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除导航工具接口", + "produces": [ + "application/json" + ], + "tags": [ + "Tool导航工具" + ], + "summary": "删除导航工具", + "parameters": [ + { + "type": "integer", + "description": "工具ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/result.Result" + } + } + } + } + }` + +const ToolDefinitions = ` + "model.AddToolDto": { + "type": "object", + "required": [ + "link", + "title" + ], + "properties": { + "icon": { + "description": "导航图标", + "type": "string" + }, + "link": { + "description": "链接地址", + "type": "string", + "maxLength": 500 + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "title": { + "description": "导航标题", + "type": "string", + "maxLength": 100, + "minLength": 1 + } + } + }, + "model.UpdateToolDto": { + "type": "object", + "required": [ + "id", + "link", + "title" + ], + "properties": { + "icon": { + "description": "导航图标", + "type": "string" + }, + "id": { + "description": "ID", + "type": "integer" + }, + "link": { + "description": "链接地址", + "type": "string", + "maxLength": 500 + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "title": { + "description": "导航标题", + "type": "string", + "maxLength": 100, + "minLength": 1 + } + } + }` diff --git a/dodevops-api/go.mod b/dodevops-api/go.mod index 8488607..2f34f80 100644 --- a/dodevops-api/go.mod +++ b/dodevops-api/go.mod @@ -31,6 +31,7 @@ require ( golang.org/x/crypto v0.42.0 golang.org/x/sync v0.17.0 gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 gorm.io/driver/mysql v1.6.0 gorm.io/gorm v1.31.0 k8s.io/api v0.34.1 @@ -153,7 +154,6 @@ require ( gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.63.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect diff --git a/dodevops-api/logs/app.log b/dodevops-api/logs/app.log index 8b13789..5b39217 100644 --- a/dodevops-api/logs/app.log +++ b/dodevops-api/logs/app.log @@ -1 +1,3527 @@ +DEBU[2026/01/26 - 09:48:02] Logger initialized with TextFormatter. + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.968ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.613ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.760ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_group' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.120ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[8.256ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.287ms] [rows:-] SELECT * FROM `cmdb_group` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.420ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_group' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.235ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.684ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.175ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.760ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.287ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.085ms] [rows:-] SELECT * FROM `config_ecsauth` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.023ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[85.612ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `password` longtext COMMENT '''密码(type=1时使用)''' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[32.154ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `public_key` text COMMENT '''私钥内容(type=2时使用,字段名历史原因)''' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.080ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.943ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.988ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_keymanage' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.689ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.901ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.877ms] [rows:-] SELECT * FROM `config_keymanage` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.721ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_keymanage' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.723ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.374ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.308ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.783ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.865ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.261ms] [rows:-] SELECT * FROM `config_sync_schedule` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.739ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.854ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.880ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.421ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_host' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.081ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.708ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.993ms] [rows:-] SELECT * FROM `cmdb_host` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.073ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_host' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.862ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.403ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.037ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.347ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.063ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.591ms] [rows:-] SELECT * FROM `cmdb_sql_log` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.613ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.567ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.022ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.054ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND index_name = 'idx_cmdb_sql_log_query_time' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.606ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.992ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.542ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.785ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.602ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.702ms] [rows:-] SELECT * FROM `cmdb_sql` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.917ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.929ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.591ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.661ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_account' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.600ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.519ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.856ms] [rows:-] SELECT * FROM `config_account` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.867ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_account' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.768ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.894ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.696ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_template' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.879ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.234ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.304ms] [rows:-] SELECT * FROM `task_template` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.004ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_template' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.222ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.709ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.360ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_job' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.706ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.467ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.698ms] [rows:-] SELECT * FROM `task_job` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.920ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_job' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.703ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.260ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.220ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_work' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.566ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.450ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.030ms] [rows:-] SELECT * FROM `task_work` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.058ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_work' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.822ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.608ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.911ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_task_id' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.787ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.979ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.361ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_template_id' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.711ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.038ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.913ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.652ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.334ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.885ms] [rows:-] SELECT * FROM `config_ansible` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.920ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ansible' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02  +[0.782ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.254ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.372ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'config_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 09:48:02  +[0.782ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.473ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[4.149ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'config_ansible' AND constraint_name = 'uni_config_ansible_name' + +2026/01/26 09:48:02  +[0.777ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.707ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[3.697ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.128ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.279ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.030ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.921ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.497ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.930ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'idx_config_ansible_type' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.668ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.273ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.236ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.659ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.405ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.026ms] [rows:-] SELECT * FROM `task_ansible` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.732ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansible' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02  +[1.300ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.458ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.717ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'task_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 09:48:02  +[0.789ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[4.758ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[4.376ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'task_ansible' AND constraint_name = 'uni_task_ansible_name' + +2026/01/26 09:48:02  +[0.622ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.451ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[12.410ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.821ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.196ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.393ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.656ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.300ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.288ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_status' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.867ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.568ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.599ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.904ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.716ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.721ms] [rows:-] SELECT * FROM `task_ansiblework` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.438ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.910ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.573ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.488ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_id' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.770ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.841ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.302ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_work_composite' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.966ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.382ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.530ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.533ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.090ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.426ms] [rows:-] SELECT * FROM `monitor_agent` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.792ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'monitor_agent' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.708ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.447ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.537ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND index_name = 'idx_monitor_agent_host_id' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.731ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.924ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.355ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.953ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.656ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.814ms] [rows:-] SELECT * FROM `k8s_cluster` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.796ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02  +[1.512ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[5.000ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.002ms] [rows:2] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'k8s_cluster' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 09:48:02  +[0.821ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.998ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[4.085ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'k8s_cluster' AND constraint_name = 'uni_k8s_cluster_name' + +2026/01/26 09:48:02  +[1.052ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.488ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[6.203ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.909ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.632ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.753ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.654ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.656ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.276ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_application' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.802ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.232ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.436ms] [rows:-] SELECT * FROM `app_application` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.227ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_application' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:02  +[0.771ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[9.007ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.190ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'app_application' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 09:48:02  +[1.912ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[2.645ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[3.041ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'app_application' AND constraint_name = 'uni_app_application_code' + +2026/01/26 09:48:02  +[0.785ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02  +[7.665ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02  +[4.846ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.338ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.298ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.297ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.651ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.801ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.517ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.527ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.097ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.358ms] [rows:-] SELECT * FROM `app_jenkins_env` LIMIT 1 + +2026/01/26 09:48:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.594ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.788ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.048ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.067ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND index_name = 'idx_app_jenkins_env_app_id' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.693ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.319ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.337ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployments' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.620ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.107ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.359ms] [rows:-] SELECT * FROM `quick_deployments` LIMIT 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.211ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployments' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.648ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.963ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.958ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.601ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.221ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.542ms] [rows:-] SELECT * FROM `quick_deployment_tasks` LIMIT 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.641ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.640ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.929ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.411ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND index_name = 'idx_quick_deployment_tasks_deployment_id' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.628ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.297ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.393ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.874ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.482ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.924ms] [rows:-] SELECT * FROM `sys_operation_log` LIMIT 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.998ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.174ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.746ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.484ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_link' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.591ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.118ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.391ms] [rows:-] SELECT * FROM `tool_link` LIMIT 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.165ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_link' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.810ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.108ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.447ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' AND table_type = 'BASE TABLE' + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.582ms] [rows:-] SELECT DATABASE() + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.687ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.686ms] [rows:-] SELECT * FROM `tool_service_deploy` LIMIT 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.265ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' ORDER BY ORDINAL_POSITION + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/api/configcenter/dao/syncSchedule.go:70 +[1.728ms] [rows:0] SELECT * FROM `config_sync_schedule` WHERE status = 1 + +2026/01/26 09:48:03 /root/project/AutoOps/dodevops-api/api/task/dao/taskJob.go:151 +[1.641ms] [rows:0] SELECT * FROM `task_job` WHERE type = 2 +INFO[2026/01/26 - 09:48:03] 任务队列系统初始化成功 +INFO[2026/01/26 - 09:48:03] Static upload directory: ./upload/ -> /root/project/AutoOps/dodevops-api/upload +INFO[2026/01/26 - 09:48:03] Swagger API文档已启用 +INFO[2026/01/26 - 09:48:03] Conflicting values for 'process.env.NODE_ENV' +INFO[2026/01/26 - 09:48:03] +INFO[2026/01/26 - 09:48:03] App running at: +INFO[2026/01/26 - 09:48:03] - Local: http://192.168.1.156:5700 +INFO[2026/01/26 - 09:48:03] - Network: http://192.168.1.156:5700 +INFO[2026/01/26 - 09:48:03] +INFO[2026/01/26 - 09:48:03] 请注意,开发版本尚未优化 +INFO[2026/01/26 - 09:48:03] 要创建生产环境构建,请运行 go run main.go +INFO[2026/01/26 - 09:48:03] +INFO[2026/01/26 - 09:48:03] API文档地址: http://192.168.1.156:5700/swagger/index.html +INFO[2026/01/26 - 09:48:27] [GIN] 2026/01/26 - 09:48:27 | 200 | 816.855µs | 192.168.65.94 | GET  "/swagger/index.html" +INFO[2026/01/26 - 09:48:27] [GIN] 2026/01/26 - 09:48:27 | 200 | 95.022µs | 192.168.65.94 | GET  "/swagger/index.css" +INFO[2026/01/26 - 09:48:27] [GIN] 2026/01/26 - 09:48:27 | 200 | 3.352618ms | 192.168.65.94 | GET  "/swagger/swagger-ui.css" +INFO[2026/01/26 - 09:48:27] [GIN] 2026/01/26 - 09:48:27 | 200 | 115.483µs | 192.168.65.94 | GET  "/swagger/swagger-initializer.js" +INFO[2026/01/26 - 09:48:27] [GIN] 2026/01/26 - 09:48:27 | 200 | 5.684552ms | 192.168.65.94 | GET  "/swagger/swagger-ui-standalone-preset.js" +INFO[2026/01/26 - 09:48:27] [GIN] 2026/01/26 - 09:48:27 | 200 | 13.460509ms | 192.168.65.94 | GET  "/swagger/swagger-ui-bundle.js" +INFO[2026/01/26 - 09:48:28] [GIN] 2026/01/26 - 09:48:28 | 200 | 13.302811ms | 192.168.65.94 | GET  "/swagger/doc.json" +INFO[2026/01/26 - 09:48:28] [GIN] 2026/01/26 - 09:48:28 | 200 | 128.447µs | 192.168.65.94 | GET  "/swagger/favicon-32x32.png" +WARN[2026/01/26 - 09:50:24] [GIN] 2026/01/26 - 09:50:24 | 404 | 18.87µs | 192.168.65.94 | GET  "/api/v1/ws/task/ansible/103/log/102" +WARN[2026/01/26 - 09:52:20] [GIN] 2026/01/26 - 09:52:20 | 404 | 16.017µs | 192.168.65.94 | GET  "/api/v1/ws/task/ansible/103/log/103" +INFO[2026/01/26 - 12:48:30] Shutdown Server ... +INFO[2026/01/26 - 12:48:30] 停止任务队列系统... +INFO[2026/01/26 - 12:48:30] 任务队列系统已停止 +INFO[2026/01/26 - 12:48:30] Server exiting +DEBU[2026/01/26 - 15:26:02] Logger initialized with TextFormatter. + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.733ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.178ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.636ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_group' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.316ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.460ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.047ms] [rows:-] SELECT * FROM `cmdb_group` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.309ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_group' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.746ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.018ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.114ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.671ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.074ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.040ms] [rows:-] SELECT * FROM `config_ecsauth` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.126ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[116.279ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `password` longtext COMMENT '''密码(type=1时使用)''' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[17.128ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `public_key` text COMMENT '''私钥内容(type=2时使用,字段名历史原因)''' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.986ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.474ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.681ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_keymanage' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.656ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.783ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.260ms] [rows:-] SELECT * FROM `config_keymanage` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.030ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_keymanage' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.770ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.754ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.218ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.753ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.904ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.790ms] [rows:-] SELECT * FROM `config_sync_schedule` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.094ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.896ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.879ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.487ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_host' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.730ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.194ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.321ms] [rows:-] SELECT * FROM `cmdb_host` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.333ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_host' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.867ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.732ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.026ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.744ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.130ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.200ms] [rows:-] SELECT * FROM `cmdb_sql_log` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.085ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.926ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.094ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.900ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND index_name = 'idx_cmdb_sql_log_query_time' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.774ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.514ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.205ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.851ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.455ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.368ms] [rows:-] SELECT * FROM `cmdb_sql` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.201ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.736ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.640ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.728ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_account' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.839ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.778ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.379ms] [rows:-] SELECT * FROM `config_account` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.998ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_account' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.865ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.553ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.651ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_template' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.696ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.794ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.524ms] [rows:-] SELECT * FROM `task_template` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.442ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_template' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.896ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.584ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.379ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_job' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.733ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.726ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.336ms] [rows:-] SELECT * FROM `task_job` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.973ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_job' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.869ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.516ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.997ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_work' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.261ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.054ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.367ms] [rows:-] SELECT * FROM `task_work` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[9.663ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_work' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.530ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.660ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.186ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_task_id' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.284ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.277ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.651ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_template_id' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.736ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.427ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.634ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.957ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.133ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.165ms] [rows:-] SELECT * FROM `config_ansible` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.557ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ansible' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02  +[1.169ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02  +[3.071ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.565ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'config_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 15:26:02  +[0.986ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02  +[2.644ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02  +[3.578ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'config_ansible' AND constraint_name = 'uni_config_ansible_name' + +2026/01/26 15:26:02  +[0.850ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02  +[3.126ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02  +[4.745ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.796ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.380ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.183ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.704ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.356ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.444ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'idx_config_ansible_type' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.177ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.056ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.517ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.829ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.328ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.101ms] [rows:-] SELECT * FROM `task_ansible` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[12.025ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansible' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02  +[1.293ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02  +[3.045ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.826ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'task_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 15:26:02  +[1.018ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02  +[2.757ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02  +[4.828ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'task_ansible' AND constraint_name = 'uni_task_ansible_name' + +2026/01/26 15:26:02  +[0.973ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02  +[2.899ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02  +[3.430ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.666ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.519ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.129ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.656ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.183ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.140ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_status' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.503ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.608ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.835ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.581ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.748ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.883ms] [rows:-] SELECT * FROM `task_ansiblework` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.335ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.232ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.378ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.266ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_id' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.598ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.020ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.616ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_work_composite' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.674ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.788ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.583ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.811ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.868ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.847ms] [rows:-] SELECT * FROM `monitor_agent` LIMIT 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.537ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'monitor_agent' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.596ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.445ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.469ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND index_name = 'idx_monitor_agent_host_id' + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.005ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:02 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.616ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.530ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.647ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.679ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.888ms] [rows:-] SELECT * FROM `k8s_cluster` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.850ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03  +[1.176ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03  +[5.707ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.141ms] [rows:2] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'k8s_cluster' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 15:26:03  +[1.430ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03  +[1.716ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03  +[2.154ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'k8s_cluster' AND constraint_name = 'uni_k8s_cluster_name' + +2026/01/26 15:26:03  +[0.381ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03  +[53.107ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03  +[2.884ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.614ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.574ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.234ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.269ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.002ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.642ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_application' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.491ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.782ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.110ms] [rows:-] SELECT * FROM `app_application` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.203ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_application' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03  +[0.391ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03  +[1.640ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.034ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'app_application' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 15:26:03  +[2.171ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03  +[1.691ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03  +[1.696ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'app_application' AND constraint_name = 'uni_app_application_code' + +2026/01/26 15:26:03  +[0.421ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03  +[1.148ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03  +[1.737ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.693ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.709ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.620ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.118ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.162ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.351ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.379ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.576ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.000ms] [rows:-] SELECT * FROM `app_jenkins_env` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.307ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.418ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.798ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.122ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND index_name = 'idx_app_jenkins_env_app_id' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.399ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.290ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.864ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployments' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.412ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.214ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.474ms] [rows:-] SELECT * FROM `quick_deployments` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.497ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployments' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.512ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.519ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.769ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.338ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.232ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.176ms] [rows:-] SELECT * FROM `quick_deployment_tasks` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.988ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.376ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.922ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.599ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND index_name = 'idx_quick_deployment_tasks_deployment_id' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.403ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.413ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.752ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.403ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.430ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.084ms] [rows:-] SELECT * FROM `sys_operation_log` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.586ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.402ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.426ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.945ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_link' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.369ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.134ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.999ms] [rows:-] SELECT * FROM `tool_link` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.290ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_link' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.444ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.790ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.902ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' AND table_type = 'BASE TABLE' + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.460ms] [rows:-] SELECT DATABASE() + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.361ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.974ms] [rows:-] SELECT * FROM `tool_service_deploy` LIMIT 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.312ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' ORDER BY ORDINAL_POSITION + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/api/configcenter/dao/syncSchedule.go:70 +[1.263ms] [rows:0] SELECT * FROM `config_sync_schedule` WHERE status = 1 + +2026/01/26 15:26:03 /root/project/AutoOps/dodevops-api/api/task/dao/taskJob.go:151 +[1.063ms] [rows:0] SELECT * FROM `task_job` WHERE type = 2 +INFO[2026/01/26 - 15:26:03] 任务队列系统初始化成功 +INFO[2026/01/26 - 15:26:03] Static upload directory: ./upload/ -> /root/project/AutoOps/dodevops-api/upload +INFO[2026/01/26 - 15:26:03] Swagger API文档已启用 +INFO[2026/01/26 - 15:26:03] Conflicting values for 'process.env.NODE_ENV' +INFO[2026/01/26 - 15:26:03] +INFO[2026/01/26 - 15:26:03] App running at: +INFO[2026/01/26 - 15:26:03] - Local: http://192.168.1.156:5700 +INFO[2026/01/26 - 15:26:03] - Network: http://192.168.1.156:5700 +INFO[2026/01/26 - 15:26:03] +INFO[2026/01/26 - 15:26:03] 请注意,开发版本尚未优化 +INFO[2026/01/26 - 15:26:03] 要创建生产环境构建,请运行 go run main.go +INFO[2026/01/26 - 15:26:03] +INFO[2026/01/26 - 15:26:03] API文档地址: http://192.168.1.156:5700/swagger/index.html +INFO[2026/01/26 - 15:26:07] [GIN] 2026/01/26 - 15:26:07 | 200 | 169.03µs | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:27:10 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.628ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 +INFO[2026/01/26 - 15:27:10] [GIN] 2026/01/26 - 15:27:10 | 200 | 5.444673ms | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" +WARN[2026/01/26 - 15:28:00] [GIN] 2026/01/26 - 15:28:00 | 404 | 39.594µs | 192.168.65.94 | GET  "/api/v1/ws/task/ansible/103/log/102" +WARN[2026/01/26 - 15:28:44] [GIN] 2026/01/26 - 15:28:44 | 404 | 16.187µs | 192.168.65.94 | GET  "/api/v1/ws/task/ansible/103/log/102" + +2026/01/26 15:54:42 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[4.286ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 +INFO[2026/01/26 - 15:54:42] [GIN] 2026/01/26 - 15:54:42 | 200 | 7.722849ms | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:55:14 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[1.987ms] [rows:2] SELECT id, task_id, entry_file_name, status, start_time, end_time, duration FROM `task_ansiblework` WHERE `task_ansiblework`.`task_id` = 103 + +2026/01/26 15:55:14 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[5.285ms] [rows:1] SELECT * FROM `task_ansible` WHERE id = 103 ORDER BY `task_ansible`.`id` LIMIT 1 + +2026/01/26 15:55:14 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:715 +[56.728ms] [rows:1] UPDATE `task_ansible` SET `status`=2,`updated_at`='2026-01-26 15:55:14.517' WHERE id = 103 + +2026/01/26 15:55:14 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[38.215ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/102/01-linux-os.yaml.log',`start_time`='2026-01-26 15:55:14.573',`status`=2 WHERE id = 102 + +2026/01/26 15:55:14 /root/project/AutoOps/dodevops-api/api/system/dao/sysOperationLog.go:13 +[51.153ms] [rows:1] INSERT INTO `sys_operation_log` (`admin_id`,`username`,`method`,`ip`,`url`,`description`,`create_time`) VALUES (89,'admin','post','192.168.65.94','/api/v1/task/ansible/103/start','启动Ansible任务','2026-01-26 15:55:14.576') +INFO[2026/01/26 - 15:55:14] [GIN] 2026/01/26 - 15:55:14 | 200 | 117.723191ms | 192.168.65.94 | POST  "/api/v1/task/ansible/103/start" + +2026/01/26 15:55:17 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.343ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 + +2026/01/26 15:55:19 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[3.836ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:55:25 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[3.225ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:55:31 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.320ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:55:37 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.695ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:55:41 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[20.251ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=26,`end_time`='2026-01-26 15:55:41.091',`error_msg`='',`exit_code`=0,`status`=3 WHERE id = 102 + +2026/01/26 15:55:41 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[10.054ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/103/02-os.yaml.log',`start_time`='2026-01-26 15:55:41.112',`status`=2 WHERE id = 103 + +2026/01/26 15:55:43 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.681ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:55:43 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[7.541ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=2,`end_time`='2026-01-26 15:55:43.223',`error_msg`='exit status 4',`exit_code`=4,`status`=4 WHERE id = 103 + +2026/01/26 15:55:43 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:999 +[3.984ms] [rows:2] SELECT * FROM `task_ansiblework` WHERE task_id = 103 + +2026/01/26 15:55:43 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:1008 +[7.606ms] [rows:1] UPDATE `task_ansible` SET `status`=4,`total_duration`=28,`updated_at`='2026-01-26 15:55:43.235' WHERE id = 103 +INFO[2026/01/26 - 15:55:43] [GIN] 2026/01/26 - 15:55:43 | 200 | 26.308237693s | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:56:04 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.335ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 +INFO[2026/01/26 - 15:56:04] [GIN] 2026/01/26 - 15:56:04 | 200 | 5.036106ms | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:56:19 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.894ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 +INFO[2026/01/26 - 15:56:19] [GIN] 2026/01/26 - 15:56:19 | 200 | 6.786411ms | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:56:38 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[2.391ms] [rows:2] SELECT id, task_id, entry_file_name, status, start_time, end_time, duration FROM `task_ansiblework` WHERE `task_ansiblework`.`task_id` = 103 + +2026/01/26 15:56:38 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[5.295ms] [rows:1] SELECT * FROM `task_ansible` WHERE id = 103 ORDER BY `task_ansible`.`id` LIMIT 1 + +2026/01/26 15:56:38 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:715 +[29.519ms] [rows:1] UPDATE `task_ansible` SET `status`=2,`updated_at`='2026-01-26 15:56:38.851' WHERE id = 103 + +2026/01/26 15:56:38 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[8.867ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/102/01-linux-os.yaml.log',`start_time`='2026-01-26 15:56:38.88',`status`=2 WHERE id = 102 + +2026/01/26 15:56:38 /root/project/AutoOps/dodevops-api/api/system/dao/sysOperationLog.go:13 +[9.847ms] [rows:1] INSERT INTO `sys_operation_log` (`admin_id`,`username`,`method`,`ip`,`url`,`description`,`create_time`) VALUES (89,'admin','post','192.168.65.94','/api/v1/task/ansible/103/start','启动Ansible任务','2026-01-26 15:56:38.885') +INFO[2026/01/26 - 15:56:38] [GIN] 2026/01/26 - 15:56:38 | 200 | 51.227226ms | 192.168.65.94 | POST  "/api/v1/task/ansible/103/start" + +2026/01/26 15:56:41 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.612ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 + +2026/01/26 15:56:43 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.271ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:56:49 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.435ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:56:55 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.880ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:57:01 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.737ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:57:04 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[30.661ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=25,`end_time`='2026-01-26 15:57:04.755',`error_msg`='',`exit_code`=0,`status`=3 WHERE id = 102 + +2026/01/26 15:57:04 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[14.057ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/103/02-os.yaml.log',`start_time`='2026-01-26 15:57:04.787',`status`=2 WHERE id = 103 + +2026/01/26 15:57:06 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[6.276ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=2,`end_time`='2026-01-26 15:57:06.787',`error_msg`='exit status 4',`exit_code`=4,`status`=4 WHERE id = 103 + +2026/01/26 15:57:06 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:999 +[1.854ms] [rows:2] SELECT * FROM `task_ansiblework` WHERE task_id = 103 + +2026/01/26 15:57:06 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:1008 +[5.781ms] [rows:1] UPDATE `task_ansible` SET `status`=4,`total_duration`=27,`updated_at`='2026-01-26 15:57:06.796' WHERE id = 103 + +2026/01/26 15:57:07 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.859ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 +INFO[2026/01/26 - 15:57:08] [GIN] 2026/01/26 - 15:57:08 | 200 | 26.308842584s | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:58:02 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.915ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 +INFO[2026/01/26 - 15:58:02] [GIN] 2026/01/26 - 15:58:02 | 200 | 6.215283ms | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 15:59:26 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[1.715ms] [rows:2] SELECT id, task_id, entry_file_name, status, start_time, end_time, duration FROM `task_ansiblework` WHERE `task_ansiblework`.`task_id` = 103 + +2026/01/26 15:59:26 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[5.061ms] [rows:1] SELECT * FROM `task_ansible` WHERE id = 103 ORDER BY `task_ansible`.`id` LIMIT 1 + +2026/01/26 15:59:26 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:715 +[65.359ms] [rows:1] UPDATE `task_ansible` SET `status`=2,`updated_at`='2026-01-26 15:59:26.653' WHERE id = 103 + +2026/01/26 15:59:26 /root/project/AutoOps/dodevops-api/api/system/dao/sysOperationLog.go:13 +[8.722ms] [rows:1] INSERT INTO `sys_operation_log` (`admin_id`,`username`,`method`,`ip`,`url`,`description`,`create_time`) VALUES (89,'admin','post','192.168.65.94','/api/v1/task/ansible/103/start','启动Ansible任务','2026-01-26 15:59:26.72') +INFO[2026/01/26 - 15:59:26] [GIN] 2026/01/26 - 15:59:26 | 200 | 83.538907ms | 192.168.65.94 | POST  "/api/v1/task/ansible/103/start" + +2026/01/26 15:59:26 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[11.484ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/102/01-linux-os.yaml.log',`start_time`='2026-01-26 15:59:26.718',`status`=2 WHERE id = 102 + +2026/01/26 15:59:34 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.553ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 + +2026/01/26 15:59:36 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.303ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:59:42 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.209ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:59:48 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.477ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:59:52 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[21.691ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=26,`end_time`='2026-01-26 15:59:52.774',`error_msg`='',`exit_code`=0,`status`=3 WHERE id = 102 + +2026/01/26 15:59:52 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[9.046ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/103/02-os.yaml.log',`start_time`='2026-01-26 15:59:52.796',`status`=2 WHERE id = 103 + +2026/01/26 15:59:54 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.844ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 15:59:54 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[7.529ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=2,`end_time`='2026-01-26 15:59:54.865',`error_msg`='exit status 4',`exit_code`=4,`status`=4 WHERE id = 103 + +2026/01/26 15:59:54 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:999 +[2.847ms] [rows:2] SELECT * FROM `task_ansiblework` WHERE task_id = 103 + +2026/01/26 15:59:54 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:1008 +[8.787ms] [rows:1] UPDATE `task_ansible` SET `status`=4,`total_duration`=28,`updated_at`='2026-01-26 15:59:54.876' WHERE id = 103 +INFO[2026/01/26 - 15:59:55] [GIN] 2026/01/26 - 15:59:55 | 200 | 20.331882532s | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 16:01:18 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[2.234ms] [rows:2] SELECT id, task_id, entry_file_name, status, start_time, end_time, duration FROM `task_ansiblework` WHERE `task_ansiblework`.`task_id` = 103 + +2026/01/26 16:01:18 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[5.453ms] [rows:1] SELECT * FROM `task_ansible` WHERE id = 103 ORDER BY `task_ansible`.`id` LIMIT 1 + +2026/01/26 16:01:18 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:715 +[20.945ms] [rows:1] UPDATE `task_ansible` SET `status`=2,`updated_at`='2026-01-26 16:01:18.238' WHERE id = 103 + +2026/01/26 16:01:18 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[10.570ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/102/01-linux-os.yaml.log',`start_time`='2026-01-26 16:01:18.26',`status`=2 WHERE id = 102 + +2026/01/26 16:01:18 /root/project/AutoOps/dodevops-api/api/system/dao/sysOperationLog.go:13 +[33.665ms] [rows:1] INSERT INTO `sys_operation_log` (`admin_id`,`username`,`method`,`ip`,`url`,`description`,`create_time`) VALUES (89,'admin','post','192.168.65.94','/api/v1/task/ansible/103/start','启动Ansible任务','2026-01-26 16:01:18.261') +INFO[2026/01/26 - 16:01:18] [GIN] 2026/01/26 - 16:01:18 | 200 | 64.503495ms | 192.168.65.94 | POST  "/api/v1/task/ansible/103/start" + +2026/01/26 16:01:20 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.477ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 + +2026/01/26 16:01:22 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.386ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 16:01:28 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.324ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 16:01:34 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[3.237ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 16:01:40 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.981ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 16:01:45 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[14.047ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=26,`end_time`='2026-01-26 16:01:45.226',`error_msg`='',`exit_code`=0,`status`=3 WHERE id = 102 + +2026/01/26 16:01:45 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[7.544ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/103/02-os.yaml.log',`start_time`='2026-01-26 16:01:45.241',`status`=2 WHERE id = 103 + +2026/01/26 16:01:46 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.288ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 +INFO[2026/01/26 - 16:01:47] [GIN] 2026/01/26 - 16:01:47 | 200 | 26.30869101s | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 16:01:47 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[6.968ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=1,`end_time`='2026-01-26 16:01:47.186',`error_msg`='exit status 4',`exit_code`=4,`status`=4 WHERE id = 103 + +2026/01/26 16:01:47 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:999 +[2.235ms] [rows:2] SELECT * FROM `task_ansiblework` WHERE task_id = 103 + +2026/01/26 16:01:47 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:1008 +[5.523ms] [rows:1] UPDATE `task_ansible` SET `status`=4,`total_duration`=27,`updated_at`='2026-01-26 16:01:47.195' WHERE id = 103 + +2026/01/26 17:23:54 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[2.344ms] [rows:2] SELECT id, task_id, entry_file_name, status, start_time, end_time, duration FROM `task_ansiblework` WHERE `task_ansiblework`.`task_id` = 103 + +2026/01/26 17:23:54 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[5.843ms] [rows:1] SELECT * FROM `task_ansible` WHERE id = 103 ORDER BY `task_ansible`.`id` LIMIT 1 + +2026/01/26 17:23:54 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:715 +[43.840ms] [rows:1] UPDATE `task_ansible` SET `status`=2,`updated_at`='2026-01-26 17:23:54.319' WHERE id = 103 + +2026/01/26 17:23:54 /root/project/AutoOps/dodevops-api/api/system/dao/sysOperationLog.go:13 +[9.604ms] [rows:1] INSERT INTO `sys_operation_log` (`admin_id`,`username`,`method`,`ip`,`url`,`description`,`create_time`) VALUES (89,'admin','post','192.168.65.94','/api/v1/task/ansible/103/start','启动Ansible任务','2026-01-26 17:23:54.364') +INFO[2026/01/26 - 17:23:54] [GIN] 2026/01/26 - 17:23:54 | 200 | 63.275189ms | 192.168.65.94 | POST  "/api/v1/task/ansible/103/start" + +2026/01/26 17:23:54 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[23.078ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/102/01-linux-os.yaml.log',`start_time`='2026-01-26 17:23:54.362',`status`=2 WHERE id = 102 + +2026/01/26 17:23:58 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.746ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 + +2026/01/26 17:24:00 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[3.633ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 17:24:06 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.502ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 17:24:12 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.176ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 17:24:18 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.360ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 17:24:19 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[6.949ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=25,`end_time`='2026-01-26 17:24:19.876',`error_msg`='',`exit_code`=0,`status`=3 WHERE id = 102 + +2026/01/26 17:24:19 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[8.818ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/103/02-os.yaml.log',`start_time`='2026-01-26 17:24:19.884',`status`=2 WHERE id = 103 + +2026/01/26 17:24:21 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[4.332ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=1,`end_time`='2026-01-26 17:24:21.476',`error_msg`='exit status 4',`exit_code`=4,`status`=4 WHERE id = 103 + +2026/01/26 17:24:21 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:999 +[1.160ms] [rows:2] SELECT * FROM `task_ansiblework` WHERE task_id = 103 + +2026/01/26 17:24:21 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:1008 +[3.680ms] [rows:1] UPDATE `task_ansible` SET `status`=4,`total_duration`=26,`updated_at`='2026-01-26 17:24:21.482' WHERE id = 103 + +2026/01/26 17:24:24 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.368ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 +INFO[2026/01/26 - 17:24:24] [GIN] 2026/01/26 - 17:24:24 | 200 | 26.308370428s | 192.168.65.94 | GET  "/api/v1/task/ansible/103/log/102" +DEBU[2026/01/26 - 19:43:34] Logger initialized with TextFormatter. + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.877ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.692ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.909ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_group' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.554ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.315ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.488ms] [rows:-] SELECT * FROM `cmdb_group` LIMIT 1 + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.426ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_group' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.980ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.681ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.312ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.662ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.050ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.650ms] [rows:-] SELECT * FROM `config_ecsauth` LIMIT 1 + +2026/01/26 19:43:34 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.682ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[79.162ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `password` longtext COMMENT '''密码(type=1时使用)''' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[23.770ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `public_key` text COMMENT '''私钥内容(type=2时使用,字段名历史原因)''' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.987ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.206ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.027ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_keymanage' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.801ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.249ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.544ms] [rows:-] SELECT * FROM `config_keymanage` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.170ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_keymanage' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.828ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.477ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.061ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.570ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.438ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.343ms] [rows:-] SELECT * FROM `config_sync_schedule` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.690ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.746ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.558ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.527ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_host' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.502ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.853ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.229ms] [rows:-] SELECT * FROM `cmdb_host` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.295ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_host' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.488ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.804ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.920ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.547ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.692ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.123ms] [rows:-] SELECT * FROM `cmdb_sql_log` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.505ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.588ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.135ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.943ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND index_name = 'idx_cmdb_sql_log_query_time' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.720ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.954ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.672ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.533ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.742ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.036ms] [rows:-] SELECT * FROM `cmdb_sql` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.329ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.497ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.629ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.595ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_account' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.184ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.259ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.698ms] [rows:-] SELECT * FROM `config_account` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.812ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_account' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.880ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.983ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.263ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_template' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.753ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.258ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.804ms] [rows:-] SELECT * FROM `task_template` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.541ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_template' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.787ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.668ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.217ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_job' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.544ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.113ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.455ms] [rows:-] SELECT * FROM `task_job` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.975ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_job' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.741ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.167ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.145ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_work' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.713ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.304ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.605ms] [rows:-] SELECT * FROM `task_work` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.252ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_work' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.751ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.901ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.190ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_task_id' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.849ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.673ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.138ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_template_id' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.746ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.250ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[12.521ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.579ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.291ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.718ms] [rows:-] SELECT * FROM `config_ansible` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.631ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ansible' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35  +[0.780ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.203ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.675ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'config_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 19:43:35  +[0.689ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.071ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[3.503ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'config_ansible' AND constraint_name = 'uni_config_ansible_name' + +2026/01/26 19:43:35  +[0.769ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.156ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[5.200ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.835ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.255ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.767ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.602ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.222ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.197ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'idx_config_ansible_type' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.634ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.008ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.387ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.732ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.893ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.034ms] [rows:-] SELECT * FROM `task_ansible` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.169ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansible' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35  +[0.913ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[3.500ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.086ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'task_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 19:43:35  +[1.239ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[3.395ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[4.871ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'task_ansible' AND constraint_name = 'uni_task_ansible_name' + +2026/01/26 19:43:35  +[0.794ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[8.979ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[5.560ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.695ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.873ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.221ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.631ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.512ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.629ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_status' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.697ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.341ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.801ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.700ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.318ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.600ms] [rows:-] SELECT * FROM `task_ansiblework` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.535ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.681ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.247ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.986ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_id' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.710ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.244ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.447ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_work_composite' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.763ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.358ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.105ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.605ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.189ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.397ms] [rows:-] SELECT * FROM `monitor_agent` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.486ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'monitor_agent' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.774ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.197ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.353ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND index_name = 'idx_monitor_agent_host_id' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.648ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.065ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.830ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.573ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.935ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.466ms] [rows:-] SELECT * FROM `k8s_cluster` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.375ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35  +[0.908ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.347ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.311ms] [rows:2] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'k8s_cluster' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 19:43:35  +[0.898ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.328ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[3.062ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'k8s_cluster' AND constraint_name = 'uni_k8s_cluster_name' + +2026/01/26 19:43:35  +[0.518ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.183ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[3.095ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.648ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.649ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.461ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.820ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.168ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.001ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_application' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.543ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.632ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.572ms] [rows:-] SELECT * FROM `app_application` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.782ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_application' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35  +[0.868ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[1.997ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.732ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'app_application' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/26 19:43:35  +[0.778ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.872ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[3.303ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'app_application' AND constraint_name = 'uni_app_application_code' + +2026/01/26 19:43:35  +[0.772ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35  +[2.698ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35  +[3.356ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.616ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.084ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.640ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.624ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.934ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.150ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.604ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.266ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.157ms] [rows:-] SELECT * FROM `app_jenkins_env` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.727ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.945ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.178ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.496ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND index_name = 'idx_app_jenkins_env_app_id' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.650ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.839ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.160ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployments' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.751ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.121ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.381ms] [rows:-] SELECT * FROM `quick_deployments` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.399ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployments' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.715ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.643ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.129ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.591ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.070ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.477ms] [rows:-] SELECT * FROM `quick_deployment_tasks` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.285ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.786ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.820ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.362ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND index_name = 'idx_quick_deployment_tasks_deployment_id' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.625ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.167ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.695ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.724ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.115ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.409ms] [rows:-] SELECT * FROM `sys_operation_log` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.168ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.753ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.992ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.262ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_link' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.564ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.226ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.499ms] [rows:-] SELECT * FROM `tool_link` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.811ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_link' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.639ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.298ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.087ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' AND table_type = 'BASE TABLE' + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.506ms] [rows:-] SELECT DATABASE() + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.151ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.658ms] [rows:-] SELECT * FROM `tool_service_deploy` LIMIT 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.495ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' ORDER BY ORDINAL_POSITION + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/api/configcenter/dao/syncSchedule.go:70 +[1.636ms] [rows:0] SELECT * FROM `config_sync_schedule` WHERE status = 1 + +2026/01/26 19:43:35 /root/project/AutoOps/dodevops-api/api/task/dao/taskJob.go:151 +[2.045ms] [rows:0] SELECT * FROM `task_job` WHERE type = 2 +INFO[2026/01/26 - 19:43:35] 任务队列系统初始化成功 +INFO[2026/01/26 - 19:43:35] Static upload directory: ./upload/ -> /root/project/AutoOps/dodevops-api/upload +INFO[2026/01/26 - 19:43:35] Swagger API文档已启用 +INFO[2026/01/26 - 19:43:35] Conflicting values for 'process.env.NODE_ENV' +INFO[2026/01/26 - 19:43:35] +INFO[2026/01/26 - 19:43:35] App running at: +INFO[2026/01/26 - 19:43:35] - Local: http://192.168.1.156:5700 +INFO[2026/01/26 - 19:43:35] - Network: http://192.168.1.156:5700 +INFO[2026/01/26 - 19:43:35] +INFO[2026/01/26 - 19:43:35] 请注意,开发版本尚未优化 +INFO[2026/01/26 - 19:43:35] 要创建生产环境构建,请运行 go run main.go +INFO[2026/01/26 - 19:43:35] +INFO[2026/01/26 - 19:43:35] API文档地址: http://192.168.1.156:5700/swagger/index.html +INFO[2026/01/26 - 19:44:13] [GIN] 2026/01/26 - 19:44:13 | 200 | 913.401µs | 192.168.1.223 | GET  "/swagger/index.html" +INFO[2026/01/26 - 19:44:13] [GIN] 2026/01/26 - 19:44:13 | 200 | 115.6µs | 192.168.1.223 | GET  "/swagger/index.css" +INFO[2026/01/26 - 19:44:13] [GIN] 2026/01/26 - 19:44:13 | 200 | 161.741µs | 192.168.1.223 | GET  "/swagger/swagger-initializer.js" +INFO[2026/01/26 - 19:44:13] [GIN] 2026/01/26 - 19:44:13 | 200 | 444.278149ms | 192.168.1.223 | GET  "/swagger/swagger-ui.css" +INFO[2026/01/26 - 19:44:14] [GIN] 2026/01/26 - 19:44:14 | 200 | 834.813218ms | 192.168.1.223 | GET  "/swagger/swagger-ui-standalone-preset.js" +INFO[2026/01/26 - 19:44:15] [GIN] 2026/01/26 - 19:44:15 | 200 | 1.481315371s | 192.168.1.223 | GET  "/swagger/swagger-ui-bundle.js" +INFO[2026/01/26 - 19:44:16] [GIN] 2026/01/26 - 19:44:16 | 200 | 99.382µs | 192.168.1.223 | GET  "/swagger/favicon-32x32.png" +INFO[2026/01/26 - 19:44:16] [GIN] 2026/01/26 - 19:44:16 | 200 | 451.181037ms | 192.168.1.223 | GET  "/swagger/doc.json" +WARN[2026/01/26 - 19:47:56] [GIN] 2026/01/26 - 19:47:56 | 404 | 15.327µs | 192.168.1.223 | GET  "/api/v1/ws/task/ansible/103/log/102" +WARN[2026/01/26 - 19:55:40] [GIN] 2026/01/26 - 19:55:40 | 404 | 14.367µs | 192.168.1.223 | GET  "/api/v1/task/ansible/103/log102" +INFO[2026/01/26 - 19:55:47] [GIN] 2026/01/26 - 19:55:47 | 200 | 198.585µs | 192.168.1.223 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 19:56:02 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[3.037ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 +INFO[2026/01/26 - 19:56:02] [GIN] 2026/01/26 - 19:56:02 | 200 | 8.391717ms | 192.168.1.223 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 19:57:11 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[2.583ms] [rows:2] SELECT id, task_id, entry_file_name, status, start_time, end_time, duration FROM `task_ansiblework` WHERE `task_ansiblework`.`task_id` = 103 + +2026/01/26 19:57:11 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:203 +[6.178ms] [rows:1] SELECT * FROM `task_ansible` WHERE id = 103 ORDER BY `task_ansible`.`id` LIMIT 1 + +2026/01/26 19:57:11 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:715 +[25.950ms] [rows:1] UPDATE `task_ansible` SET `status`=2,`updated_at`='2026-01-26 19:57:11.898' WHERE id = 103 + +2026/01/26 19:57:11 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[12.963ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/102/01-linux-os.yaml.log',`start_time`='2026-01-26 19:57:11.925',`status`=2 WHERE id = 102 + +2026/01/26 19:57:11 /root/project/AutoOps/dodevops-api/api/system/dao/sysOperationLog.go:13 +[20.264ms] [rows:1] INSERT INTO `sys_operation_log` (`admin_id`,`username`,`method`,`ip`,`url`,`description`,`create_time`) VALUES (89,'admin','post','192.168.1.223','/api/v1/task/ansible/103/start','启动Ansible任务','2026-01-26 19:57:11.928') +INFO[2026/01/26 - 19:57:11] [GIN] 2026/01/26 - 19:57:11 | 200 | 58.520574ms | 192.168.1.223 | POST  "/api/v1/task/ansible/103/start" + +2026/01/26 19:57:18 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:156 +[2.388ms] [rows:1] SELECT id, task_id, entry_file_name, log_path, status, start_time, end_time FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 ORDER BY `task_ansiblework`.`id` LIMIT 1 + +2026/01/26 19:57:20 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.350ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 19:57:26 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.263ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 19:57:32 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.403ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 + +2026/01/26 19:57:37 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[8.243ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=25,`end_time`='2026-01-26 19:57:37.756',`error_msg`='',`exit_code`=0,`status`=3 WHERE id = 102 + +2026/01/26 19:57:37 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:839 +[7.954ms] [rows:1] UPDATE `task_ansiblework` SET `log_path`='logs/ansible/103/103/02-os.yaml.log',`start_time`='2026-01-26 19:57:37.765',`status`=2 WHERE id = 103 + +2026/01/26 19:57:38 /root/project/AutoOps/dodevops-api/api/task/dao/taskansible.go:227 +[2.570ms] [rows:1] SELECT `status` FROM `task_ansiblework` WHERE task_id = 103 AND id = 102 +INFO[2026/01/26 - 19:57:38] [GIN] 2026/01/26 - 19:57:38 | 200 | 20.311263729s | 192.168.1.223 | GET  "/api/v1/task/ansible/103/log/102" + +2026/01/26 19:57:39 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:977 +[5.624ms] [rows:1] UPDATE `task_ansiblework` SET `duration`=1,`end_time`='2026-01-26 19:57:39.496',`error_msg`='exit status 4',`exit_code`=4,`status`=4 WHERE id = 103 + +2026/01/26 19:57:39 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:999 +[1.511ms] [rows:2] SELECT * FROM `task_ansiblework` WHERE task_id = 103 + +2026/01/26 19:57:39 /root/project/AutoOps/dodevops-api/api/task/service/taskansible.go:1008 +[3.688ms] [rows:1] UPDATE `task_ansible` SET `status`=4,`total_duration`=26,`updated_at`='2026-01-26 19:57:39.503' WHERE id = 103 +DEBU[2026/01/27 - 10:49:00] Logger initialized with TextFormatter. + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.577ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.726ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.495ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_group' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.592ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.238ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.634ms] [rows:-] SELECT * FROM `cmdb_group` LIMIT 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.232ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_group' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.354ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.030ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.411ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.727ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.481ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[8.491ms] [rows:-] SELECT * FROM `config_ecsauth` LIMIT 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.209ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ecsauth' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[48.522ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `password` longtext COMMENT '''密码(type=1时使用)''' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[28.556ms] [rows:0] ALTER TABLE `config_ecsauth` MODIFY COLUMN `public_key` text COMMENT '''私钥内容(type=2时使用,字段名历史原因)''' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.208ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.459ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.448ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_keymanage' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.528ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.296ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.437ms] [rows:-] SELECT * FROM `config_keymanage` LIMIT 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.176ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_keymanage' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.764ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.501ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.811ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.495ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.201ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.493ms] [rows:-] SELECT * FROM `config_sync_schedule` LIMIT 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.982ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_sync_schedule' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.653ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.207ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.079ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_host' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.605ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.020ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.744ms] [rows:-] SELECT * FROM `cmdb_host` LIMIT 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.710ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_host' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.745ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.218ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.500ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.782ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.509ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.162ms] [rows:-] SELECT * FROM `cmdb_sql_log` LIMIT 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.775ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.616ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.292ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.118ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'cmdb_sql_log' AND index_name = 'idx_cmdb_sql_log_query_time' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.484ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.416ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.270ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.605ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.131ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:00 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.666ms] [rows:-] SELECT * FROM `cmdb_sql` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.270ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'cmdb_sql' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.614ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.662ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.198ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_account' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.597ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.570ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.094ms] [rows:-] SELECT * FROM `config_account` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.784ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_account' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.690ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.221ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.191ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_template' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.800ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.897ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.778ms] [rows:-] SELECT * FROM `task_template` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.546ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_template' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.701ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.336ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.171ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_job' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.804ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[8.134ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.034ms] [rows:-] SELECT * FROM `task_job` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.737ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_job' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.983ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.579ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[10.357ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_work' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.129ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.955ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.778ms] [rows:-] SELECT * FROM `task_work` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.008ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_work' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.895ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.227ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.396ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_task_id' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.880ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.675ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.440ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_work' AND index_name = 'idx_task_work_template_id' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.903ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.996ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.287ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.607ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[8.169ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.667ms] [rows:-] SELECT * FROM `config_ansible` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.489ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'config_ansible' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01  +[0.778ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.822ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[54.195ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'config_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/27 10:49:01  +[1.532ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[3.123ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[8.899ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'config_ansible' AND constraint_name = 'uni_config_ansible_name' + +2026/01/27 10:49:01  +[0.570ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.759ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[6.894ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.246ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.195ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.129ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'uk_config_ansible_name' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.650ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.747ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.924ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'config_ansible' AND index_name = 'idx_config_ansible_type' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.959ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.976ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.892ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.879ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.447ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.863ms] [rows:-] SELECT * FROM `task_ansible` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.367ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansible' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01  +[0.686ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.627ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.638ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'task_ansible' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/27 10:49:01  +[0.871ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.834ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[3.737ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'task_ansible' AND constraint_name = 'uni_task_ansible_name' + +2026/01/27 10:49:01  +[0.851ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[3.739ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[5.322ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.881ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.657ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.897ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_ansible_name' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.846ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.007ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.473ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansible' AND index_name = 'idx_task_status' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.648ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.976ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.748ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.635ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.473ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.246ms] [rows:-] SELECT * FROM `task_ansiblework` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.400ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.699ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.043ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.227ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_id' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.717ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.506ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.181ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'task_ansiblework' AND index_name = 'idx_task_work_composite' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.605ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.040ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.317ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.759ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.156ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.755ms] [rows:-] SELECT * FROM `monitor_agent` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.893ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'monitor_agent' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.926ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.279ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.861ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'monitor_agent' AND index_name = 'idx_monitor_agent_host_id' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.946ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.505ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.874ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.037ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.657ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.655ms] [rows:-] SELECT * FROM `k8s_cluster` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[6.012ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01  +[0.855ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.121ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.717ms] [rows:2] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'k8s_cluster' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/27 10:49:01  +[0.617ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.080ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[3.117ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'k8s_cluster' AND constraint_name = 'uni_k8s_cluster_name' + +2026/01/27 10:49:01  +[0.636ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.703ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[3.456ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.732ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.327ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.075ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'k8s_cluster' AND index_name = 'idx_k8s_cluster_name' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.724ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.133ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.523ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_application' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.472ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.453ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.681ms] [rows:-] SELECT * FROM `app_application` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[9.675ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_application' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01  +[0.919ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[4.028ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.082ms] [rows:3] +SELECT + TABLE_NAME, + COLUMN_NAME, + INDEX_NAME, + NON_UNIQUE +FROM + information_schema.STATISTICS +WHERE + TABLE_SCHEMA = 'devops' + AND TABLE_NAME = 'app_application' +ORDER BY + INDEX_NAME, + SEQ_IN_INDEX + +2026/01/27 10:49:01  +[0.991ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.376ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[3.185ms] [rows:-] SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = 'devops' AND table_name = 'app_application' AND constraint_name = 'uni_app_application_code' + +2026/01/27 10:49:01  +[1.090ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01  +[2.590ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01  +[3.745ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.756ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.176ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.345ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_application' AND index_name = 'idx_app_application_code' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.498ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.112ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.695ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.646ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.277ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.289ms] [rows:-] SELECT * FROM `app_jenkins_env` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.580ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.641ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.513ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.742ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'app_jenkins_env' AND index_name = 'idx_app_jenkins_env_app_id' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.572ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.200ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.225ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployments' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.926ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.618ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.818ms] [rows:-] SELECT * FROM `quick_deployments` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.159ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployments' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.620ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.438ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.106ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.525ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.103ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.464ms] [rows:-] SELECT * FROM `quick_deployment_tasks` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[5.156ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.905ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.004ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.280ms] [rows:-] SELECT count(*) FROM information_schema.statistics WHERE table_schema = 'devops' AND table_name = 'quick_deployment_tasks' AND index_name = 'idx_quick_deployment_tasks_deployment_id' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.650ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.512ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.379ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.642ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.134ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.501ms] [rows:-] SELECT * FROM `sys_operation_log` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.303ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'sys_operation_log' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.698ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.189ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.368ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_link' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.611ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.638ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.573ms] [rows:-] SELECT * FROM `tool_link` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[4.457ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_link' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.707ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[2.370ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.641ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' AND table_type = 'BASE TABLE' + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[0.567ms] [rows:-] SELECT DATABASE() + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[3.044ms] [rows:1] SELECT SCHEMA_NAME from Information_schema.SCHEMATA where SCHEMA_NAME LIKE 'devops%' ORDER BY SCHEMA_NAME='devops' DESC,SCHEMA_NAME limit 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[1.951ms] [rows:-] SELECT * FROM `tool_service_deploy` LIMIT 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/pkg/db/migrate.go:47 +[7.296ms] [rows:-] SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'devops' AND table_name = 'tool_service_deploy' ORDER BY ORDINAL_POSITION + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/api/configcenter/dao/syncSchedule.go:70 +[2.832ms] [rows:0] SELECT * FROM `config_sync_schedule` WHERE status = 1 + +2026/01/27 10:49:01 /root/project/AutoOps/dodevops-api/api/task/dao/taskJob.go:151 +[1.921ms] [rows:0] SELECT * FROM `task_job` WHERE type = 2 +INFO[2026/01/27 - 10:49:01] 任务队列系统初始化成功 +INFO[2026/01/27 - 10:49:01] Static upload directory: ./upload/ -> /root/project/AutoOps/dodevops-api/upload +INFO[2026/01/27 - 10:49:01] Swagger API文档已启用 +INFO[2026/01/27 - 10:49:01] Conflicting values for 'process.env.NODE_ENV' +INFO[2026/01/27 - 10:49:01] +INFO[2026/01/27 - 10:49:01] App running at: +INFO[2026/01/27 - 10:49:01] - Local: http://192.168.1.156:5700 +INFO[2026/01/27 - 10:49:01] - Network: http://192.168.1.156:5700 +INFO[2026/01/27 - 10:49:01] +INFO[2026/01/27 - 10:49:01] 请注意,开发版本尚未优化 +INFO[2026/01/27 - 10:49:01] 要创建生产环境构建,请运行 go run main.go +INFO[2026/01/27 - 10:49:01] +INFO[2026/01/27 - 10:49:01] API文档地址: http://192.168.1.156:5700/swagger/index.html diff --git a/dodevops-api/pkg/db/migrate.go b/dodevops-api/pkg/db/migrate.go index 0a3006e..8bd8060 100644 --- a/dodevops-api/pkg/db/migrate.go +++ b/dodevops-api/pkg/db/migrate.go @@ -2,13 +2,13 @@ package db import ( + appmodel "dodevops-api/api/app/model" cmdbmodel "dodevops-api/api/cmdb/model" ccmodel "dodevops-api/api/configcenter/model" - monitormodel "dodevops-api/api/monitor/model" - taskmodel "dodevops-api/api/task/model" k8smodel "dodevops-api/api/k8s/model" - appmodel "dodevops-api/api/app/model" + monitormodel "dodevops-api/api/monitor/model" systemmodel "dodevops-api/api/system/model" + taskmodel "dodevops-api/api/task/model" toolmodel "dodevops-api/api/tool/model" "gorm.io/gorm" @@ -29,6 +29,9 @@ var models = []interface{}{ &taskmodel.TaskWork{}, &taskmodel.TaskAnsible{}, &taskmodel.TaskAnsibleWork{}, + &taskmodel.TaskAnsibleHistory{}, + &taskmodel.TaskAnsibleworkHistory{}, + &taskmodel.ConfigAnsible{}, &monitormodel.Agent{}, &k8smodel.KubeCluster{}, &appmodel.Application{}, diff --git a/dodevops-api/router/task/task.go b/dodevops-api/router/task/task.go index 4ca19eb..1354add 100644 --- a/dodevops-api/router/task/task.go +++ b/dodevops-api/router/task/task.go @@ -21,18 +21,18 @@ func RegisterTaskRoutes(router *gin.RouterGroup) { router.GET("/template/query/type", middleware.AuthMiddleware(), controller.GetTemplatesByType) // 任务管理路由 - router.POST("/task/add", middleware.AuthMiddleware(), controller.CreateTask) // 创建任务 - router.GET("/task/get", middleware.AuthMiddleware(), controller.GetTaskByID) // 获取任务信息 - router.PUT("/task/update", middleware.AuthMiddleware(), controller.UpdateTask) // 修改任务 - router.DELETE("/task/delete", middleware.AuthMiddleware(), controller.DeleteTask) // 删除任务 - router.GET("/task/list", middleware.AuthMiddleware(), controller.ListTasks) // 获取任务列表 + router.POST("/task/add", middleware.AuthMiddleware(), controller.CreateTask) // 创建任务 + router.GET("/task/get", middleware.AuthMiddleware(), controller.GetTaskByID) // 获取任务信息 + router.PUT("/task/update", middleware.AuthMiddleware(), controller.UpdateTask) // 修改任务 + router.DELETE("/task/delete", middleware.AuthMiddleware(), controller.DeleteTask) // 删除任务 + router.GET("/task/list", middleware.AuthMiddleware(), controller.ListTasks) // 获取任务列表 router.GET("/task/list-with-details", middleware.AuthMiddleware(), controller.ListTasksWithDetails) // 获取任务列表(包含关联信息) - router.GET("/task/query/name", middleware.AuthMiddleware(), controller.GetTasksByName) // 获取任务名称列表 - router.GET("/task/query/type", middleware.AuthMiddleware(), controller.GetTasksByType) // 获取任务类型列表 - router.GET("/task/query/status", middleware.AuthMiddleware(), controller.GetTasksByStatus) // 获取任务状态列表 - router.GET("/task/next-execution", middleware.AuthMiddleware(), controller.GetNextExecutionTime) // 获取任务下次执行时间 - router.GET("/task/execution-info", middleware.AuthMiddleware(), controller.GetTaskExecutionInfo) // 获取任务执行信息 - router.GET("/task/templates", middleware.AuthMiddleware(), controller.GetTaskTemplatesWithStatus) // 获取任务模板列表 + router.GET("/task/query/name", middleware.AuthMiddleware(), controller.GetTasksByName) // 获取任务名称列表 + router.GET("/task/query/type", middleware.AuthMiddleware(), controller.GetTasksByType) // 获取任务类型列表 + router.GET("/task/query/status", middleware.AuthMiddleware(), controller.GetTasksByStatus) // 获取任务状态列表 + router.GET("/task/next-execution", middleware.AuthMiddleware(), controller.GetNextExecutionTime) // 获取任务下次执行时间 + router.GET("/task/execution-info", middleware.AuthMiddleware(), controller.GetTaskExecutionInfo) // 获取任务执行信息 + router.GET("/task/templates", middleware.AuthMiddleware(), controller.GetTaskTemplatesWithStatus) // 获取任务模板列表 // 任务作业路由 router.POST("/taskjob/start", middleware.AuthMiddleware(), controller.TaskWork().StartJob) @@ -42,18 +42,18 @@ func RegisterTaskRoutes(router *gin.RouterGroup) { // 任务监控路由 taskMonitorCtrl := controller.NewTaskMonitorController() - router.GET("/task/monitor/queue/metrics", middleware.AuthMiddleware(), taskMonitorCtrl.GetQueueMetrics) // 获取队列指标 - router.GET("/task/monitor/scheduler/stats", middleware.AuthMiddleware(), taskMonitorCtrl.GetSchedulerStats) // 获取调度器统计 - router.GET("/task/monitor/system/status", middleware.AuthMiddleware(), taskMonitorCtrl.GetSystemStatus) // 获取系统状态 - router.GET("/task/monitor/queue/details", middleware.AuthMiddleware(), taskMonitorCtrl.GetQueueDetails) // 获取队列详情 + router.GET("/task/monitor/queue/metrics", middleware.AuthMiddleware(), taskMonitorCtrl.GetQueueMetrics) // 获取队列指标 + router.GET("/task/monitor/scheduler/stats", middleware.AuthMiddleware(), taskMonitorCtrl.GetSchedulerStats) // 获取调度器统计 + router.GET("/task/monitor/system/status", middleware.AuthMiddleware(), taskMonitorCtrl.GetSystemStatus) // 获取系统状态 + router.GET("/task/monitor/queue/details", middleware.AuthMiddleware(), taskMonitorCtrl.GetQueueDetails) // 获取队列详情 router.POST("/task/monitor/queue/clear-failed", middleware.AuthMiddleware(), taskMonitorCtrl.ClearFailedQueue) // 清空失败队列 router.POST("/task/monitor/queue/retry-failed", middleware.AuthMiddleware(), taskMonitorCtrl.RetryFailedTasks) // 重试失败任务 // 定时任务管理路由 - router.POST("/task/monitor/scheduled/pause", middleware.AuthMiddleware(), taskMonitorCtrl.PauseScheduledTask) // 暂停定时任务 - router.POST("/task/monitor/scheduled/resume", middleware.AuthMiddleware(), taskMonitorCtrl.ResumeScheduledTask) // 恢复定时任务 + router.POST("/task/monitor/scheduled/pause", middleware.AuthMiddleware(), taskMonitorCtrl.PauseScheduledTask) // 暂停定时任务 + router.POST("/task/monitor/scheduled/resume", middleware.AuthMiddleware(), taskMonitorCtrl.ResumeScheduledTask) // 恢复定时任务 router.POST("/task/monitor/scheduled/reset", middleware.AuthMiddleware(), taskMonitorCtrl.ResetScheduledTaskStatus) // 重置定时任务状态 - router.GET("/task/monitor/task/status", middleware.AuthMiddleware(), taskMonitorCtrl.GetTaskStatus) // 获取任务状态详情 + router.GET("/task/monitor/task/status", middleware.AuthMiddleware(), taskMonitorCtrl.GetTaskStatus) // 获取任务状态详情 // Ansible任务路由 taskAnsibleCtrl := controller.NewTaskAnsibleController(service.NewTaskAnsibleService(common.GetDB())) @@ -61,12 +61,29 @@ func RegisterTaskRoutes(router *gin.RouterGroup) { router.POST("/task/ansible", middleware.AuthMiddleware(), taskAnsibleCtrl.CreateTask) // 创建Ansible任务 router.POST("/task/k8s", middleware.AuthMiddleware(), taskAnsibleCtrl.CreateK8sTask) // 创建K8s任务 router.GET("/task/ansible/:id", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTask) // 通过任务ID获取任务信息 + router.PUT("/task/ansible/:id", middleware.AuthMiddleware(), taskAnsibleCtrl.UpdateTask) // 修改任务 router.POST("/task/ansible/:id/start", middleware.AuthMiddleware(), taskAnsibleCtrl.StartTask) // 启动任务(支持Ansible和K8s) router.DELETE("/task/ansible/:id", middleware.AuthMiddleware(), taskAnsibleCtrl.DeleteTask) // 删除任务(级联删除子任务) router.GET("/task/ansible/:id/log/:work_id", middleware.AuthMiddleware(), taskAnsibleCtrl.GetJobLog) // 获取任务日志(SSE) router.GET("/task/ansible/query/name", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTasksByName) // 根据名称模糊查询任务 + router.GET("/task/ansible/query", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTasks) // 多条件查询任务 router.GET("/task/ansible/query/type", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTasksByType) // 根据类型查询任务 + // 任务历史记录路由 + router.GET("/task/ansible/:id/history", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTaskHistoryList) // 获取任务历史列表 + router.GET("/task/ansible/:id/history/:history_id", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTaskHistoryDetail) // 获取任务历史详情(包含taskId校验) + router.DELETE("/task/ansible/:id/history/:history_id", middleware.AuthMiddleware(), taskAnsibleCtrl.DeleteTaskHistory) // 删除任务历史记录 + router.GET("/task/ansible/history/work/:work_history_id/log", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTaskHistoryLog) // 获取历史任务日志内容 + router.GET("/task/ansible/history/detail/task/:task_id/work/:work_id/history/:history_id/log", middleware.AuthMiddleware(), taskAnsibleCtrl.GetTaskHistoryLogByDetails) // 获取历史任务日志内容(通过详细信息) + + // Ansible配置管理路由 + configAnsibleCtrl := controller.NewConfigAnsibleController(service.NewConfigAnsibleService(common.GetDB())) + router.POST("/config/ansible", middleware.AuthMiddleware(), configAnsibleCtrl.Create) + router.PUT("/config/ansible/:id", middleware.AuthMiddleware(), configAnsibleCtrl.Update) + router.DELETE("/config/ansible/:id", middleware.AuthMiddleware(), configAnsibleCtrl.Delete) + router.GET("/config/ansible/:id", middleware.AuthMiddleware(), configAnsibleCtrl.Get) + router.GET("/config/ansible", middleware.AuthMiddleware(), configAnsibleCtrl.List) + } // RegisterWebSocketRoutes 注册WebSocket路由(不需要中间件认证) diff --git a/dodevops-api/scheduler/manager.go b/dodevops-api/scheduler/manager.go index 28ce418..995d0df 100644 --- a/dodevops-api/scheduler/manager.go +++ b/dodevops-api/scheduler/manager.go @@ -10,6 +10,7 @@ import ( // Manager 调度器管理器 type Manager struct { syncScheduler *SyncScheduler + taskScheduler *TaskScheduler mutex sync.RWMutex running bool } @@ -24,6 +25,7 @@ func GetManager() *Manager { once.Do(func() { instance = &Manager{ syncScheduler: NewSyncScheduler(), + taskScheduler: NewTaskScheduler(), running: false, } }) @@ -47,6 +49,11 @@ func (m *Manager) Start() error { return err } + // 启动 Ansible 定时任务调度器 + if err := m.taskScheduler.Start(); err != nil { + return err + } + m.running = true log.Println("调度器管理器启动成功") return nil @@ -66,6 +73,8 @@ func (m *Manager) Stop() { // 停止定时同步调度器 m.syncScheduler.Stop() + // 停止 Ansible 定时任务调度器 + m.taskScheduler.Stop() m.running = false log.Println("调度器管理器已停止") @@ -129,4 +138,9 @@ func (m *Manager) GetSyncSchedulerStats() map[string]interface{} { stats := m.syncScheduler.GetJobStats() stats["status"] = "running" return stats +} + +// GetTaskScheduler 获取Ansible任务调度器 +func (m *Manager) GetTaskScheduler() *TaskScheduler { + return m.taskScheduler } \ No newline at end of file diff --git a/dodevops-api/scheduler/taskScheduler.go b/dodevops-api/scheduler/taskScheduler.go new file mode 100644 index 0000000..3f0bd8a --- /dev/null +++ b/dodevops-api/scheduler/taskScheduler.go @@ -0,0 +1,109 @@ +package scheduler + +import ( + "fmt" + "log" + "sync" + + "dodevops-api/api/task/model" + "dodevops-api/api/task/service" + "dodevops-api/common" + + "github.com/robfig/cron/v3" +) + +type TaskScheduler struct { + cron *cron.Cron + taskService service.ITaskAnsibleService + scheduleJobs map[uint]cron.EntryID + mutex sync.RWMutex +} + +func NewTaskScheduler() *TaskScheduler { + return &TaskScheduler{ + cron: cron.New(cron.WithSeconds()), + taskService: service.NewTaskAnsibleService(common.GetDB()), + scheduleJobs: make(map[uint]cron.EntryID), + } +} + +// Start 启动调度器 +func (s *TaskScheduler) Start() error { + log.Println("[Scheduler] Starting task scheduler service...") + + // 注册回调函数,当Service层有任务变更时通知调度器 + service.OnTaskConfigChange = func(task *model.TaskAnsible) { + log.Printf("[Scheduler] Received task update event for Task ID: %d", task.ID) + if err := s.AddTaskSchedule(task); err != nil { + log.Printf("[Scheduler] Failed to update schedule for task %d: %v", task.ID, err) + } + } + + s.cron.Start() + log.Println("[Scheduler] Cron engine started.") + return s.LoadActiveSchedules() +} + +// Stop 停止调度器 +func (s *TaskScheduler) Stop() { + s.cron.Stop() +} + +// LoadActiveSchedules 加载所有启用的定时任务 +func (s *TaskScheduler) LoadActiveSchedules() error { + var tasks []model.TaskAnsible + // Find recurring tasks + if err := common.GetDB().Where("is_recurring = ?", 1).Find(&tasks).Error; err != nil { + return err + } + + for _, task := range tasks { + if err := s.AddTaskSchedule(&task); err != nil { + log.Printf("Failed to add task schedule %d: %v", task.ID, err) + } + } + return nil +} + +// AddTaskSchedule 添加/更新定时任务 +func (s *TaskScheduler) AddTaskSchedule(task *model.TaskAnsible) error { + s.mutex.Lock() + defer s.mutex.Unlock() + + // 先移除旧的 + if entryID, exists := s.scheduleJobs[task.ID]; exists { + s.cron.Remove(entryID) + delete(s.scheduleJobs, task.ID) + } + + // 检查是否应该添加 + if task.IsRecurring != 1 || task.CronExpr == "" { + return nil + } + + entryID, err := s.cron.AddFunc(task.CronExpr, func() { + // 执行任务 + log.Printf("Executing scheduled task: %s (%d)", task.Name, task.ID) + if err := s.taskService.ExecuteTask(task.ID); err != nil { + log.Printf("Failed to execute scheduled task %d: %v", task.ID, err) + } + }) + if err != nil { + return fmt.Errorf("bad cron expr '%s': %v", task.CronExpr, err) + } + + s.scheduleJobs[task.ID] = entryID + log.Printf("Added schedule for task %d [%s]: %s", task.ID, task.Name, task.CronExpr) + return nil +} + +// RemoveTaskSchedule 移除任务调度 +func (s *TaskScheduler) RemoveTaskSchedule(taskID uint) { + s.mutex.Lock() + defer s.mutex.Unlock() + if entryID, exists := s.scheduleJobs[taskID]; exists { + s.cron.Remove(entryID) + delete(s.scheduleJobs, taskID) + log.Printf("Removed schedule for task %d", taskID) + } +} diff --git "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/01-linux-os.yaml.yml" "b/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/01-linux-os.yaml.yml" deleted file mode 100644 index 03f3250..0000000 --- "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/01-linux-os.yaml.yml" +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: web - gather_facts: yes - - roles: - - linux diff --git "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/hosts" "b/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/hosts" deleted file mode 100644 index fbc15af..0000000 --- "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/hosts" +++ /dev/null @@ -1,4 +0,0 @@ -[web] -172.16.226.16 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=123456 -[api] -172.16.226.7 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=123456 diff --git "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/roles/linux/tasks/main.yaml" "b/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/roles/linux/tasks/main.yaml" deleted file mode 100755 index 059a9bc..0000000 --- "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/roles/linux/tasks/main.yaml" +++ /dev/null @@ -1,121 +0,0 @@ ---- -# Ansible 巡检任务:检查 Linux 系统健康状态 -# 作者:Qwen -# 用途:系统巡检,输出关键指标 - -- name: "01 获取系统基本信息" - command: uname -a - register: sys_uname -- name: "显示系统内核信息" - debug: - msg: "系统内核: {{ sys_uname.stdout }}" - -- name: "02 获取操作系统版本" - shell: cat /etc/os-release | grep PRETTY_NAME - register: os_release -- name: "显示操作系统版本" - debug: - msg: "操作系统: {{ os_release.stdout | regex_replace('PRETTY_NAME=\"?(.*)\"?', '\\1') }}" - -- name: "03 检查CPU使用情况" - shell: top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1 - register: cpu_usage -- name: "显示CPU使用率" - debug: - msg: "当前CPU使用率: {{ cpu_usage.stdout }}%" - -- name: "04 检查内存使用情况" - shell: | - free -h | awk '/^Mem:/ {print "总内存: "$2", 已用: "$3", 空闲: "$4", 使用率: "int($3/$2*100)"%"}' - register: mem_info -- name: "显示内存使用情况" - debug: - msg: "{{ mem_info.stdout }}" - -- name: "05 检查磁盘使用率" - shell: | - df -hT / | tail -n +2 | awk '{print $7" 使用: "$5" (总: "$2", 可用: "$4")"}' - register: disk_root -- name: "显示根分区磁盘使用" - debug: - msg: "根分区 {{ disk_root.stdout }}" - -- name: "06 检查所有磁盘挂载点使用超过80%的分区" - shell: | - df -h | awk '$5+0 > 80 {print $1" "$5" "$6}' - register: disk_usage - ignore_errors: yes - -- name: "警告:高磁盘使用率分区" - debug: - msg: "以下分区使用率超过80%: {{ disk_usage.stdout_lines }}" - when: disk_usage.stdout != '' - -- name: "提示:所有分区使用正常" - debug: - msg: "所有磁盘分区使用率均低于80%" - when: disk_usage.stdout == '' - -- name: "07 检查SSH服务状态" - systemd: - name: sshd - state: started - enabled: yes - register: ssh_status - ignore_errors: yes -- name: "SSH服务状态检查" - debug: - msg: "SSH服务: {{ '运行中且开机自启' if ssh_status is success else '未运行或未启用,请检查' }}" - -- name: "08 检查防火墙状态" - shell: systemctl is-active firewalld && systemctl is-enabled firewalld - register: firewall_status - ignore_errors: yes -- name: "防火墙状态" - debug: - msg: "防火墙: {{ '启用并运行中' if firewall_status.stdout.find('active') != -1 and firewall_status.stdout.find('enabled') != -1 else '未启用或未运行' }}" - -- name: "09 检查系统时间与网络时间同步" - shell: timedatectl status | grep 'System clock synchronized' | awk '{print $4}' - register: time_sync -- name: "时间同步状态" - debug: - msg: "系统时间已同步: {{ time_sync.stdout == 'yes' }}" - -- name: "10 检查最大文件句柄数" - shell: cat /etc/security/limits.conf | grep -v '^#' | grep 'soft nofile' || echo '未设置' - register: file_limit -- name: "显示文件句柄软限制" - debug: - msg: "文件句柄 soft 限制: {{ file_limit.stdout }}" - -- name: "11 检查关键日志目录是否存在" - stat: - path: /var/log/messages - register: log_messages -- name: "检查 /var/log/messages" - debug: - msg: "/var/log/messages 存在: {{ log_messages.stat.exists }}" - -- name: "12 检查当前登录用户" - shell: who - register: who_info -- name: "当前登录用户" - debug: - msg: "当前登录用户: {{ who_info.stdout_lines }}" - -- name: "13 检查最近5条系统错误日志" - shell: journalctl -p err -n 5 --no-pager - register: error_logs - ignore_errors: yes -- name: "最近系统错误日志" - debug: - msg: "{{ error_logs.stdout_lines }}" - - -- name: "14 输出巡检完成时间" - command: date "+%Y-%m-%d %H:%M:%S" - register: end_time -- name: "巡检完成" - debug: - msg: "系统巡检完成,结束时间: {{ end_time.stdout }}" diff --git "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/roles/os/tasks/main.yaml" "b/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/roles/os/tasks/main.yaml" deleted file mode 100755 index ce57e62..0000000 --- "a/dodevops-api/task/21/\345\211\215\347\253\257\346\265\213\350\257\225001/roles/os/tasks/main.yaml" +++ /dev/null @@ -1,123 +0,0 @@ ---- -# Linux 系统初始化与性能优化 Ansible 任务 -# 支持:CentOS 7/8/9, RHEL - -- name: "01 确保收集系统 facts" - setup: - -- name: "02 关闭 SELinux" - selinux: - state: disabled - when: ansible_os_family == "RedHat" - -- name: "03 停止并禁用 firewalld 防火墙" - systemd: - name: firewalld - state: stopped - enabled: no - when: ansible_os_family == "RedHat" - -- name: "04 安装 chrony 时间同步服务" - yum: - name: chrony - state: present - when: ansible_os_family == "RedHat" - -- name: "05 启用并启动 chrony 服务" - systemd: - name: chronyd - enabled: yes - state: started - when: ansible_os_family == "RedHat" - -- name: "06 配置时区为 Asia/Shanghai" - shell: | - timedatectl set-timezone Asia/Shanghai - timedatectl set-local-rtc yes # 可选:设置硬件时钟为本地时间 - args: - warn: false - when: ansible_os_family == "RedHat" - -- name: "07 配置内核参数优化" - sysctl: - name: "{{ item.name }}" - value: "{{ item.value }}" - state: present - reload: yes - loop: - - { name: 'net.core.somaxconn', value: '65535' } - - { name: 'net.core.netdev_max_backlog', value: '5000' } - - { name: 'net.ipv4.tcp_max_syn_backlog', value: '65535' } - - { name: 'net.ipv4.tcp_fin_timeout', value: '30' } - - { name: 'net.ipv4.tcp_tw_reuse', value: '1' } - - { name: 'vm.swappiness', value: '10' } - - { name: 'fs.file-max', value: '1000000' } - - { name: 'kernel.pid_max', value: '65535' } - when: ansible_os_family == "RedHat" - -- name: "08 配置文件句柄数优化" - pam_limits: - domain: '*' - limit_type: '-' - limit_item: nofile - value: '65535' - -- name: "09 禁用透明大页(Transparent Huge Pages)" - shell: | - echo never > /sys/kernel/mm/transparent_hugepage/enabled 2>/dev/null || true - echo never > /sys/kernel/mm/transparent_hugepage/defrag 2>/dev/null || true - args: - warn: false - register: disable_thp - changed_when: "'never' in (disable_thp.stdout|default('')) or disable_thp.rc == 0" - -- name: "10 禁用不必要的系统服务" - shell: | - systemctl is-active --quiet {{ item }} && systemctl stop {{ item }} || true - systemctl is-enabled --quiet {{ item }} && systemctl disable {{ item }} || true - args: - warn: false - loop: - - postfix - - avahi-daemon - - bluetooth - - cups -- name: "11 设置历史命令记录格式和大小" - lineinfile: - path: /etc/profile - line: "{{ item }}" - regexp: "{{ item.split('=')[0] }}=" - loop: - - "export HISTTIMEFORMAT='%F %T %u %w %D %t '" - - "export HISTSIZE=10000" - - "export HISTFILESIZE=20000" - - "export HISTCONTROL=ignoredups" - -- name: "11 安装 EPEL 仓库" - yum: - name: epel-release - state: present - -- name: "12 安装常用系统工具" - yum: - name: - - vim-enhanced - - wget - - curl - - net-tools - - lsof - - htop - - iotop - - tree - - bash-completion - state: present - -- name: "13 清理并重建 yum 缓存" - yum: - name: '*' - state: latest - update_cache: yes - when: ansible_os_family == "RedHat" - -# Handler:重新加载 limits 配置(实际需重新登录生效) -# 可配合 ssh 会话管理或通知管理员 diff --git "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/01-linux-os.yaml.yml" "b/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/01-linux-os.yaml.yml" deleted file mode 100644 index 03f3250..0000000 --- "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/01-linux-os.yaml.yml" +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: web - gather_facts: yes - - roles: - - linux diff --git "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/hosts" "b/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/hosts" deleted file mode 100644 index 5b78a52..0000000 --- "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/hosts" +++ /dev/null @@ -1,4 +0,0 @@ -[api] -172.16.226.7 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=123456 -[web] -172.16.226.16 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=123456 diff --git "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/roles/linux/tasks/main.yaml" "b/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/roles/linux/tasks/main.yaml" deleted file mode 100755 index 059a9bc..0000000 --- "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/roles/linux/tasks/main.yaml" +++ /dev/null @@ -1,121 +0,0 @@ ---- -# Ansible 巡检任务:检查 Linux 系统健康状态 -# 作者:Qwen -# 用途:系统巡检,输出关键指标 - -- name: "01 获取系统基本信息" - command: uname -a - register: sys_uname -- name: "显示系统内核信息" - debug: - msg: "系统内核: {{ sys_uname.stdout }}" - -- name: "02 获取操作系统版本" - shell: cat /etc/os-release | grep PRETTY_NAME - register: os_release -- name: "显示操作系统版本" - debug: - msg: "操作系统: {{ os_release.stdout | regex_replace('PRETTY_NAME=\"?(.*)\"?', '\\1') }}" - -- name: "03 检查CPU使用情况" - shell: top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1 - register: cpu_usage -- name: "显示CPU使用率" - debug: - msg: "当前CPU使用率: {{ cpu_usage.stdout }}%" - -- name: "04 检查内存使用情况" - shell: | - free -h | awk '/^Mem:/ {print "总内存: "$2", 已用: "$3", 空闲: "$4", 使用率: "int($3/$2*100)"%"}' - register: mem_info -- name: "显示内存使用情况" - debug: - msg: "{{ mem_info.stdout }}" - -- name: "05 检查磁盘使用率" - shell: | - df -hT / | tail -n +2 | awk '{print $7" 使用: "$5" (总: "$2", 可用: "$4")"}' - register: disk_root -- name: "显示根分区磁盘使用" - debug: - msg: "根分区 {{ disk_root.stdout }}" - -- name: "06 检查所有磁盘挂载点使用超过80%的分区" - shell: | - df -h | awk '$5+0 > 80 {print $1" "$5" "$6}' - register: disk_usage - ignore_errors: yes - -- name: "警告:高磁盘使用率分区" - debug: - msg: "以下分区使用率超过80%: {{ disk_usage.stdout_lines }}" - when: disk_usage.stdout != '' - -- name: "提示:所有分区使用正常" - debug: - msg: "所有磁盘分区使用率均低于80%" - when: disk_usage.stdout == '' - -- name: "07 检查SSH服务状态" - systemd: - name: sshd - state: started - enabled: yes - register: ssh_status - ignore_errors: yes -- name: "SSH服务状态检查" - debug: - msg: "SSH服务: {{ '运行中且开机自启' if ssh_status is success else '未运行或未启用,请检查' }}" - -- name: "08 检查防火墙状态" - shell: systemctl is-active firewalld && systemctl is-enabled firewalld - register: firewall_status - ignore_errors: yes -- name: "防火墙状态" - debug: - msg: "防火墙: {{ '启用并运行中' if firewall_status.stdout.find('active') != -1 and firewall_status.stdout.find('enabled') != -1 else '未启用或未运行' }}" - -- name: "09 检查系统时间与网络时间同步" - shell: timedatectl status | grep 'System clock synchronized' | awk '{print $4}' - register: time_sync -- name: "时间同步状态" - debug: - msg: "系统时间已同步: {{ time_sync.stdout == 'yes' }}" - -- name: "10 检查最大文件句柄数" - shell: cat /etc/security/limits.conf | grep -v '^#' | grep 'soft nofile' || echo '未设置' - register: file_limit -- name: "显示文件句柄软限制" - debug: - msg: "文件句柄 soft 限制: {{ file_limit.stdout }}" - -- name: "11 检查关键日志目录是否存在" - stat: - path: /var/log/messages - register: log_messages -- name: "检查 /var/log/messages" - debug: - msg: "/var/log/messages 存在: {{ log_messages.stat.exists }}" - -- name: "12 检查当前登录用户" - shell: who - register: who_info -- name: "当前登录用户" - debug: - msg: "当前登录用户: {{ who_info.stdout_lines }}" - -- name: "13 检查最近5条系统错误日志" - shell: journalctl -p err -n 5 --no-pager - register: error_logs - ignore_errors: yes -- name: "最近系统错误日志" - debug: - msg: "{{ error_logs.stdout_lines }}" - - -- name: "14 输出巡检完成时间" - command: date "+%Y-%m-%d %H:%M:%S" - register: end_time -- name: "巡检完成" - debug: - msg: "系统巡检完成,结束时间: {{ end_time.stdout }}" diff --git "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/roles/os/tasks/main.yaml" "b/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/roles/os/tasks/main.yaml" deleted file mode 100755 index ce57e62..0000000 --- "a/dodevops-api/task/22/\345\211\215\347\253\257\346\265\213\350\257\225002/roles/os/tasks/main.yaml" +++ /dev/null @@ -1,123 +0,0 @@ ---- -# Linux 系统初始化与性能优化 Ansible 任务 -# 支持:CentOS 7/8/9, RHEL - -- name: "01 确保收集系统 facts" - setup: - -- name: "02 关闭 SELinux" - selinux: - state: disabled - when: ansible_os_family == "RedHat" - -- name: "03 停止并禁用 firewalld 防火墙" - systemd: - name: firewalld - state: stopped - enabled: no - when: ansible_os_family == "RedHat" - -- name: "04 安装 chrony 时间同步服务" - yum: - name: chrony - state: present - when: ansible_os_family == "RedHat" - -- name: "05 启用并启动 chrony 服务" - systemd: - name: chronyd - enabled: yes - state: started - when: ansible_os_family == "RedHat" - -- name: "06 配置时区为 Asia/Shanghai" - shell: | - timedatectl set-timezone Asia/Shanghai - timedatectl set-local-rtc yes # 可选:设置硬件时钟为本地时间 - args: - warn: false - when: ansible_os_family == "RedHat" - -- name: "07 配置内核参数优化" - sysctl: - name: "{{ item.name }}" - value: "{{ item.value }}" - state: present - reload: yes - loop: - - { name: 'net.core.somaxconn', value: '65535' } - - { name: 'net.core.netdev_max_backlog', value: '5000' } - - { name: 'net.ipv4.tcp_max_syn_backlog', value: '65535' } - - { name: 'net.ipv4.tcp_fin_timeout', value: '30' } - - { name: 'net.ipv4.tcp_tw_reuse', value: '1' } - - { name: 'vm.swappiness', value: '10' } - - { name: 'fs.file-max', value: '1000000' } - - { name: 'kernel.pid_max', value: '65535' } - when: ansible_os_family == "RedHat" - -- name: "08 配置文件句柄数优化" - pam_limits: - domain: '*' - limit_type: '-' - limit_item: nofile - value: '65535' - -- name: "09 禁用透明大页(Transparent Huge Pages)" - shell: | - echo never > /sys/kernel/mm/transparent_hugepage/enabled 2>/dev/null || true - echo never > /sys/kernel/mm/transparent_hugepage/defrag 2>/dev/null || true - args: - warn: false - register: disable_thp - changed_when: "'never' in (disable_thp.stdout|default('')) or disable_thp.rc == 0" - -- name: "10 禁用不必要的系统服务" - shell: | - systemctl is-active --quiet {{ item }} && systemctl stop {{ item }} || true - systemctl is-enabled --quiet {{ item }} && systemctl disable {{ item }} || true - args: - warn: false - loop: - - postfix - - avahi-daemon - - bluetooth - - cups -- name: "11 设置历史命令记录格式和大小" - lineinfile: - path: /etc/profile - line: "{{ item }}" - regexp: "{{ item.split('=')[0] }}=" - loop: - - "export HISTTIMEFORMAT='%F %T %u %w %D %t '" - - "export HISTSIZE=10000" - - "export HISTFILESIZE=20000" - - "export HISTCONTROL=ignoredups" - -- name: "11 安装 EPEL 仓库" - yum: - name: epel-release - state: present - -- name: "12 安装常用系统工具" - yum: - name: - - vim-enhanced - - wget - - curl - - net-tools - - lsof - - htop - - iotop - - tree - - bash-completion - state: present - -- name: "13 清理并重建 yum 缓存" - yum: - name: '*' - state: latest - update_cache: yes - when: ansible_os_family == "RedHat" - -# Handler:重新加载 limits 配置(实际需重新登录生效) -# 可配合 ssh 会话管理或通知管理员 diff --git "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/01-linux-os.yaml.yml" "b/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/01-linux-os.yaml.yml" deleted file mode 100644 index 03f3250..0000000 --- "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/01-linux-os.yaml.yml" +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: web - gather_facts: yes - - roles: - - linux diff --git "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/hosts" "b/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/hosts" deleted file mode 100644 index 70417b8..0000000 --- "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/hosts" +++ /dev/null @@ -1,2 +0,0 @@ -[web] -172.16.226.16 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=123456 diff --git "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/roles/linux/tasks/main.yaml" "b/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/roles/linux/tasks/main.yaml" deleted file mode 100755 index 059a9bc..0000000 --- "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/roles/linux/tasks/main.yaml" +++ /dev/null @@ -1,121 +0,0 @@ ---- -# Ansible 巡检任务:检查 Linux 系统健康状态 -# 作者:Qwen -# 用途:系统巡检,输出关键指标 - -- name: "01 获取系统基本信息" - command: uname -a - register: sys_uname -- name: "显示系统内核信息" - debug: - msg: "系统内核: {{ sys_uname.stdout }}" - -- name: "02 获取操作系统版本" - shell: cat /etc/os-release | grep PRETTY_NAME - register: os_release -- name: "显示操作系统版本" - debug: - msg: "操作系统: {{ os_release.stdout | regex_replace('PRETTY_NAME=\"?(.*)\"?', '\\1') }}" - -- name: "03 检查CPU使用情况" - shell: top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1 - register: cpu_usage -- name: "显示CPU使用率" - debug: - msg: "当前CPU使用率: {{ cpu_usage.stdout }}%" - -- name: "04 检查内存使用情况" - shell: | - free -h | awk '/^Mem:/ {print "总内存: "$2", 已用: "$3", 空闲: "$4", 使用率: "int($3/$2*100)"%"}' - register: mem_info -- name: "显示内存使用情况" - debug: - msg: "{{ mem_info.stdout }}" - -- name: "05 检查磁盘使用率" - shell: | - df -hT / | tail -n +2 | awk '{print $7" 使用: "$5" (总: "$2", 可用: "$4")"}' - register: disk_root -- name: "显示根分区磁盘使用" - debug: - msg: "根分区 {{ disk_root.stdout }}" - -- name: "06 检查所有磁盘挂载点使用超过80%的分区" - shell: | - df -h | awk '$5+0 > 80 {print $1" "$5" "$6}' - register: disk_usage - ignore_errors: yes - -- name: "警告:高磁盘使用率分区" - debug: - msg: "以下分区使用率超过80%: {{ disk_usage.stdout_lines }}" - when: disk_usage.stdout != '' - -- name: "提示:所有分区使用正常" - debug: - msg: "所有磁盘分区使用率均低于80%" - when: disk_usage.stdout == '' - -- name: "07 检查SSH服务状态" - systemd: - name: sshd - state: started - enabled: yes - register: ssh_status - ignore_errors: yes -- name: "SSH服务状态检查" - debug: - msg: "SSH服务: {{ '运行中且开机自启' if ssh_status is success else '未运行或未启用,请检查' }}" - -- name: "08 检查防火墙状态" - shell: systemctl is-active firewalld && systemctl is-enabled firewalld - register: firewall_status - ignore_errors: yes -- name: "防火墙状态" - debug: - msg: "防火墙: {{ '启用并运行中' if firewall_status.stdout.find('active') != -1 and firewall_status.stdout.find('enabled') != -1 else '未启用或未运行' }}" - -- name: "09 检查系统时间与网络时间同步" - shell: timedatectl status | grep 'System clock synchronized' | awk '{print $4}' - register: time_sync -- name: "时间同步状态" - debug: - msg: "系统时间已同步: {{ time_sync.stdout == 'yes' }}" - -- name: "10 检查最大文件句柄数" - shell: cat /etc/security/limits.conf | grep -v '^#' | grep 'soft nofile' || echo '未设置' - register: file_limit -- name: "显示文件句柄软限制" - debug: - msg: "文件句柄 soft 限制: {{ file_limit.stdout }}" - -- name: "11 检查关键日志目录是否存在" - stat: - path: /var/log/messages - register: log_messages -- name: "检查 /var/log/messages" - debug: - msg: "/var/log/messages 存在: {{ log_messages.stat.exists }}" - -- name: "12 检查当前登录用户" - shell: who - register: who_info -- name: "当前登录用户" - debug: - msg: "当前登录用户: {{ who_info.stdout_lines }}" - -- name: "13 检查最近5条系统错误日志" - shell: journalctl -p err -n 5 --no-pager - register: error_logs - ignore_errors: yes -- name: "最近系统错误日志" - debug: - msg: "{{ error_logs.stdout_lines }}" - - -- name: "14 输出巡检完成时间" - command: date "+%Y-%m-%d %H:%M:%S" - register: end_time -- name: "巡检完成" - debug: - msg: "系统巡检完成,结束时间: {{ end_time.stdout }}" diff --git "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/roles/os/tasks/main.yaml" "b/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/roles/os/tasks/main.yaml" deleted file mode 100755 index ce57e62..0000000 --- "a/dodevops-api/task/23/\345\211\215\347\253\257\346\265\213\350\257\225003/roles/os/tasks/main.yaml" +++ /dev/null @@ -1,123 +0,0 @@ ---- -# Linux 系统初始化与性能优化 Ansible 任务 -# 支持:CentOS 7/8/9, RHEL - -- name: "01 确保收集系统 facts" - setup: - -- name: "02 关闭 SELinux" - selinux: - state: disabled - when: ansible_os_family == "RedHat" - -- name: "03 停止并禁用 firewalld 防火墙" - systemd: - name: firewalld - state: stopped - enabled: no - when: ansible_os_family == "RedHat" - -- name: "04 安装 chrony 时间同步服务" - yum: - name: chrony - state: present - when: ansible_os_family == "RedHat" - -- name: "05 启用并启动 chrony 服务" - systemd: - name: chronyd - enabled: yes - state: started - when: ansible_os_family == "RedHat" - -- name: "06 配置时区为 Asia/Shanghai" - shell: | - timedatectl set-timezone Asia/Shanghai - timedatectl set-local-rtc yes # 可选:设置硬件时钟为本地时间 - args: - warn: false - when: ansible_os_family == "RedHat" - -- name: "07 配置内核参数优化" - sysctl: - name: "{{ item.name }}" - value: "{{ item.value }}" - state: present - reload: yes - loop: - - { name: 'net.core.somaxconn', value: '65535' } - - { name: 'net.core.netdev_max_backlog', value: '5000' } - - { name: 'net.ipv4.tcp_max_syn_backlog', value: '65535' } - - { name: 'net.ipv4.tcp_fin_timeout', value: '30' } - - { name: 'net.ipv4.tcp_tw_reuse', value: '1' } - - { name: 'vm.swappiness', value: '10' } - - { name: 'fs.file-max', value: '1000000' } - - { name: 'kernel.pid_max', value: '65535' } - when: ansible_os_family == "RedHat" - -- name: "08 配置文件句柄数优化" - pam_limits: - domain: '*' - limit_type: '-' - limit_item: nofile - value: '65535' - -- name: "09 禁用透明大页(Transparent Huge Pages)" - shell: | - echo never > /sys/kernel/mm/transparent_hugepage/enabled 2>/dev/null || true - echo never > /sys/kernel/mm/transparent_hugepage/defrag 2>/dev/null || true - args: - warn: false - register: disable_thp - changed_when: "'never' in (disable_thp.stdout|default('')) or disable_thp.rc == 0" - -- name: "10 禁用不必要的系统服务" - shell: | - systemctl is-active --quiet {{ item }} && systemctl stop {{ item }} || true - systemctl is-enabled --quiet {{ item }} && systemctl disable {{ item }} || true - args: - warn: false - loop: - - postfix - - avahi-daemon - - bluetooth - - cups -- name: "11 设置历史命令记录格式和大小" - lineinfile: - path: /etc/profile - line: "{{ item }}" - regexp: "{{ item.split('=')[0] }}=" - loop: - - "export HISTTIMEFORMAT='%F %T %u %w %D %t '" - - "export HISTSIZE=10000" - - "export HISTFILESIZE=20000" - - "export HISTCONTROL=ignoredups" - -- name: "11 安装 EPEL 仓库" - yum: - name: epel-release - state: present - -- name: "12 安装常用系统工具" - yum: - name: - - vim-enhanced - - wget - - curl - - net-tools - - lsof - - htop - - iotop - - tree - - bash-completion - state: present - -- name: "13 清理并重建 yum 缓存" - yum: - name: '*' - state: latest - update_cache: yes - when: ansible_os_family == "RedHat" - -# Handler:重新加载 limits 配置(实际需重新登录生效) -# 可配合 ssh 会话管理或通知管理员 diff --git "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/01-linux-os.yaml.yml" "b/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/01-linux-os.yaml.yml" deleted file mode 100644 index 03f3250..0000000 --- "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/01-linux-os.yaml.yml" +++ /dev/null @@ -1,6 +0,0 @@ ---- -- hosts: web - gather_facts: yes - - roles: - - linux diff --git "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/hosts" "b/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/hosts" deleted file mode 100644 index 631b224..0000000 --- "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/hosts" +++ /dev/null @@ -1,2 +0,0 @@ -[web] -172.16.226.16 ansible_ssh_port=22 ansible_ssh_user=root diff --git "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/roles/linux/tasks/main.yaml" "b/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/roles/linux/tasks/main.yaml" deleted file mode 100755 index 059a9bc..0000000 --- "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/roles/linux/tasks/main.yaml" +++ /dev/null @@ -1,121 +0,0 @@ ---- -# Ansible 巡检任务:检查 Linux 系统健康状态 -# 作者:Qwen -# 用途:系统巡检,输出关键指标 - -- name: "01 获取系统基本信息" - command: uname -a - register: sys_uname -- name: "显示系统内核信息" - debug: - msg: "系统内核: {{ sys_uname.stdout }}" - -- name: "02 获取操作系统版本" - shell: cat /etc/os-release | grep PRETTY_NAME - register: os_release -- name: "显示操作系统版本" - debug: - msg: "操作系统: {{ os_release.stdout | regex_replace('PRETTY_NAME=\"?(.*)\"?', '\\1') }}" - -- name: "03 检查CPU使用情况" - shell: top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1 - register: cpu_usage -- name: "显示CPU使用率" - debug: - msg: "当前CPU使用率: {{ cpu_usage.stdout }}%" - -- name: "04 检查内存使用情况" - shell: | - free -h | awk '/^Mem:/ {print "总内存: "$2", 已用: "$3", 空闲: "$4", 使用率: "int($3/$2*100)"%"}' - register: mem_info -- name: "显示内存使用情况" - debug: - msg: "{{ mem_info.stdout }}" - -- name: "05 检查磁盘使用率" - shell: | - df -hT / | tail -n +2 | awk '{print $7" 使用: "$5" (总: "$2", 可用: "$4")"}' - register: disk_root -- name: "显示根分区磁盘使用" - debug: - msg: "根分区 {{ disk_root.stdout }}" - -- name: "06 检查所有磁盘挂载点使用超过80%的分区" - shell: | - df -h | awk '$5+0 > 80 {print $1" "$5" "$6}' - register: disk_usage - ignore_errors: yes - -- name: "警告:高磁盘使用率分区" - debug: - msg: "以下分区使用率超过80%: {{ disk_usage.stdout_lines }}" - when: disk_usage.stdout != '' - -- name: "提示:所有分区使用正常" - debug: - msg: "所有磁盘分区使用率均低于80%" - when: disk_usage.stdout == '' - -- name: "07 检查SSH服务状态" - systemd: - name: sshd - state: started - enabled: yes - register: ssh_status - ignore_errors: yes -- name: "SSH服务状态检查" - debug: - msg: "SSH服务: {{ '运行中且开机自启' if ssh_status is success else '未运行或未启用,请检查' }}" - -- name: "08 检查防火墙状态" - shell: systemctl is-active firewalld && systemctl is-enabled firewalld - register: firewall_status - ignore_errors: yes -- name: "防火墙状态" - debug: - msg: "防火墙: {{ '启用并运行中' if firewall_status.stdout.find('active') != -1 and firewall_status.stdout.find('enabled') != -1 else '未启用或未运行' }}" - -- name: "09 检查系统时间与网络时间同步" - shell: timedatectl status | grep 'System clock synchronized' | awk '{print $4}' - register: time_sync -- name: "时间同步状态" - debug: - msg: "系统时间已同步: {{ time_sync.stdout == 'yes' }}" - -- name: "10 检查最大文件句柄数" - shell: cat /etc/security/limits.conf | grep -v '^#' | grep 'soft nofile' || echo '未设置' - register: file_limit -- name: "显示文件句柄软限制" - debug: - msg: "文件句柄 soft 限制: {{ file_limit.stdout }}" - -- name: "11 检查关键日志目录是否存在" - stat: - path: /var/log/messages - register: log_messages -- name: "检查 /var/log/messages" - debug: - msg: "/var/log/messages 存在: {{ log_messages.stat.exists }}" - -- name: "12 检查当前登录用户" - shell: who - register: who_info -- name: "当前登录用户" - debug: - msg: "当前登录用户: {{ who_info.stdout_lines }}" - -- name: "13 检查最近5条系统错误日志" - shell: journalctl -p err -n 5 --no-pager - register: error_logs - ignore_errors: yes -- name: "最近系统错误日志" - debug: - msg: "{{ error_logs.stdout_lines }}" - - -- name: "14 输出巡检完成时间" - command: date "+%Y-%m-%d %H:%M:%S" - register: end_time -- name: "巡检完成" - debug: - msg: "系统巡检完成,结束时间: {{ end_time.stdout }}" diff --git "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/roles/os/tasks/main.yaml" "b/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/roles/os/tasks/main.yaml" deleted file mode 100755 index ce57e62..0000000 --- "a/dodevops-api/task/24/\345\211\215\347\253\257\346\265\213\350\257\225004/roles/os/tasks/main.yaml" +++ /dev/null @@ -1,123 +0,0 @@ ---- -# Linux 系统初始化与性能优化 Ansible 任务 -# 支持:CentOS 7/8/9, RHEL - -- name: "01 确保收集系统 facts" - setup: - -- name: "02 关闭 SELinux" - selinux: - state: disabled - when: ansible_os_family == "RedHat" - -- name: "03 停止并禁用 firewalld 防火墙" - systemd: - name: firewalld - state: stopped - enabled: no - when: ansible_os_family == "RedHat" - -- name: "04 安装 chrony 时间同步服务" - yum: - name: chrony - state: present - when: ansible_os_family == "RedHat" - -- name: "05 启用并启动 chrony 服务" - systemd: - name: chronyd - enabled: yes - state: started - when: ansible_os_family == "RedHat" - -- name: "06 配置时区为 Asia/Shanghai" - shell: | - timedatectl set-timezone Asia/Shanghai - timedatectl set-local-rtc yes # 可选:设置硬件时钟为本地时间 - args: - warn: false - when: ansible_os_family == "RedHat" - -- name: "07 配置内核参数优化" - sysctl: - name: "{{ item.name }}" - value: "{{ item.value }}" - state: present - reload: yes - loop: - - { name: 'net.core.somaxconn', value: '65535' } - - { name: 'net.core.netdev_max_backlog', value: '5000' } - - { name: 'net.ipv4.tcp_max_syn_backlog', value: '65535' } - - { name: 'net.ipv4.tcp_fin_timeout', value: '30' } - - { name: 'net.ipv4.tcp_tw_reuse', value: '1' } - - { name: 'vm.swappiness', value: '10' } - - { name: 'fs.file-max', value: '1000000' } - - { name: 'kernel.pid_max', value: '65535' } - when: ansible_os_family == "RedHat" - -- name: "08 配置文件句柄数优化" - pam_limits: - domain: '*' - limit_type: '-' - limit_item: nofile - value: '65535' - -- name: "09 禁用透明大页(Transparent Huge Pages)" - shell: | - echo never > /sys/kernel/mm/transparent_hugepage/enabled 2>/dev/null || true - echo never > /sys/kernel/mm/transparent_hugepage/defrag 2>/dev/null || true - args: - warn: false - register: disable_thp - changed_when: "'never' in (disable_thp.stdout|default('')) or disable_thp.rc == 0" - -- name: "10 禁用不必要的系统服务" - shell: | - systemctl is-active --quiet {{ item }} && systemctl stop {{ item }} || true - systemctl is-enabled --quiet {{ item }} && systemctl disable {{ item }} || true - args: - warn: false - loop: - - postfix - - avahi-daemon - - bluetooth - - cups -- name: "11 设置历史命令记录格式和大小" - lineinfile: - path: /etc/profile - line: "{{ item }}" - regexp: "{{ item.split('=')[0] }}=" - loop: - - "export HISTTIMEFORMAT='%F %T %u %w %D %t '" - - "export HISTSIZE=10000" - - "export HISTFILESIZE=20000" - - "export HISTCONTROL=ignoredups" - -- name: "11 安装 EPEL 仓库" - yum: - name: epel-release - state: present - -- name: "12 安装常用系统工具" - yum: - name: - - vim-enhanced - - wget - - curl - - net-tools - - lsof - - htop - - iotop - - tree - - bash-completion - state: present - -- name: "13 清理并重建 yum 缓存" - yum: - name: '*' - state: latest - update_cache: yes - when: ansible_os_family == "RedHat" - -# Handler:重新加载 limits 配置(实际需重新登录生效) -# 可配合 ssh 会话管理或通知管理员 diff --git "a/dodevops-api/task/27/2025-09-08\346\265\213\350\257\225ansible\350\207\252\345\212\250\345\214\226\344\273\273\345\212\241" "b/dodevops-api/task/27/2025-09-08\346\265\213\350\257\225ansible\350\207\252\345\212\250\345\214\226\344\273\273\345\212\241" deleted file mode 160000 index e7d09da..0000000 --- "a/dodevops-api/task/27/2025-09-08\346\265\213\350\257\225ansible\350\207\252\345\212\250\345\214\226\344\273\273\345\212\241" +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e7d09daf74d9f462cda66a305194a69ace8e0d1b diff --git a/dodevops-api/task/34/k8s-1-deployment b/dodevops-api/task/34/k8s-1-deployment deleted file mode 160000 index 9ca97f4..0000000 --- a/dodevops-api/task/34/k8s-1-deployment +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9ca97f4638ca3f61b92e7d24b61a3cca0ede5f71 diff --git a/dodevops-api/task/35/k8s-2-deployment b/dodevops-api/task/35/k8s-2-deployment deleted file mode 160000 index 2b886fc..0000000 --- a/dodevops-api/task/35/k8s-2-deployment +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2b886fc7e1c5111391c4613b60c8abfe7d957cd0 diff --git a/dodevops-api/task/36/k8s-3-deployment b/dodevops-api/task/36/k8s-3-deployment deleted file mode 160000 index 33ec94a..0000000 --- a/dodevops-api/task/36/k8s-3-deployment +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 33ec94a4f3bdbd5c9c1af9a9a9dd6641b52a6077 diff --git a/dodevops-api/task/37/k8s-4-deployment b/dodevops-api/task/37/k8s-4-deployment deleted file mode 160000 index ba25ff8..0000000 --- a/dodevops-api/task/37/k8s-4-deployment +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ba25ff8c33c4f5273ba6892ba1cfcb99936d7aaf diff --git a/dodevops-api/task/38/k8s-5-deployment b/dodevops-api/task/38/k8s-5-deployment deleted file mode 160000 index d1ade49..0000000 --- a/dodevops-api/task/38/k8s-5-deployment +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d1ade4986117d2d0554c1c6810b869a1d653f87d diff --git "a/dodevops-api/task/40/\350\231\232\346\213\237\346\234\272\346\265\213\350\257\225\347\216\257\345\242\203k8s\351\233\206\347\276\244001-deployment" "b/dodevops-api/task/40/\350\231\232\346\213\237\346\234\272\346\265\213\350\257\225\347\216\257\345\242\203k8s\351\233\206\347\276\244001-deployment" deleted file mode 160000 index 512a1c1..0000000 --- "a/dodevops-api/task/40/\350\231\232\346\213\237\346\234\272\346\265\213\350\257\225\347\216\257\345\242\203k8s\351\233\206\347\276\244001-deployment" +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 512a1c14306d2c1c9f2e04ff968cdf842fa153d1 diff --git "a/dodevops-api/task/42/\350\205\276\350\256\257\344\272\221k8s001-deployment" "b/dodevops-api/task/42/\350\205\276\350\256\257\344\272\221k8s001-deployment" deleted file mode 160000 index 755e48d..0000000 --- "a/dodevops-api/task/42/\350\205\276\350\256\257\344\272\221k8s001-deployment" +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 755e48dfca4ea212574a30254fe73e425acaa412 diff --git "a/dodevops-api/task/43/\346\265\213\350\257\225ansible\344\273\273\345\212\241" "b/dodevops-api/task/43/\346\265\213\350\257\225ansible\344\273\273\345\212\241" deleted file mode 160000 index d1df2c6..0000000 --- "a/dodevops-api/task/43/\346\265\213\350\257\225ansible\344\273\273\345\212\241" +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d1df2c6bc74a3018ca858666fafa31dff2c073c2