diff --git a/backend/app/api/v1/app.go b/backend/app/api/v1/app.go index 553e84e43..5b9d5eaff 100644 --- a/backend/app/api/v1/app.go +++ b/backend/app/api/v1/app.go @@ -7,6 +7,15 @@ import ( "github.com/gin-gonic/gin" ) +// List app +// @Tags App +// @Summary Search app list +// @Description 获取应用列表 +// @Accept json +// @Param request body request.AppSearch true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /apps/search [post] func (b *BaseApi) SearchApp(c *gin.Context) { var req request.AppSearch if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/app_install.go b/backend/app/api/v1/app_install.go index 0c0ea0d60..d5b77d6b4 100644 --- a/backend/app/api/v1/app_install.go +++ b/backend/app/api/v1/app_install.go @@ -13,6 +13,15 @@ import ( "github.com/gin-gonic/gin" ) +// List app installed +// @Tags App +// @Summary Search app list installed +// @Description 获取已安装应用列表 +// @Accept json +// @Param request body request.AppInstalledSearch true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /apps/installed [post] func (b *BaseApi) SearchAppInstalled(c *gin.Context) { var req request.AppInstalledSearch if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/auth.go b/backend/app/api/v1/auth.go index 75736d7a4..6963605e0 100644 --- a/backend/app/api/v1/auth.go +++ b/backend/app/api/v1/auth.go @@ -15,6 +15,14 @@ import ( type BaseApi struct{} +// User login +// @Tags Auth +// @Summary User login +// @Description 用户登录 +// @Accept json +// @Param request body dto.Login true "request" +// @Success 200 {object} dto.UserLoginInfo +// @Router /auth/login [post] func (b *BaseApi) Login(c *gin.Context) { var req dto.Login if err := c.ShouldBindJSON(&req); err != nil { @@ -39,6 +47,14 @@ func (b *BaseApi) Login(c *gin.Context) { helper.SuccessWithData(c, user) } +// User login with mfa +// @Tags Auth +// @Summary User login with mfa +// @Description 用户 mfa 登录 +// @Accept json +// @Param request body dto.MFALogin true "request" +// @Success 200 {object} dto.UserLoginInfo +// @Router /auth/mfalogin [post] func (b *BaseApi) MFALogin(c *gin.Context) { var req dto.MFALogin if err := c.ShouldBindJSON(&req); err != nil { @@ -58,6 +74,13 @@ func (b *BaseApi) MFALogin(c *gin.Context) { helper.SuccessWithData(c, user) } +// User logout +// @Tags Auth +// @Summary User logout +// @Description 用户登出 +// @Success 200 +// @Security ApiKeyAuth +// @Router /auth/logout [post] func (b *BaseApi) LogOut(c *gin.Context) { if err := authService.LogOut(c); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) @@ -66,6 +89,12 @@ func (b *BaseApi) LogOut(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load captcha +// @Tags Auth +// @Summary Load captcha +// @Description 加载验证码 +// @Success 200 {object} dto.CaptchaResponse +// @Router /auth/captcha [get] func (b *BaseApi) Captcha(c *gin.Context) { captcha, err := captcha.CreateCaptcha() if err != nil { @@ -75,6 +104,13 @@ func (b *BaseApi) Captcha(c *gin.Context) { helper.SuccessWithData(c, captcha) } +// Load safety status +// @Tags Auth +// @Summary Load safety status +// @Description 获取系统安全登录状态 +// @Success 200 +// @Failure 402 +// @Router /auth/status [get] func (b *BaseApi) GetSafetyStatus(c *gin.Context) { if err := authService.SafetyStatus(c); err != nil { helper.ErrorWithDetail(c, constant.CodeErrUnSafety, constant.ErrTypeNotSafety, err) @@ -110,6 +146,14 @@ func (b *BaseApi) CheckIsFirstLogin(c *gin.Context) { helper.SuccessWithData(c, authService.CheckIsFirst()) } +// Init user +// @Tags Auth +// @Summary Init user +// @Description 初始化用户 +// @Accept json +// @Param request body dto.InitUser true "request" +// @Success 200 +// @Router /auth/init [post] func (b *BaseApi) InitUserInfo(c *gin.Context) { var req dto.InitUser if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/backup.go b/backend/app/api/v1/backup.go index 0a633d2ac..146c9627c 100644 --- a/backend/app/api/v1/backup.go +++ b/backend/app/api/v1/backup.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create backup account +// @Tags Backup Account +// @Summary Create backup account +// @Description 创建备份账号 +// @Accept json +// @Param request body dto.BackupOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /backups [post] +// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建备份账号 [type]","formatEN":"create backup account [type]"} func (b *BaseApi) CreateBackup(c *gin.Context) { var req dto.BackupOperate if err := c.ShouldBindJSON(&req); err != nil { @@ -25,6 +35,15 @@ func (b *BaseApi) CreateBackup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// List bucket +// @Tags Backup Account +// @Summary List bucket +// @Description 获取 bucket 列表 +// @Accept json +// @Param request body dto.ForBuckets true "request" +// @Success 200 {anrry} string +// @Security ApiKeyAuth +// @Router /backups/search [post] func (b *BaseApi) ListBuckets(c *gin.Context) { var req dto.ForBuckets if err := c.ShouldBindJSON(&req); err != nil { @@ -43,6 +62,16 @@ func (b *BaseApi) ListBuckets(c *gin.Context) { helper.SuccessWithData(c, buckets) } +// Delete backup account +// @Tags Backup Account +// @Summary Delete backup account +// @Description 删除备份账号 +// @Accept json +// @Param request body dto.BatchDeleteReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /backups/del [post] +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"backup_accounts","output_colume":"type","output_value":"types"}],"formatZH":"删除备份账号 [types]","formatEN":"delete backup account [types]"} func (b *BaseApi) DeleteBackup(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -61,6 +90,15 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Page backup records +// @Tags Backup Account +// @Summary Search backup records with page +// @Description 获取备份记录列表分页 +// @Accept json +// @Param request body dto.RecordSearch true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /backups/record/search [post] func (b *BaseApi) SearchBackupRecords(c *gin.Context) { var req dto.RecordSearch if err := c.ShouldBindJSON(&req); err != nil { @@ -80,6 +118,16 @@ func (b *BaseApi) SearchBackupRecords(c *gin.Context) { }) } +// Download backup record +// @Tags Backup Account +// @Summary Download backup record +// @Description 下载备份记录 +// @Accept json +// @Param request body dto.DownloadRecord true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /backups/record/download [post] +// @x-panel-log {"bodyKeys":["source","fileName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"下载备份记录 [source][fileName]","formatEN":"download backup records [source][fileName]"} func (b *BaseApi) DownloadRecord(c *gin.Context) { var req dto.DownloadRecord if err := c.ShouldBindJSON(&req); err != nil { @@ -99,6 +147,16 @@ func (b *BaseApi) DownloadRecord(c *gin.Context) { c.File(filePath) } +// Delete backup record +// @Tags Backup Account +// @Summary Delete backup record +// @Description 删除备份记录 +// @Accept json +// @Param request body dto.BatchDeleteReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /backups/record/del [post] +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"backup_records","output_colume":"file_name","output_value":"files"}],"formatZH":"删除备份记录 [files]","formatEN":"delete backup records [files]"} func (b *BaseApi) DeleteBackupRecord(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -117,6 +175,16 @@ func (b *BaseApi) DeleteBackupRecord(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update backup account +// @Tags Backup Account +// @Summary Update backup account +// @Description 更新备份账号信息 +// @Accept json +// @Param request body dto.BackupOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /backups/update [post] +// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新备份账号 [types]","formatEN":"update backup account [types]"} func (b *BaseApi) UpdateBackup(c *gin.Context) { var req dto.BackupOperate if err := c.ShouldBindJSON(&req); err != nil { @@ -139,6 +207,13 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// List backup account +// @Tags Backup Account +// @Summary Search backup account +// @Description 获取备份账号列表 +// @Success 200 {anrry} dto.BackupInfo +// @Security ApiKeyAuth +// @Router /backups/search [get] func (b *BaseApi) ListBackup(c *gin.Context) { data, err := backupService.List() if err != nil { diff --git a/backend/app/api/v1/command.go b/backend/app/api/v1/command.go index 21f87f6c0..0b616527b 100644 --- a/backend/app/api/v1/command.go +++ b/backend/app/api/v1/command.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create command +// @Tags Command +// @Summary Create command +// @Description 创建快速命令 +// @Accept json +// @Param request body dto.CommandOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /commands [post] +// @x-panel-log {"bodyKeys":["name","command"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建快捷命令 [name][command]","formatEN":"create quick command [name][command]"} func (b *BaseApi) CreateCommand(c *gin.Context) { var req dto.CommandOperate if err := c.ShouldBindJSON(&req); err != nil { @@ -25,6 +35,15 @@ func (b *BaseApi) CreateCommand(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Page command +// @Tags Command +// @Summary Search command with page +// @Description 获取快速命令列表分页 +// @Accept json +// @Param request body dto.SearchWithPage true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /commands [post] func (b *BaseApi) SearchCommand(c *gin.Context) { var req dto.SearchWithPage if err := c.ShouldBindJSON(&req); err != nil { @@ -44,6 +63,13 @@ func (b *BaseApi) SearchCommand(c *gin.Context) { }) } +// List command +// @Tags Command +// @Summary Search command +// @Description 获取快速命令列表 +// @Success 200 {object} dto.CommandInfo +// @Security ApiKeyAuth +// @Router /commands [get] func (b *BaseApi) ListCommand(c *gin.Context) { list, err := commandService.List() if err != nil { @@ -54,6 +80,16 @@ func (b *BaseApi) ListCommand(c *gin.Context) { helper.SuccessWithData(c, list) } +// Delete command +// @Tags Command +// @Summary Delete command +// @Description 删除快速命令 +// @Accept json +// @Param request body dto.BatchDeleteReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /commands/del [post] +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"commands","output_colume":"name","output_value":"names"}],"formatZH":"删除快捷命令 [names]","formatEN":"delete quick command [names]"} func (b *BaseApi) DeleteCommand(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -72,6 +108,16 @@ func (b *BaseApi) DeleteCommand(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update command +// @Tags Command +// @Summary Update command +// @Description 更新快速命令 +// @Accept json +// @Param request body dto.CommandOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /commands/update [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新快捷命令 [name]","formatEN":"update quick command [name]"} func (b *BaseApi) UpdateCommand(c *gin.Context) { var req dto.CommandOperate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/compose_template.go b/backend/app/api/v1/compose_template.go index 484907bb7..f66937a0c 100644 --- a/backend/app/api/v1/compose_template.go +++ b/backend/app/api/v1/compose_template.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create Compose template +// @Tags Container Compose-template +// @Summary Create Compose template +// @Description 创建容器编排模版 +// @Accept json +// @Param request body dto.ComposeTemplateCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/template [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建 compose 模版 [name]","formatEN":"create compose template [name]"} func (b *BaseApi) CreateComposeTemplate(c *gin.Context) { var req dto.ComposeTemplateCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -25,6 +35,16 @@ func (b *BaseApi) CreateComposeTemplate(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Page compose template +// @Tags Container Compose-template +// @Summary Search compose template list with page +// @Description 获取容器编排模版列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/template/search [post] func (b *BaseApi) SearchComposeTemplate(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -44,6 +64,14 @@ func (b *BaseApi) SearchComposeTemplate(c *gin.Context) { }) } +// List compose template +// @Tags Container Compose-template +// @Summary Search compose template list +// @Description 获取容器编排模版列表 +// @Produce json +// @Success 200 {anrry} dto.ComposeTemplateInfo +// @Security ApiKeyAuth +// @Router /containers/template [get] func (b *BaseApi) ListComposeTemplate(c *gin.Context) { list, err := composeTemplateService.List() if err != nil { @@ -54,6 +82,16 @@ func (b *BaseApi) ListComposeTemplate(c *gin.Context) { helper.SuccessWithData(c, list) } +// Delete compose template +// @Tags Container Compose-template +// @Summary Delete compose template +// @Description 删除容器编排模版 +// @Accept json +// @Param request body dto.BatchDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/template/del [post] +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"compose_templates","output_colume":"name","output_value":"names"}],"formatZH":"删除 compose 模版 [names]","formatEN":"delete compose template [names]"} func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -72,6 +110,16 @@ func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update compose template +// @Tags Container Compose-template +// @Summary Update compose template +// @Description 更新容器编排模版 +// @Accept json +// @Param request body dto.ComposeTemplateUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/template/update [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"compose_templates","output_colume":"name","output_value":"name"}],"formatZH":"更新 compose 模版 [name]","formatEN":"update compose template information [name]"} func (b *BaseApi) UpdateComposeTemplate(c *gin.Context) { var req dto.ComposeTemplateUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/container.go b/backend/app/api/v1/container.go index 804c59791..832a3277b 100644 --- a/backend/app/api/v1/container.go +++ b/backend/app/api/v1/container.go @@ -15,6 +15,16 @@ import ( "github.com/pkg/errors" ) +// Page container +// @Tags Container +// @Summary Search container list with page +// @Description 获取容器列表分页 +// @Accept json +// @Param request body dto.PageContainer true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/search [post] func (b *BaseApi) SearchContainer(c *gin.Context) { var req dto.PageContainer if err := c.ShouldBindJSON(&req); err != nil { @@ -37,6 +47,15 @@ func (b *BaseApi) SearchContainer(c *gin.Context) { }) } +// Page compose +// @Tags Container Compose +// @Summary Search compose list with page +// @Description 获取编排列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/compose/search [post] func (b *BaseApi) SearchCompose(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -59,6 +78,16 @@ func (b *BaseApi) SearchCompose(c *gin.Context) { }) } +// Create compose +// @Tags Container Compose +// @Summary Create compose +// @Description 创建容器编排 +// @Accept json +// @Param request body dto.ComposeCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/compose [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建 compose [name]","formatEN":"create compose [name]"} func (b *BaseApi) CreateCompose(c *gin.Context) { var req dto.ComposeCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -77,6 +106,16 @@ func (b *BaseApi) CreateCompose(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Operate compose +// @Tags Container Compose +// @Summary Operate compose +// @Description 容器编排操作 +// @Accept json +// @Param request body dto.ComposeOperation true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/compose/operate [post] +// @x-panel-log {"bodyKeys":["name","operation"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"compose [operation] [name]","formatEN":"compose [operation] [name]"} func (b *BaseApi) OperatorCompose(c *gin.Context) { var req dto.ComposeOperation if err := c.ShouldBindJSON(&req); err != nil { @@ -95,6 +134,16 @@ func (b *BaseApi) OperatorCompose(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Create container +// @Tags Container +// @Summary Create container +// @Description 创建容器 +// @Accept json +// @Param request body dto.ContainerCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers [post] +// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建容器 [name][image]","formatEN":"create container [name][image]"} func (b *BaseApi) ContainerCreate(c *gin.Context) { var req dto.ContainerCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -112,6 +161,16 @@ func (b *BaseApi) ContainerCreate(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Operate Container +// @Tags Container +// @Summary Operate Container +// @Description 容器操作 +// @Accept json +// @Param request body dto.ContainerOperation true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/operate [post] +// @x-panel-log {"bodyKeys":["name","operation","newName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"容器 [name] 执行 [operation] [newName]","formatEN":"container [operation] [name] [newName]"} func (b *BaseApi) ContainerOperation(c *gin.Context) { var req dto.ContainerOperation if err := c.ShouldBindJSON(&req); err != nil { @@ -129,6 +188,14 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Container stats +// @Tags Container +// @Summary Container stats +// @Description 容器监控信息 +// @Param id path integer true "容器id" +// @Success 200 {object} dto.ContainterStats +// @Security ApiKeyAuth +// @Router /containers/stats/:id [get] func (b *BaseApi) ContainerStats(c *gin.Context) { containerID, ok := c.Params.Get("id") if !ok { @@ -144,6 +211,15 @@ func (b *BaseApi) ContainerStats(c *gin.Context) { helper.SuccessWithData(c, result) } +// Container inspect +// @Tags Container +// @Summary Container inspect +// @Description 容器详情 +// @Accept json +// @Param request body dto.InspectReq true "request" +// @Success 200 {string} result +// @Security ApiKeyAuth +// @Router /containers/inspect [post] func (b *BaseApi) Inspect(c *gin.Context) { var req dto.InspectReq if err := c.ShouldBindJSON(&req); err != nil { @@ -220,6 +296,15 @@ func (b *BaseApi) ContainerExec(c *gin.Context) { } } +// Container logs +// @Tags Container +// @Summary Container logs +// @Description 容器日志 +// @Accept json +// @Param request body dto.ContainerLog true "request" +// @Success 200 {string} logs +// @Security ApiKeyAuth +// @Router /containers/search/log [post] func (b *BaseApi) ContainerLogs(c *gin.Context) { var req dto.ContainerLog if err := c.ShouldBindJSON(&req); err != nil { @@ -238,6 +323,16 @@ func (b *BaseApi) ContainerLogs(c *gin.Context) { helper.SuccessWithData(c, logs) } +// Page network +// @Tags Container Network +// @Summary Search network list with page +// @Description 获取容器网络列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/network/search [post] func (b *BaseApi) SearchNetwork(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -259,6 +354,17 @@ func (b *BaseApi) SearchNetwork(c *gin.Context) { Total: total, }) } + +// Delete network +// @Tags Container Network +// @Summary Delete network +// @Description 删除容器网络 +// @Accept json +// @Param request body dto.BatchDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/network/del [post] +// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"删除容器网络 [names]","formatEN":"delete container network [names]"} func (b *BaseApi) DeleteNetwork(c *gin.Context) { var req dto.BatchDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -276,6 +382,17 @@ func (b *BaseApi) DeleteNetwork(c *gin.Context) { } helper.SuccessWithData(c, nil) } + +// Create network +// @Tags Container Network +// @Summary Create network +// @Description 创建容器网络 +// @Accept json +// @Param request body dto.NetworkCreat true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/network [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建容器网络 name","formatEN":"create container network [name]"} func (b *BaseApi) CreateNetwork(c *gin.Context) { var req dto.NetworkCreat if err := c.ShouldBindJSON(&req); err != nil { @@ -294,6 +411,16 @@ func (b *BaseApi) CreateNetwork(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Page volume +// @Tags Container Volume +// @Summary Search volume list with page +// @Description 获取容器存储卷分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/volume/search [post] func (b *BaseApi) SearchVolume(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -315,6 +442,17 @@ func (b *BaseApi) SearchVolume(c *gin.Context) { Total: total, }) } + +// List volume +// @Tags Container Volume +// @Summary Search volume list +// @Description 获取容器存储卷列表 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/volume/search [get] func (b *BaseApi) ListVolume(c *gin.Context) { list, err := containerService.ListVolume() if err != nil { @@ -323,6 +461,17 @@ func (b *BaseApi) ListVolume(c *gin.Context) { } helper.SuccessWithData(c, list) } + +// Delete volume +// @Tags Container Volume +// @Summary Delete volume +// @Description 删除容器存储卷 +// @Accept json +// @Param request body dto.BatchDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/volume/del [post] +// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"删除容器存储卷 [names]","formatEN":"delete container volume [names]"} func (b *BaseApi) DeleteVolume(c *gin.Context) { var req dto.BatchDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -340,6 +489,17 @@ func (b *BaseApi) DeleteVolume(c *gin.Context) { } helper.SuccessWithData(c, nil) } + +// Create volume +// @Tags Container Volume +// @Summary Create volume +// @Description 创建容器存储卷 +// @Accept json +// @Param request body dto.VolumeCreat true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/volume [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建容器存储卷 [name]","formatEN":"create container volume [name]"} func (b *BaseApi) CreateVolume(c *gin.Context) { var req dto.VolumeCreat if err := c.ShouldBindJSON(&req); err != nil { @@ -358,6 +518,16 @@ func (b *BaseApi) CreateVolume(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update compose +// @Tags Container Compose +// @Summary Update compose +// @Description 更新容器编排 +// @Accept json +// @Param request body dto.ComposeUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/compose/update [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 compose [name]","formatEN":"update compose information [name]"} func (b *BaseApi) ComposeUpdate(c *gin.Context) { var req dto.ComposeUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/cronjob.go b/backend/app/api/v1/cronjob.go index da566dcc4..d313b6259 100644 --- a/backend/app/api/v1/cronjob.go +++ b/backend/app/api/v1/cronjob.go @@ -10,6 +10,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create cronjob +// @Tags Cronjob +// @Summary Create cronjob +// @Description 创建计划任务 +// @Accept json +// @Param request body dto.CronjobCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /cronjobs [post] +// @x-panel-log {"bodyKeys":["type","name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建计划任务 [type][name]","formatEN":"create cronjob [type][name]"} func (b *BaseApi) CreateCronjob(c *gin.Context) { var req dto.CronjobCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -27,6 +37,15 @@ func (b *BaseApi) CreateCronjob(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Page cronjob +// @Tags Cronjob +// @Summary Search cronjob list with page +// @Description 获取计划任务分页 +// @Accept json +// @Param request body dto.SearchWithPage true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /cronjobs/search [post] func (b *BaseApi) SearchCronjob(c *gin.Context) { var req dto.SearchWithPage if err := c.ShouldBindJSON(&req); err != nil { @@ -46,6 +65,15 @@ func (b *BaseApi) SearchCronjob(c *gin.Context) { }) } +// Search job records +// @Tags Cronjob +// @Summary Search job records +// @Description 获取计划任务记录 +// @Accept json +// @Param request body dto.SearchRecord true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /cronjobs/search/records [post] func (b *BaseApi) SearchJobRecords(c *gin.Context) { var req dto.SearchRecord if err := c.ShouldBindJSON(&req); err != nil { @@ -69,6 +97,16 @@ func (b *BaseApi) SearchJobRecords(c *gin.Context) { }) } +// Delete cronjob +// @Tags Cronjob +// @Summary Delete cronjob +// @Description 删除计划任务 +// @Accept json +// @Param request body dto.BatchDeleteReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /cronjob/del [post] +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"cronjobs","output_colume":"name","output_value":"names"}],"formatZH":"删除计划任务 [names]","formatEN":"delete cronjob [names]"} func (b *BaseApi) DeleteCronjob(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -87,6 +125,16 @@ func (b *BaseApi) DeleteCronjob(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update cronjob +// @Tags Cronjob +// @Summary Update cronjob +// @Description 更新计划任务 +// @Accept json +// @Param request body dto.CronjobUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /cronjob/update [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"更新计划任务 [name]","formatEN":"update cronjob [name]"} func (b *BaseApi) UpdateCronjob(c *gin.Context) { var req dto.CronjobUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -105,6 +153,16 @@ func (b *BaseApi) UpdateCronjob(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update cronjob status +// @Tags Cronjob +// @Summary Update cronjob status +// @Description 更新计划任务状态 +// @Accept json +// @Param request body dto.CronjobUpdateStatus true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /cronjob/status [post] +// @x-panel-log {"bodyKeys":["id","status"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"修改计划任务 [name] 状态为 [status]","formatEN":"change the status of cronjob [name] to [status]."} func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) { var req dto.CronjobUpdateStatus if err := c.ShouldBindJSON(&req); err != nil { @@ -123,6 +181,16 @@ func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Download Cronjob records +// @Tags Cronjob +// @Summary Download Cronjob records +// @Description 下载计划任务记录 +// @Accept json +// @Param request body dto.CronjobDownload true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /cronjob/download [post] +// @x-panel-log {"bodyKeys":["recordID"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"recordID","isList":false,"db":"job_records","output_colume":"file","output_value":"file"}],"formatZH":"下载计划任务记录 [file]","formatEN":"download the cronjob record [file]"} func (b *BaseApi) TargetDownload(c *gin.Context) { var req dto.CronjobDownload if err := c.ShouldBindJSON(&req); err != nil { @@ -142,6 +210,16 @@ func (b *BaseApi) TargetDownload(c *gin.Context) { c.File(filePath) } +// Handle cronjob once +// @Tags Cronjob +// @Summary Handle cronjob once +// @Description 手动执行计划任务 +// @Accept json +// @Param request body dto.OperateByID true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /cronjob/handle [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"手动执行计划任务 [name]","formatEN":"manually execute the cronjob [name]"} func (b *BaseApi) HandleOnce(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/dashboard.go b/backend/app/api/v1/dashboard.go index fd0128f1e..c6103edc5 100644 --- a/backend/app/api/v1/dashboard.go +++ b/backend/app/api/v1/dashboard.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Load dashboard base info +// @Tags Dashboard +// @Summary Load dashboard base info +// @Description 获取首页基础数据 +// @Accept json +// @Param ioOption path string true "request" +// @Param netOption path string true "request" +// @Success 200 {object} dto.DashboardBase +// @Security ApiKeyAuth +// @Router /dashboard/base/:ioOption/:netOption [get] func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) { ioOption, ok := c.Params.Get("ioOption") if !ok { @@ -27,6 +37,16 @@ func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load dashboard current info +// @Tags Dashboard +// @Summary Load dashboard current info +// @Description 获取首页实时数据 +// @Accept json +// @Param ioOption path string true "request" +// @Param netOption path string true "request" +// @Success 200 {object} dto.DashboardCurrent +// @Security ApiKeyAuth +// @Router /dashboard/current/:ioOption/:netOption [get] func (b *BaseApi) LoadDashboardCurrentInfo(c *gin.Context) { ioOption, ok := c.Params.Get("ioOption") if !ok { diff --git a/backend/app/api/v1/database_mysql.go b/backend/app/api/v1/database_mysql.go index 0a40385a0..f158055b8 100644 --- a/backend/app/api/v1/database_mysql.go +++ b/backend/app/api/v1/database_mysql.go @@ -10,6 +10,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create mysql database +// @Tags Database Mysql +// @Summary Create mysql database +// @Description 创建 mysql 数据库 +// @Accept json +// @Param request body dto.MysqlDBCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建 mysql 数据库 [name]","formatEN":"create mysql database [name]"} func (b *BaseApi) CreateMysql(c *gin.Context) { var req dto.MysqlDBCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -27,6 +37,16 @@ func (b *BaseApi) CreateMysql(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update mysql database description +// @Tags Database Mysql +// @Summary Update mysql database description +// @Description 更新 mysql 数据库库描述信息 +// @Accept json +// @Param request body dto.MysqlDescription true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/description/update [post] +// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"mysql 数据库 [name] 描述信息修改 [description]","formatEN":"The description of the mysql database [name] is modified => [description]"} func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) { var req dto.MysqlDescription if err := c.ShouldBindJSON(&req); err != nil { @@ -44,6 +64,16 @@ func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Change mysql password +// @Tags Database Mysql +// @Summary Change mysql password +// @Description 修改 mysql 密码 +// @Accept json +// @Param request body dto.ChangeDBInfo true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/change/password [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 密码","formatEN":"Update database [name] password"} func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) { var req dto.ChangeDBInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -61,6 +91,16 @@ func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Change mysql access +// @Tags Database Mysql +// @Summary Change mysql access +// @Description 修改 mysql 访问权限 +// @Accept json +// @Param request body dto.ChangeDBInfo true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/change/access [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 访问权限","formatEN":"Update database [name] access"} func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) { var req dto.ChangeDBInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -78,6 +118,16 @@ func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update mysql variables +// @Tags Database Mysql +// @Summary Update mysql variables +// @Description mysql 性能调优 +// @Accept json +// @Param request body dto.MysqlVariablesUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/variables/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"调整 mysql 数据库性能参数","formatEN":"adjust mysql database performance parameters"} func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) { var req []dto.MysqlVariablesUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -92,6 +142,16 @@ func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update mysql conf by upload file +// @Tags Database Mysql +// @Summary Update mysql conf by upload file +// @Description 上传替换 mysql 配置文件 +// @Accept json +// @Param request body dto.MysqlConfUpdateByFile true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/conffile/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 mysql 数据库配置信息","formatEN":"update the mysql database configuration information"} func (b *BaseApi) UpdateMysqlConfByFile(c *gin.Context) { var req dto.MysqlConfUpdateByFile if err := c.ShouldBindJSON(&req); err != nil { @@ -111,6 +171,15 @@ func (b *BaseApi) UpdateMysqlConfByFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Page mysql database +// @Tags Cronjob +// @Summary Search mysql database list with page +// @Description 获取 mysql 数据库列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /databases/search [post] func (b *BaseApi) SearchMysql(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -130,6 +199,15 @@ func (b *BaseApi) SearchMysql(c *gin.Context) { }) } +// List mysql database +// @Tags Cronjob +// @Summary Search mysql database list +// @Description 获取 mysql 数据库列表 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Success 200 {anrry} string +// @Security ApiKeyAuth +// @Router /databases/options [get] func (b *BaseApi) ListDBName(c *gin.Context) { list, err := mysqlService.ListDBName() if err != nil { @@ -140,6 +218,16 @@ func (b *BaseApi) ListDBName(c *gin.Context) { helper.SuccessWithData(c, list) } +// Backup mysql database +// @Tags Database Mysql +// @Summary Backup mysql database +// @Description 备份 mysql 数据库 +// @Accept json +// @Param request body dto.BackupDB true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/backup [post] +// @x-panel-log {"bodyKeys":["mysqlName","dbName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"备份 mysql 数据库 [mysqlName][dbName]","formatEN":"backup mysql database [mysqlName][dbName]"} func (b *BaseApi) BackupMysql(c *gin.Context) { var req dto.BackupDB if err := c.ShouldBindJSON(&req); err != nil { @@ -159,6 +247,16 @@ func (b *BaseApi) BackupMysql(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Recover mysql database by upload file +// @Tags Database Mysql +// @Summary Recover mysql database by upload file +// @Description Mysql 数据库从上传文件恢复 +// @Accept json +// @Param request body dto.UploadRecover true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/recover/byupload [post] +// @x-panel-log {"bodyKeys":["fileDir","fileName","mysqlName","dbName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"mysql 数据库从 [fileDir]/[fileName] 恢复 [mysqlName][dbName]","formatEN":"mysql database recover [fileDir]/[fileName] from [mysqlName][dbName]"} func (b *BaseApi) RecoverMysqlByUpload(c *gin.Context) { var req dto.UploadRecover if err := c.ShouldBindJSON(&req); err != nil { @@ -178,6 +276,16 @@ func (b *BaseApi) RecoverMysqlByUpload(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Recover mysql database +// @Tags Database Mysql +// @Summary Recover mysql database +// @Description Mysql 数据库恢复 +// @Accept json +// @Param request body dto.RecoverDB true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/recover [post] +// @x-panel-log {"bodyKeys":["mysqlName","dbName","backupName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"恢复 mysql 数据库 [mysqlName][dbName] [backupName]","formatEN":"恢复 mysql 数据库 [mysqlName][dbName] [backupName]"} func (b *BaseApi) RecoverMysql(c *gin.Context) { var req dto.RecoverDB if err := c.ShouldBindJSON(&req); err != nil { @@ -197,6 +305,15 @@ func (b *BaseApi) RecoverMysql(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Check before delete mysql database +// @Tags Database Mysql +// @Summary Check before delete mysql database +// @Description Mysql 数据库删除前检查 +// @Accept json +// @Param request body dto.OperateByID true "request" +// @Success 200 {anrry} string +// @Security ApiKeyAuth +// @Router /databases/del/check [post] func (b *BaseApi) DeleteCheckMysql(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { @@ -216,6 +333,16 @@ func (b *BaseApi) DeleteCheckMysql(c *gin.Context) { helper.SuccessWithData(c, apps) } +// Delete mysql database +// @Tags Database Mysql +// @Summary Delete mysql database +// @Description 删除 mysql 数据库 +// @Accept json +// @Param request body dto.MysqlDBDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"删除 mysql 数据库 [name]","formatEN":"delete mysql database [name]"} func (b *BaseApi) DeleteMysql(c *gin.Context) { var req dto.MysqlDBDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -237,6 +364,13 @@ func (b *BaseApi) DeleteMysql(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load mysql base info +// @Tags Database Mysql +// @Summary Load mysql base info +// @Description 获取 mysql 基础信息 +// @Success 200 {object} dto.DBBaseInfo +// @Security ApiKeyAuth +// @Router /databases/baseinfo [get] func (b *BaseApi) LoadBaseinfo(c *gin.Context) { data, err := mysqlService.LoadBaseInfo() if err != nil { @@ -247,6 +381,13 @@ func (b *BaseApi) LoadBaseinfo(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load mysql remote access +// @Tags Database Mysql +// @Summary Load mysql remote access +// @Description 获取 mysql 远程访问权限 +// @Success 200 {boolean} isRemote +// @Security ApiKeyAuth +// @Router /databases/remote [get] func (b *BaseApi) LoadRemoteAccess(c *gin.Context) { isRemote, err := mysqlService.LoadRemoteAccess() if err != nil { @@ -257,6 +398,13 @@ func (b *BaseApi) LoadRemoteAccess(c *gin.Context) { helper.SuccessWithData(c, isRemote) } +// Load mysql status info +// @Tags Database Mysql +// @Summary Load mysql status info +// @Description 获取 mysql 状态信息 +// @Success 200 {object} dto.MysqlStatus +// @Security ApiKeyAuth +// @Router /databases/status [get] func (b *BaseApi) LoadStatus(c *gin.Context) { data, err := mysqlService.LoadStatus() if err != nil { @@ -267,6 +415,13 @@ func (b *BaseApi) LoadStatus(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load mysql variables info +// @Tags Database Mysql +// @Summary Load mysql variables info +// @Description 获取 mysql 性能参数信息 +// @Success 200 {object} dto.MysqlVariables +// @Security ApiKeyAuth +// @Router /databases/variables [get] func (b *BaseApi) LoadVariables(c *gin.Context) { data, err := mysqlService.LoadVariables() if err != nil { diff --git a/backend/app/api/v1/database_redis.go b/backend/app/api/v1/database_redis.go index adff49430..681fa1a3d 100644 --- a/backend/app/api/v1/database_redis.go +++ b/backend/app/api/v1/database_redis.go @@ -19,6 +19,13 @@ import ( "github.com/pkg/errors" ) +// Load redis status info +// @Tags Database Redis +// @Summary Load redis status info +// @Description 获取 redis 状态信息 +// @Success 200 {object} dto.RedisStatus +// @Security ApiKeyAuth +// @Router /databases/redis/status [get] func (b *BaseApi) LoadRedisStatus(c *gin.Context) { data, err := redisService.LoadStatus() if err != nil { @@ -29,6 +36,13 @@ func (b *BaseApi) LoadRedisStatus(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load redis conf +// @Tags Database Redis +// @Summary Load redis conf +// @Description 获取 redis 配置信息 +// @Success 200 {object} dto.RedisConf +// @Security ApiKeyAuth +// @Router /databases/redis/conf [get] func (b *BaseApi) LoadRedisConf(c *gin.Context) { data, err := redisService.LoadConf() if err != nil { @@ -39,6 +53,13 @@ func (b *BaseApi) LoadRedisConf(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load redis persistence conf +// @Tags Database Redis +// @Summary Load redis persistence conf +// @Description 获取 redis 持久化配置 +// @Success 200 {object} dto.RedisPersistence +// @Security ApiKeyAuth +// @Router /databases/redis/persistence/conf [get] func (b *BaseApi) LoadPersistenceConf(c *gin.Context) { data, err := redisService.LoadPersistenceConf() if err != nil { @@ -49,6 +70,16 @@ func (b *BaseApi) LoadPersistenceConf(c *gin.Context) { helper.SuccessWithData(c, data) } +// Update redis conf +// @Tags Database Redis +// @Summary Update redis conf +// @Description 更新 redis 配置信息 +// @Accept json +// @Param request body dto.RedisConfUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/redis/conf/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 redis 数据库配置信息","formatEN":"update the redis database configuration information"} func (b *BaseApi) UpdateRedisConf(c *gin.Context) { var req dto.RedisConfUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -66,6 +97,16 @@ func (b *BaseApi) UpdateRedisConf(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Change redis password +// @Tags Database Redis +// @Summary Change redis password +// @Description 更新 redis 密码 +// @Accept json +// @Param request body dto.ChangeDBInfo true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/redis/password [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"修改 redis 数据库密码","formatEN":"change the password of the redis database"} func (b *BaseApi) ChangeRedisPassword(c *gin.Context) { var req dto.ChangeDBInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -83,6 +124,16 @@ func (b *BaseApi) ChangeRedisPassword(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update redis persistence conf +// @Tags Database Redis +// @Summary Update redis persistence conf +// @Description 更新 redis 持久化配置 +// @Accept json +// @Param request body dto.RedisConfPersistenceUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/redis/persistence/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"redis 数据库持久化配置更新","formatEN":"redis database persistence configuration update"} func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) { var req dto.RedisConfPersistenceUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -100,6 +151,14 @@ func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Backup redis +// @Tags Database Redis +// @Summary Backup redis +// @Description 备份 redis 数据库 +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/redis/backup [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"备份 redis 数据库","formatEN":"backup redis database"} func (b *BaseApi) RedisBackup(c *gin.Context) { if err := redisService.Backup(); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) @@ -108,6 +167,14 @@ func (b *BaseApi) RedisBackup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Recover redis +// @Tags Database Redis +// @Summary Recover redis +// @Description 恢复 redis 数据库 +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/redis/recover [post] +// @x-panel-log {"bodyKeys":["fileDir","fileName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"redis 数据库从 [fileDir]/[fileName] 恢复","formatEN":"redis database recover from [fileDir]/[fileName]"} func (b *BaseApi) RedisRecover(c *gin.Context) { var req dto.RedisBackupRecover if err := c.ShouldBindJSON(&req); err != nil { @@ -126,6 +193,15 @@ func (b *BaseApi) RedisRecover(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Search redis backup list +// @Tags Database Redis +// @Summary Search redis backup list +// @Description 获取 redis 备份记录分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /databases/redis/backup/search [post] func (b *BaseApi) RedisBackupList(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -145,6 +221,16 @@ func (b *BaseApi) RedisBackupList(c *gin.Context) { }) } +// Update redis conf by file +// @Tags Database Redis +// @Summary Update redis conf by file +// @Description 上传更新 redis 配置信息 +// @Accept json +// @Param request body dto.RedisConfUpdateByFile true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /databases/redis/conffile/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 redis 数据库配置信息","formatEN":"update the redis database configuration information"} func (b *BaseApi) UpdateRedisConfByFile(c *gin.Context) { var req dto.RedisConfUpdateByFile if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/docker.go b/backend/app/api/v1/docker.go index 53b4ac652..04daced8d 100644 --- a/backend/app/api/v1/docker.go +++ b/backend/app/api/v1/docker.go @@ -8,16 +8,42 @@ import ( "github.com/gin-gonic/gin" ) +// Load status +// @Tags Container Docker +// @Summary Load docker status +// @Description 获取 docker 服务状态 +// @Produce json +// @Success 200 {string} status +// @Security ApiKeyAuth +// @Router /containers/docker/status [get] func (b *BaseApi) LoadDockerStatus(c *gin.Context) { status := dockerService.LoadDockerStatus() helper.SuccessWithData(c, status) } +// Load daemon.json +// @Tags Container Docker +// @Summary Load docker daemon.json +// @Description 获取 docker 配置信息 +// @Produce json +// @Success 200 {object} dto.DaemonJsonConf +// @Security ApiKeyAuth +// @Router /containers/daemonjson [get] func (b *BaseApi) LoadDaemonJson(c *gin.Context) { conf := dockerService.LoadDockerConf() helper.SuccessWithData(c, conf) } +// Update daemon.json +// @Tags Container Docker +// @Summary Update docker daemon.json +// @Description 修改 docker 配置信息 +// @Accept json +// @Param request body dto.DaemonJsonConf true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/daemonjson/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 docker daemon.json 配置","formatEN":"Updated the docker daemon.json configuration"} func (b *BaseApi) UpdateDaemonJson(c *gin.Context) { var req dto.DaemonJsonConf if err := c.ShouldBindJSON(&req); err != nil { @@ -33,6 +59,16 @@ func (b *BaseApi) UpdateDaemonJson(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update daemon.json by upload file +// @Tags Container Docker +// @Summary Update docker daemon.json by upload file +// @Description 上传替换 docker 配置文件 +// @Accept json +// @Param request body dto.DaemonJsonUpdateByFile true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/daemonjson/update/byfile [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 docker daemon.json 配置","formatEN":"Updated the docker daemon.json configuration"} func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) { var req dto.DaemonJsonUpdateByFile if err := c.ShouldBindJSON(&req); err != nil { @@ -52,6 +88,16 @@ func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Operate docker +// @Tags Container Docker +// @Summary Operate docker +// @Description Docker 操作 +// @Accept json +// @Param request body dto.DockerOperation true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/docker/operate [post] +// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"docker 服务 [operation]","formatEN":"[operation] docker service"} func (b *BaseApi) OperateDocker(c *gin.Context) { var req dto.DockerOperation if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/file.go b/backend/app/api/v1/file.go index 9a12df6d4..5b8d1f4d6 100644 --- a/backend/app/api/v1/file.go +++ b/backend/app/api/v1/file.go @@ -3,15 +3,16 @@ package v1 import ( "errors" "fmt" - "github.com/1Panel-dev/1Panel/backend/app/dto/request" - "github.com/1Panel-dev/1Panel/backend/app/dto/response" - "github.com/1Panel-dev/1Panel/backend/buserr" "io/ioutil" "net/http" "os" "path" "strings" + "github.com/1Panel-dev/1Panel/backend/app/dto/request" + "github.com/1Panel-dev/1Panel/backend/app/dto/response" + "github.com/1Panel-dev/1Panel/backend/buserr" + "github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/constant" @@ -21,6 +22,15 @@ import ( "github.com/gorilla/websocket" ) +// List files +// @Tags File +// @Summary Search file list +// @Description 获取文件列表 +// @Accept json +// @Param request body request.FileOption true "request" +// @Success 200 {object} response.FileInfo +// @Security ApiKeyAuth +// @Router /files/search [post] func (b *BaseApi) ListFiles(c *gin.Context) { var req request.FileOption if err := c.ShouldBindJSON(&req); err != nil { @@ -35,6 +45,15 @@ func (b *BaseApi) ListFiles(c *gin.Context) { helper.SuccessWithData(c, files) } +// Load files tree +// @Tags File +// @Summary Load files tree +// @Description 加载文件树 +// @Accept json +// @Param request body request.FileOption true "request" +// @Success 200 {anrry} response.FileTree +// @Security ApiKeyAuth +// @Router /files/tree [post] func (b *BaseApi) GetFileTree(c *gin.Context) { var req request.FileOption if err := c.ShouldBindJSON(&req); err != nil { @@ -49,6 +68,16 @@ func (b *BaseApi) GetFileTree(c *gin.Context) { helper.SuccessWithData(c, tree) } +// Create file +// @Tags File +// @Summary Create file +// @Description 创建文件/文件夹 +// @Accept json +// @Param request body request.FileCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建文件/文件夹 [path]","formatEN":"Create dir or file [path]"} func (b *BaseApi) CreateFile(c *gin.Context) { var req request.FileCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -63,6 +92,16 @@ func (b *BaseApi) CreateFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Delete file +// @Tags File +// @Summary Delete file +// @Description 删除文件/文件夹 +// @Accept json +// @Param request body request.FileDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/del [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"删除文件/文件夹 [path]","formatEN":"Delete dir or file [path]"} func (b *BaseApi) DeleteFile(c *gin.Context) { var req request.FileDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -77,6 +116,16 @@ func (b *BaseApi) DeleteFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Batch delete file +// @Tags File +// @Summary Batch delete file +// @Description 批量删除文件/文件夹 +// @Accept json +// @Param request body request.FileBatchDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/batch/del [post] +// @x-panel-log {"bodyKeys":["paths"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"批量删除文件/文件夹 [paths]","formatEN":"Batch delete dir or file [paths]"} func (b *BaseApi) BatchDeleteFile(c *gin.Context) { var req request.FileBatchDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -91,6 +140,16 @@ func (b *BaseApi) BatchDeleteFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Change file mode +// @Tags File +// @Summary Change file mode +// @Description 修改文件权限 +// @Accept json +// @Param request body request.FileCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/mode [post] +// @x-panel-log {"bodyKeys":["path","mode"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"修改权限 [paths] => [mode]","formatEN":"Change mode [paths] => [mode]"} func (b *BaseApi) ChangeFileMode(c *gin.Context) { var req request.FileCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -105,6 +164,16 @@ func (b *BaseApi) ChangeFileMode(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Compress file +// @Tags File +// @Summary Compress file +// @Description 压缩文件 +// @Accept json +// @Param request body request.FileCompress true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/compress [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"压缩文件 [name]","formatEN":"Compress file [name]"} func (b *BaseApi) CompressFile(c *gin.Context) { var req request.FileCompress if err := c.ShouldBindJSON(&req); err != nil { @@ -119,6 +188,16 @@ func (b *BaseApi) CompressFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Decompress file +// @Tags File +// @Summary Decompress file +// @Description 解压文件 +// @Accept json +// @Param request body request.FileDeCompress true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/decompress [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"解压 [path]","formatEN":"Decompress file [path]"} func (b *BaseApi) DeCompressFile(c *gin.Context) { var req request.FileDeCompress if err := c.ShouldBindJSON(&req); err != nil { @@ -133,6 +212,16 @@ func (b *BaseApi) DeCompressFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load file content +// @Tags File +// @Summary Load file content +// @Description 获取文件内容 +// @Accept json +// @Param request body request.FileOption true "request" +// @Success 200 {object} response.FileInfo +// @Security ApiKeyAuth +// @Router /files/content [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"获取文件内容 [path]","formatEN":"Load file content [path]"} func (b *BaseApi) GetContent(c *gin.Context) { var req request.FileOption if err := c.ShouldBindJSON(&req); err != nil { @@ -147,6 +236,16 @@ func (b *BaseApi) GetContent(c *gin.Context) { helper.SuccessWithData(c, info) } +// Update file content +// @Tags File +// @Summary Update file content +// @Description 更新文件内容 +// @Accept json +// @Param request body request.FileEdit true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/save [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新文件内容 [path]","formatEN":"Update file content [path]"} func (b *BaseApi) SaveContent(c *gin.Context) { var req request.FileEdit if err := c.ShouldBindJSON(&req); err != nil { @@ -160,6 +259,15 @@ func (b *BaseApi) SaveContent(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Upload file +// @Tags File +// @Summary Upload file +// @Description 上传文件 +// @Param file formData file true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/upload [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"上传文件 [path]","formatEN":"Upload file [path]"} func (b *BaseApi) UploadFiles(c *gin.Context) { form, err := c.MultipartForm() if err != nil { @@ -199,6 +307,16 @@ func (b *BaseApi) UploadFiles(c *gin.Context) { } } +// Change file name +// @Tags File +// @Summary Change file name +// @Description 修改文件名称 +// @Accept json +// @Param request body request.FileRename true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/rename [post] +// @x-panel-log {"bodyKeys":["oldName","newName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"重命名 [oldName] => [newName]","formatEN":"Rename [oldName] => [newName]"} func (b *BaseApi) ChangeFileName(c *gin.Context) { var req request.FileRename if err := c.ShouldBindJSON(&req); err != nil { @@ -212,6 +330,16 @@ func (b *BaseApi) ChangeFileName(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Wget file +// @Tags File +// @Summary Wget file +// @Description 下载远端文件 +// @Accept json +// @Param request body request.FileWget true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/wget [post] +// @x-panel-log {"bodyKeys":["url","path","name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"下载 url => [path]/[name]","formatEN":"Download url => [path]/[name]"} func (b *BaseApi) WgetFile(c *gin.Context) { var req request.FileWget if err := c.ShouldBindJSON(&req); err != nil { @@ -228,6 +356,16 @@ func (b *BaseApi) WgetFile(c *gin.Context) { }) } +// Move file +// @Tags File +// @Summary Move file +// @Description 移动文件 +// @Accept json +// @Param request body request.FileMove true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/move [post] +// @x-panel-log {"bodyKeys":["oldPaths","newPath"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"移动文件 [oldPaths] => [newPath]","formatEN":"Move [oldPaths] => [newPath]"} func (b *BaseApi) MoveFile(c *gin.Context) { var req request.FileMove if err := c.ShouldBindJSON(&req); err != nil { @@ -241,6 +379,16 @@ func (b *BaseApi) MoveFile(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Download file +// @Tags File +// @Summary Download file +// @Description 下载文件 +// @Accept json +// @Param request body request.FileDownload true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/download [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"下载文件 [name]","formatEN":"Download file [name]"} func (b *BaseApi) Download(c *gin.Context) { var req request.FileDownload if err := c.ShouldBindJSON(&req); err != nil { @@ -255,6 +403,16 @@ func (b *BaseApi) Download(c *gin.Context) { c.File(filePath) } +// Load file size +// @Tags File +// @Summary Load file size +// @Description 获取文件夹大小 +// @Accept json +// @Param request body request.DirSizeReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /files/size [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"获取文件夹大小 [path]","formatEN":"Load file size [path]"} func (b *BaseApi) Size(c *gin.Context) { var req request.DirSizeReq if err := c.ShouldBindJSON(&req); err != nil { @@ -269,6 +427,16 @@ func (b *BaseApi) Size(c *gin.Context) { helper.SuccessWithData(c, res) } +// Read file +// @Tags File +// @Summary Read file +// @Description 读取文件 +// @Accept json +// @Param request body dto.FilePath true "request" +// @Success 200 byte +// @Security ApiKeyAuth +// @Router /files/loadfile [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"读取文件 [path]","formatEN":"Read file [path]"} func (b *BaseApi) LoadFromFile(c *gin.Context) { var req dto.FilePath if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/group.go b/backend/app/api/v1/group.go index aa07ab8be..98c258ca8 100644 --- a/backend/app/api/v1/group.go +++ b/backend/app/api/v1/group.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create group +// @Tags System Group +// @Summary Create group +// @Description 创建系统组 +// @Accept json +// @Param request body dto.GroupOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /groups [post] +// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建组 [name][type]","formatEN":"create group [name][type]"} func (b *BaseApi) CreateGroup(c *gin.Context) { var req dto.GroupOperate if err := c.ShouldBindJSON(&req); err != nil { @@ -25,6 +35,16 @@ func (b *BaseApi) CreateGroup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Delete group +// @Tags System Group +// @Summary Delete group +// @Description 删除系统组 +// @Accept json +// @Param request body dto.OperateByID true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /groups/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"groups","output_colume":"name","output_value":"name"}],"formatZH":"删除组 [name]","formatEN":"delete group [name]"} func (b *BaseApi) DeleteGroup(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { @@ -43,6 +63,16 @@ func (b *BaseApi) DeleteGroup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update group +// @Tags System Group +// @Summary Update group +// @Description 更新系统组 +// @Accept json +// @Param request body dto.GroupOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /groups/update [post] +// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新组 [name][type]","formatEN":"update group [name][type]"} func (b *BaseApi) UpdateGroup(c *gin.Context) { var req dto.GroupOperate if err := c.ShouldBindJSON(&req); err != nil { @@ -61,6 +91,15 @@ func (b *BaseApi) UpdateGroup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Search group info +// @Tags System Group +// @Summary Search group info +// @Description 查询系统组 +// @Accept json +// @Param id path integer true "request" +// @Success 200 {object} dto.GroupInfo +// @Security ApiKeyAuth +// @Router /groups/:id [get] func (b *BaseApi) GetGroupInfo(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { @@ -75,6 +114,15 @@ func (b *BaseApi) GetGroupInfo(c *gin.Context) { helper.SuccessWithData(c, group) } +// List group +// @Tags System Group +// @Summary Search group list +// @Description 查询系统组 +// @Accept json +// @Param request body dto.GroupSearch true "request" +// @Success 200 {anrry} dto.GroupInfo +// @Security ApiKeyAuth +// @Router /groups/search [post] func (b *BaseApi) ListGroup(c *gin.Context) { var req dto.GroupSearch if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/host.go b/backend/app/api/v1/host.go index 626b52414..a2faead0e 100644 --- a/backend/app/api/v1/host.go +++ b/backend/app/api/v1/host.go @@ -10,6 +10,16 @@ import ( "github.com/gin-gonic/gin" ) +// Create host +// @Tags Host +// @Summary Create host +// @Description 创建主机 +// @Accept json +// @Param request body dto.HostOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /host [post] +// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建主机 [name][addr]","formatEN":"create host [name][addr]"} func (b *BaseApi) CreateHost(c *gin.Context) { var req dto.HostOperate if err := c.ShouldBindJSON(&req); err != nil { @@ -28,6 +38,15 @@ func (b *BaseApi) CreateHost(c *gin.Context) { helper.SuccessWithData(c, host) } +// Test host conn by info +// @Tags Host +// @Summary Test host conn by info +// @Description 测试主机连接 +// @Accept json +// @Param request body dto.HostConnTest true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /host/test/byinfo [post] func (b *BaseApi) TestByInfo(c *gin.Context) { var req dto.HostConnTest if err := c.ShouldBindJSON(&req); err != nil { @@ -52,6 +71,15 @@ func (b *BaseApi) TestByInfo(c *gin.Context) { helper.SuccessWithData(c, true) } +// Test host conn by host id +// @Tags Host +// @Summary Test host conn by host id +// @Description 测试主机连接 +// @Accept json +// @Param id path integer true "request" +// @Success 200 {boolean} +// @Security ApiKeyAuth +// @Router /host/test/byid/:id [post] func (b *BaseApi) TestByID(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { @@ -63,6 +91,15 @@ func (b *BaseApi) TestByID(c *gin.Context) { helper.SuccessWithData(c, connStatus) } +// Load host tree +// @Tags Host +// @Summary Load host tree +// @Description 加载主机树 +// @Accept json +// @Param request body dto.SearchForTree true "request" +// @Success 200 {anrry} dto.HostTree +// @Security ApiKeyAuth +// @Router /host/search [post] func (b *BaseApi) HostTree(c *gin.Context) { var req dto.SearchForTree if err := c.ShouldBindJSON(&req); err != nil { @@ -79,6 +116,15 @@ func (b *BaseApi) HostTree(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load host info +// @Tags Host +// @Summary Load host info +// @Description 加载主机信息 +// @Accept json +// @Param id path integer true "request" +// @Success 200 {object} dto.HostInfo +// @Security ApiKeyAuth +// @Router /host/:id [get] func (b *BaseApi) GetHostInfo(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { @@ -98,6 +144,16 @@ func (b *BaseApi) GetHostInfo(c *gin.Context) { helper.SuccessWithData(c, hostDto) } +// Delete host +// @Tags Host +// @Summary Delete host +// @Description 删除主机 +// @Accept json +// @Param request body dto.OperateByID true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /host/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"hosts","output_colume":"addr","output_value":"addr"}],"formatZH":"删除主机 [addr]","formatEN":"delete host [addr]"} func (b *BaseApi) DeleteHost(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { @@ -116,6 +172,16 @@ func (b *BaseApi) DeleteHost(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update host +// @Tags Host +// @Summary Update host +// @Description 更新主机 +// @Accept json +// @Param request body dto.HostOperate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /host/update [post] +// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新主机信息 [name][addr]","formatEN":"update host [name][addr]"} func (b *BaseApi) UpdateHost(c *gin.Context) { var req dto.HostOperate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/image.go b/backend/app/api/v1/image.go index ffb39cf50..659f35ad1 100644 --- a/backend/app/api/v1/image.go +++ b/backend/app/api/v1/image.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Page image +// @Tags Container Image +// @Summary Search image list with page +// @Description 获取镜像列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/image/search [post] func (b *BaseApi) SearchImage(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -31,6 +41,14 @@ func (b *BaseApi) SearchImage(c *gin.Context) { }) } +// List image +// @Tags Container Image +// @Summary Search image list +// @Description 获取镜像列表 +// @Produce json +// @Success 200 {anrry} dto.Options +// @Security ApiKeyAuth +// @Router /containers/image [get] func (b *BaseApi) ListImage(c *gin.Context) { list, err := imageService.List() if err != nil { @@ -40,6 +58,16 @@ func (b *BaseApi) ListImage(c *gin.Context) { helper.SuccessWithData(c, list) } +// Build image +// @Tags Container Image +// @Summary Build image +// @Description 构建镜像 +// @Accept json +// @Param request body dto.ImageBuild true "request" +// @Success 200 {string} log +// @Security ApiKeyAuth +// @Router /containers/image/build [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"构建镜像 [name]","formatEN":"build image [name]"} func (b *BaseApi) ImageBuild(c *gin.Context) { var req dto.ImageBuild if err := c.ShouldBindJSON(&req); err != nil { @@ -60,6 +88,16 @@ func (b *BaseApi) ImageBuild(c *gin.Context) { helper.SuccessWithData(c, log) } +// Pull image +// @Tags Container Image +// @Summary Pull image +// @Description 拉取镜像 +// @Accept json +// @Param request body dto.ImagePull true "request" +// @Success 200 {string} log +// @Security ApiKeyAuth +// @Router /containers/image/pull [post] +// @x-panel-log {"bodyKeys":["repoID","imageName"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"repoID","isList":false,"db":"image_repos","output_colume":"name","output_value":"reponame"}],"formatZH":"镜像拉取 [reponame][imageName]","formatEN":"image pull [reponame][imageName]"} func (b *BaseApi) ImagePull(c *gin.Context) { var req dto.ImagePull if err := c.ShouldBindJSON(&req); err != nil { @@ -80,6 +118,16 @@ func (b *BaseApi) ImagePull(c *gin.Context) { helper.SuccessWithData(c, logPath) } +// Push image +// @Tags Container Image +// @Summary Push image +// @Description 推送镜像 +// @Accept json +// @Param request body dto.ImagePush true "request" +// @Success 200 {string} log +// @Security ApiKeyAuth +// @Router /containers/image/push [post] +// @x-panel-log {"bodyKeys":["repoID","tagName","name"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"repoID","isList":false,"db":"image_repos","output_colume":"name","output_value":"reponame"}],"formatZH":"[tagName] 推送到 [reponame][name]","formatEN":"push [tagName] to [reponame][name]"} func (b *BaseApi) ImagePush(c *gin.Context) { var req dto.ImagePush if err := c.ShouldBindJSON(&req); err != nil { @@ -100,6 +148,16 @@ func (b *BaseApi) ImagePush(c *gin.Context) { helper.SuccessWithData(c, logPath) } +// Delete image +// @Tags Container Image +// @Summary Delete image +// @Description 删除镜像 +// @Accept json +// @Param request body dto.BatchDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/image/remove [post] +// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"移除镜像 [names]","formatEN":"remove image [names]"} func (b *BaseApi) ImageRemove(c *gin.Context) { var req dto.BatchDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -119,6 +177,16 @@ func (b *BaseApi) ImageRemove(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Save image +// @Tags Container Image +// @Summary Save image +// @Description 导出镜像 +// @Accept json +// @Param request body dto.ImageSave true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/image/save [post] +// @x-panel-log {"bodyKeys":["tagName","path","name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"保留 [tagName] 为 [path]/[name]","formatEN":"save [tagName] as [path]/[name]"} func (b *BaseApi) ImageSave(c *gin.Context) { var req dto.ImageSave if err := c.ShouldBindJSON(&req); err != nil { @@ -138,6 +206,16 @@ func (b *BaseApi) ImageSave(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Tag image +// @Tags Container Image +// @Summary Tag image +// @Description Tag 镜像 +// @Accept json +// @Param request body dto.ImageTag true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/image/tag [post] +// @x-panel-log {"bodyKeys":["repoID","targetName"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"repoID","isList":false,"db":"image_repos","output_colume":"name","output_value":"reponame"}],"formatZH":"tag 镜像 [reponame][targetName]","formatEN":"tag image [reponame][targetName]"} func (b *BaseApi) ImageTag(c *gin.Context) { var req dto.ImageTag if err := c.ShouldBindJSON(&req); err != nil { @@ -157,6 +235,16 @@ func (b *BaseApi) ImageTag(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load image +// @Tags Container Image +// @Summary Load image +// @Description 导入镜像 +// @Accept json +// @Param request body dto.ImageLoad true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/image/load [post] +// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"从 [path] 加载镜像","formatEN":"load image from [path]"} func (b *BaseApi) ImageLoad(c *gin.Context) { var req dto.ImageLoad if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/image_repo.go b/backend/app/api/v1/image_repo.go index bb86db2be..9cb8acf55 100644 --- a/backend/app/api/v1/image_repo.go +++ b/backend/app/api/v1/image_repo.go @@ -8,6 +8,16 @@ import ( "github.com/gin-gonic/gin" ) +// Page image repo +// @Tags Container Image-repo +// @Summary Search image repo list with page +// @Description 获取镜像仓库列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Produce json +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /containers/repo/search [post] func (b *BaseApi) SearchRepo(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -31,6 +41,14 @@ func (b *BaseApi) SearchRepo(c *gin.Context) { }) } +// List image repo +// @Tags Container Image-repo +// @Summary Search image repo list +// @Description 获取镜像仓库列表 +// @Produce json +// @Success 200 {anrry} dto.ImageRepoOption +// @Security ApiKeyAuth +// @Router /containers/repo [get] func (b *BaseApi) ListRepo(c *gin.Context) { list, err := imageRepoService.List() if err != nil { @@ -41,6 +59,17 @@ func (b *BaseApi) ListRepo(c *gin.Context) { helper.SuccessWithData(c, list) } +// Create image repo +// @Tags Container Image-repo +// @Summary Create image repo +// @Description 创建镜像仓库 +// @Accept json +// @Param request body dto.ImageRepoCreate true "request" +// @Produce json +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/repo [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建镜像仓库 [name]","formatEN":"create image repo [name]"} func (b *BaseApi) CreateRepo(c *gin.Context) { var req dto.ImageRepoCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -58,6 +87,17 @@ func (b *BaseApi) CreateRepo(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Delete image repo +// @Tags Container Image-repo +// @Summary Delete image repo +// @Description 删除镜像仓库 +// @Accept json +// @Param request body dto.ImageRepoDelete true "request" +// @Produce json +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/repo/del [post] +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"image_repos","output_colume":"name","output_value":"names"}],"formatZH":"删除镜像仓库 [names]","formatEN":"delete image repo [names]"} func (b *BaseApi) DeleteRepo(c *gin.Context) { var req dto.ImageRepoDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -76,6 +116,17 @@ func (b *BaseApi) DeleteRepo(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update image repo +// @Tags Container Image-repo +// @Summary Update image repo +// @Description 更新镜像仓库 +// @Accept json +// @Param request body dto.ImageRepoUpdate true "request" +// @Produce json +// @Success 200 +// @Security ApiKeyAuth +// @Router /containers/repo/update [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"image_repos","output_colume":"name","output_value":"name"}],"formatZH":"更新镜像仓库 [name]","formatEN":"update image repo information [name]"} func (b *BaseApi) UpdateRepo(c *gin.Context) { var req dto.ImageRepoUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/logs.go b/backend/app/api/v1/logs.go index a31ee0ac5..ed515e436 100644 --- a/backend/app/api/v1/logs.go +++ b/backend/app/api/v1/logs.go @@ -1,14 +1,22 @@ package v1 import ( - "errors" - "github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/constant" + "github.com/1Panel-dev/1Panel/backend/global" "github.com/gin-gonic/gin" ) +// Page login logs +// @Tags Logs +// @Summary Page login logs +// @Description 获取系统登录日志列表分页 +// @Accept json +// @Param request body request.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /logs/login [post] func (b *BaseApi) GetLoginLogs(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -28,6 +36,15 @@ func (b *BaseApi) GetLoginLogs(c *gin.Context) { }) } +// Page operation logs +// @Tags Logs +// @Summary Page operation logs +// @Description 获取系统操作日志列表分页 +// @Accept json +// @Param request body request.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /logs/operation [post] func (b *BaseApi) GetOperationLogs(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -47,14 +64,28 @@ func (b *BaseApi) GetOperationLogs(c *gin.Context) { }) } +// Clean operation logs +// @Tags Logs +// @Summary Clean operation logs +// @Description 清空操作日志 +// @Accept json +// @Param request body dto.CleanLog true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /logs/clean [post] +// @x-panel-log {"bodyKeys":["logType"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"清空 [logType] 日志信息","formatEN":"Clean the [logType] log information"} func (b *BaseApi) CleanLogs(c *gin.Context) { - logtype, ok := c.Params.Get("logtype") - if !ok { - helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, errors.New("error logtype in path")) + var req dto.CleanLog + if err := c.ShouldBindJSON(&req); err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + if err := global.VALID.Struct(req); err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - if err := logService.CleanLogs(logtype); err != nil { + if err := logService.CleanLogs(req.LogType); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } diff --git a/backend/app/api/v1/nginx.go b/backend/app/api/v1/nginx.go index 5a4b9d9dc..854159142 100644 --- a/backend/app/api/v1/nginx.go +++ b/backend/app/api/v1/nginx.go @@ -7,6 +7,13 @@ import ( "github.com/gin-gonic/gin" ) +// Load nginx conf +// @Tags Nginx +// @Summary Load nginx conf +// @Description 获取 nginx 配置信息 +// @Success 200 {object} response.FileInfo +// @Security ApiKeyAuth +// @Router /nginx [get] func (b *BaseApi) GetNginx(c *gin.Context) { fileInfo, err := nginxService.GetNginxConfig() if err != nil { @@ -16,6 +23,15 @@ func (b *BaseApi) GetNginx(c *gin.Context) { helper.SuccessWithData(c, fileInfo) } +// Load partial nginx conf +// @Tags Nginx +// @Summary Load partial nginx conf +// @Description 获取部分 nginx 配置信息 +// @Accept json +// @Param request body dto.NginxScopeReq true "request" +// @Success 200 {anrry} response.NginxParam +// @Security ApiKeyAuth +// @Router /nginx/scope [post] func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) { var req request.NginxScopeReq if err := c.ShouldBindJSON(&req); err != nil { @@ -31,6 +47,16 @@ func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) { helper.SuccessWithData(c, params) } +// Update nginx conf +// @Tags Nginx +// @Summary Update nginx conf +// @Description 更新 nginx 配置信息 +// @Accept json +// @Param request body dto.NginxConfigUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /nginx/update [post] +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新 nginx 配置 [domain]","formatEN":"Update nginx conf [domain]"} func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) { var req request.NginxConfigUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -44,6 +70,13 @@ func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load nginx status info +// @Tags Nginx +// @Summary Load nginx status info +// @Description 获取 nginx 状态信息 +// @Success 200 {object} response.NginxStatus +// @Security ApiKeyAuth +// @Router /nginx/status [get] func (b *BaseApi) GetNginxStatus(c *gin.Context) { res, err := nginxService.GetStatus() if err != nil { @@ -53,6 +86,16 @@ func (b *BaseApi) GetNginxStatus(c *gin.Context) { helper.SuccessWithData(c, res) } +// Update nginx conf by upload file +// @Tags Nginx +// @Summary Update nginx conf by upload file +// @Description 上传更新 nginx 配置文件 +// @Accept json +// @Param request body dto.NginxConfigFileUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /nginx/file [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新 nginx 配置","formatEN":"Update nginx conf"} func (b *BaseApi) UpdateNginxFile(c *gin.Context) { var req request.NginxConfigFileUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/setting.go b/backend/app/api/v1/setting.go index d322d0132..14aa7454a 100644 --- a/backend/app/api/v1/setting.go +++ b/backend/app/api/v1/setting.go @@ -13,6 +13,13 @@ import ( "github.com/gin-gonic/gin" ) +// Load system setting info +// @Tags System Setting +// @Summary Load system setting info +// @Description 加载系统配置信息 +// @Success 200 {object} dto.SettingInfo +// @Security ApiKeyAuth +// @Router /settings/search [post] func (b *BaseApi) GetSettingInfo(c *gin.Context) { setting, err := settingService.GetSettingInfo() if err != nil { @@ -22,6 +29,13 @@ func (b *BaseApi) GetSettingInfo(c *gin.Context) { helper.SuccessWithData(c, setting) } +// Load daemon.json path +// @Tags System Setting +// @Summary Load daemon.json path +// @Description 加载 docker 配置路径 +// @Success 200 {string} path +// @Security ApiKeyAuth +// @Router /settings/daemonjson [get] func (b *BaseApi) GetDaemonjson(c *gin.Context) { value, err := settingService.GetDaemonjson() if err != nil { @@ -31,6 +45,16 @@ func (b *BaseApi) GetDaemonjson(c *gin.Context) { helper.SuccessWithData(c, value) } +// Update system setting +// @Tags System Setting +// @Summary Update system setting +// @Description 更新系统配置 +// @Accept json +// @Param request body dto.SettingUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /settings/update [post] +// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"修改系统配置 [key] => [value]","formatEN":"update system setting [key] => [value]"} func (b *BaseApi) UpdateSetting(c *gin.Context) { var req dto.SettingUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -49,6 +73,16 @@ func (b *BaseApi) UpdateSetting(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update system password +// @Tags System Setting +// @Summary Update system password +// @Description 更新系统登录密码 +// @Accept json +// @Param request body dto.PasswordUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /settings/password/update [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"修改系统密码","formatEN":"update system password"} func (b *BaseApi) UpdatePassword(c *gin.Context) { var req dto.PasswordUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -67,6 +101,16 @@ func (b *BaseApi) UpdatePassword(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Reset system password expired +// @Tags System Setting +// @Summary Reset system password expired +// @Description 重置过期系统登录密码 +// @Accept json +// @Param request body dto.PasswordUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /settings/expired/handle [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"重置过期密码","formatEN":"reset an expired Password"} func (b *BaseApi) HandlePasswordExpired(c *gin.Context) { var req dto.PasswordUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -85,6 +129,14 @@ func (b *BaseApi) HandlePasswordExpired(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Sync system time +// @Tags System Setting +// @Summary Sync system time +// @Description 系统时间同步 +// @Success 200 {string} ntime +// @Security ApiKeyAuth +// @Router /settings/time/sync [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"系统时间同步","formatEN":"sync system time"} func (b *BaseApi) SyncTime(c *gin.Context) { ntime, err := ntp.Getremotetime() if err != nil { @@ -101,6 +153,14 @@ func (b *BaseApi) SyncTime(c *gin.Context) { helper.SuccessWithData(c, ntime.Format("2006-01-02 15:04:05 MST -0700")) } +// Clean monitor datas +// @Tags System Setting +// @Summary Clean monitor datas +// @Description 清空监控数据 +// @Success 200 +// @Security ApiKeyAuth +// @Router /settings/monitor/clean [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"清空监控数据","formatEN":"clean monitor datas"} func (b *BaseApi) CleanMonitor(c *gin.Context) { if err := global.DB.Exec("DELETE FROM monitor_bases").Error; err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) @@ -118,6 +178,13 @@ func (b *BaseApi) CleanMonitor(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load mfa info +// @Tags System Setting +// @Summary Load mfa info +// @Description 获取 mfa 信息 +// @Success 200 {object} mfa.Otp +// @Security ApiKeyAuth +// @Router /settings/mfa [get] func (b *BaseApi) GetMFA(c *gin.Context) { otp, err := mfa.GetOtp("admin") if err != nil { @@ -128,6 +195,16 @@ func (b *BaseApi) GetMFA(c *gin.Context) { helper.SuccessWithData(c, otp) } +// Bind mfa +// @Tags System Setting +// @Summary Bind mfa +// @Description Mfa 绑定 +// @Accept json +// @Param request body dto.MfaCredential true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /settings/mfa/bind [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"mfa 绑定","formatEN":"bind mfa"} func (b *BaseApi) MFABind(c *gin.Context) { var req dto.MfaCredential if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website.go b/backend/app/api/v1/website.go index 4f34419ad..209feddf0 100644 --- a/backend/app/api/v1/website.go +++ b/backend/app/api/v1/website.go @@ -9,6 +9,15 @@ import ( "github.com/gin-gonic/gin" ) +// Page website +// @Tags Website +// @Summary Search website with page +// @Description 获取网站列表分页 +// @Accept json +// @Param request body request.WebsiteSearch true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /websites/search [post] func (b *BaseApi) PageWebsite(c *gin.Context) { var req request.WebsiteSearch if err := c.ShouldBindJSON(&req); err != nil { @@ -26,6 +35,13 @@ func (b *BaseApi) PageWebsite(c *gin.Context) { }) } +// List website +// @Tags Website +// @Summary Search website +// @Description 获取网站列表 +// @Success 200 {anrry} response.WebsiteDTO +// @Security ApiKeyAuth +// @Router /websites/list [get] func (b *BaseApi) GetWebsites(c *gin.Context) { websites, err := websiteService.GetWebsites() if err != nil { @@ -35,6 +51,13 @@ func (b *BaseApi) GetWebsites(c *gin.Context) { helper.SuccessWithData(c, websites) } +// List website name +// @Tags Website +// @Summary Search website names +// @Description 获取网站列表 +// @Success 200 {anrry} string +// @Security ApiKeyAuth +// @Router /websites/options [get] func (b *BaseApi) GetWebsiteOptions(c *gin.Context) { websites, err := websiteService.GetWebsiteOptions() if err != nil { @@ -44,6 +67,16 @@ func (b *BaseApi) GetWebsiteOptions(c *gin.Context) { helper.SuccessWithData(c, websites) } +// Create website +// @Tags Website +// @Summary Create website +// @Description 创建网站 +// @Accept json +// @Param request body request.WebsiteCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites [post] +// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建网站 [primaryDomain]","formatEN":"Create website [primaryDomain]"} func (b *BaseApi) CreateWebsite(c *gin.Context) { var req request.WebsiteCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -58,6 +91,16 @@ func (b *BaseApi) CreateWebsite(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Operate website +// @Tags Website +// @Summary Operate website +// @Description 操作网站 +// @Accept json +// @Param request body request.WebsiteOp true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/operate [post] +// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[operate] 网站 [domain]","formatEN":"[operate] website [domain]"} func (b *BaseApi) OpWebsite(c *gin.Context) { var req request.WebsiteOp if err := c.ShouldBindJSON(&req); err != nil { @@ -72,6 +115,16 @@ func (b *BaseApi) OpWebsite(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Backup website +// @Tags Website +// @Summary Backup website +// @Description 备份网站 +// @Accept json +// @Param request body request.WebsiteResourceReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/backup [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"备份网站 [domain]","formatEN":"Backup website [domain]"} func (b *BaseApi) BackupWebsite(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { @@ -85,6 +138,16 @@ func (b *BaseApi) BackupWebsite(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Recover website by upload +// @Tags Website +// @Summary Recover website by upload +// @Description 从上传恢复网站 +// @Accept json +// @Param request body request.WebsiteRecoverByFile true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/recover/byupload [post] +// @x-panel-log {"bodyKeys":["websiteName","fileDir","fileName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"[websiteName] 从上传恢复 [fileDir]/[fileName]","formatEN":"[websiteName] recover from uploads [fileDir]/[fileName]"} func (b *BaseApi) RecoverWebsiteByUpload(c *gin.Context) { var req request.WebsiteRecoverByFile if err := c.ShouldBindJSON(&req); err != nil { @@ -103,6 +166,16 @@ func (b *BaseApi) RecoverWebsiteByUpload(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Recover website +// @Tags Website +// @Summary Recover website +// @Description 从备份恢复网站 +// @Accept json +// @Param request body request.WebsiteRecover true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/recover [post] +// @x-panel-log {"bodyKeys":["websiteName","backupName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"[websiteName] 从备份恢复 [backupName]","formatEN":"[websiteName] recover from backups [backupName]"} func (b *BaseApi) RecoverWebsite(c *gin.Context) { var req request.WebsiteRecover if err := c.ShouldBindJSON(&req); err != nil { @@ -121,6 +194,16 @@ func (b *BaseApi) RecoverWebsite(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Delete website +// @Tags Website +// @Summary Delete website +// @Description 删除网站 +// @Accept json +// @Param request body request.WebsiteDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/recover [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"删除网站 [domain]","formatEN":"Delete website [domain]"} func (b *BaseApi) DeleteWebsite(c *gin.Context) { var req request.WebsiteDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -135,6 +218,16 @@ func (b *BaseApi) DeleteWebsite(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update website +// @Tags Website +// @Summary Update website +// @Description 更新网站 +// @Accept json +// @Param request body request.WebsiteUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/update [post] +// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新网站 [primaryDomain]","formatEN":"Update website [primaryDomain]"} func (b *BaseApi) UpdateWebsite(c *gin.Context) { var req request.WebsiteUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -148,6 +241,15 @@ func (b *BaseApi) UpdateWebsite(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Search website by id +// @Tags Website +// @Summary Search website by id +// @Description 通过 id 查询网站 +// @Accept json +// @Param id path integer true "request" +// @Success 200 {object} response.WebsiteDTO +// @Security ApiKeyAuth +// @Router /websites/:id [get] func (b *BaseApi) GetWebsite(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { @@ -162,6 +264,15 @@ func (b *BaseApi) GetWebsite(c *gin.Context) { helper.SuccessWithData(c, website) } +// Search website nginx by id +// @Tags Website Nginx +// @Summary Search website nginx by id +// @Description 通过 id 查询网站 nginx +// @Accept json +// @Param id path integer true "request" +// @Success 200 {object} response.FileInfo +// @Security ApiKeyAuth +// @Router /websites/:id/nginx [get] func (b *BaseApi) GetWebsiteNginx(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { @@ -176,6 +287,15 @@ func (b *BaseApi) GetWebsiteNginx(c *gin.Context) { helper.SuccessWithData(c, fileInfo) } +// Search website domains by websiteId +// @Tags Website Domain +// @Summary Search website domains by websiteId +// @Description 通过网站 id 查询域名 +// @Accept json +// @Param websiteId path integer true "request" +// @Success 200 {anrry} model.WebsiteDomain +// @Security ApiKeyAuth +// @Router /websites/domains/:websiteId [get] func (b *BaseApi) GetWebDomains(c *gin.Context) { websiteId, err := helper.GetIntParamByKey(c, "websiteId") if err != nil { @@ -190,6 +310,16 @@ func (b *BaseApi) GetWebDomains(c *gin.Context) { helper.SuccessWithData(c, list) } +// Delete website domain +// @Tags Website Domain +// @Summary Delete website domain +// @Description 删除网站域名 +// @Accept json +// @Param request body request.WebsiteDomainDelete true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/domains/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_domains","output_colume":"domain","output_value":"domain"}],"formatZH":"删除域名 [domain]","formatEN":"Delete domain [domain]"} func (b *BaseApi) DeleteWebDomain(c *gin.Context) { var req request.WebsiteDomainDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -204,6 +334,16 @@ func (b *BaseApi) DeleteWebDomain(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Create website domain +// @Tags Website Domain +// @Summary Create website domain +// @Description 创建网站域名 +// @Accept json +// @Param request body request.WebsiteDomainCreate true "request" +// @Success 200 {object} model.WebsiteDomain +// @Security ApiKeyAuth +// @Router /websites/domains [post] +// @x-panel-log {"bodyKeys":["domain"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建域名 [domain]","formatEN":"Create domain [domain]"} func (b *BaseApi) CreateWebDomain(c *gin.Context) { var req request.WebsiteDomainCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -218,6 +358,15 @@ func (b *BaseApi) CreateWebDomain(c *gin.Context) { helper.SuccessWithData(c, domain) } +// Load nginx conf +// @Tags Website Nginx +// @Summary Load nginx conf +// @Description 获取 nginx 配置 +// @Accept json +// @Param request body request.NginxScopeReq true "request" +// @Success 200 {object} response.WebsiteNginxConfig +// @Security ApiKeyAuth +// @Router /websites/config [get] func (b *BaseApi) GetNginxConfig(c *gin.Context) { var req request.NginxScopeReq if err := c.ShouldBindJSON(&req); err != nil { @@ -232,6 +381,16 @@ func (b *BaseApi) GetNginxConfig(c *gin.Context) { helper.SuccessWithData(c, config) } +// Update nginx conf +// @Tags Website Nginx +// @Summary Update nginx conf +// @Description 更新 nginx 配置 +// @Accept json +// @Param request body request.NginxConfigUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/config/update [post] +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"nginx 配置修改 [domain]","formatEN":"Nginx conf update [domain]"} func (b *BaseApi) UpdateNginxConfig(c *gin.Context) { var req request.NginxConfigUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -245,6 +404,15 @@ func (b *BaseApi) UpdateNginxConfig(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Load https conf +// @Tags Website HTTPS +// @Summary Load https conf +// @Description 获取 https 配置 +// @Accept json +// @Param id path integer true "request" +// @Success 200 {object} response.WebsiteHTTPS +// @Security ApiKeyAuth +// @Router /websites/:id/https [post] func (b *BaseApi) GetHTTPSConfig(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { @@ -259,6 +427,16 @@ func (b *BaseApi) GetHTTPSConfig(c *gin.Context) { helper.SuccessWithData(c, res) } +// Update https conf +// @Tags Website HTTPS +// @Summary Update https conf +// @Description 更新 https 配置 +// @Accept json +// @Param request body request.WebsiteHTTPSOp true "request" +// @Success 200 {object} request.WebsiteHTTPS +// @Security ApiKeyAuth +// @Router /websites/:id/https [post] +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] https 配置","formatEN":"Update website https [domain] conf"} func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) { var req request.WebsiteHTTPSOp if err := c.ShouldBindJSON(&req); err != nil { @@ -276,6 +454,15 @@ func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) { helper.SuccessWithData(c, res) } +// Check before create website +// @Tags Website +// @Summary Check before create website +// @Description 网站创建前检查 +// @Accept json +// @Param request body request.WebsiteInstallCheckReq true "request" +// @Success 200 {anrry} request.WebsitePreInstallCheck +// @Security ApiKeyAuth +// @Router /websites/check [post] func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) { var req request.WebsiteInstallCheckReq if err := c.ShouldBindJSON(&req); err != nil { @@ -290,6 +477,15 @@ func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) { helper.SuccessWithData(c, data) } +// Load websit waf conf +// @Tags Website WAF +// @Summary Load websit waf conf +// @Description 获取网站 waf 配置 +// @Accept json +// @Param request body request.WebsiteWafReq true "request" +// @Success 200 {object} request.WebsiteWafConfig +// @Security ApiKeyAuth +// @Router /websites/waf/config [post] func (b *BaseApi) GetWebsiteWafConfig(c *gin.Context) { var req request.WebsiteWafReq if err := c.ShouldBindJSON(&req); err != nil { @@ -304,6 +500,16 @@ func (b *BaseApi) GetWebsiteWafConfig(c *gin.Context) { helper.SuccessWithData(c, data) } +// Update website waf conf +// @Tags Website WAF +// @Summary Update website waf conf +// @Description 更新 网站 waf 配置 +// @Accept json +// @Param request body request.WebsiteWafUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/waf/update [post] +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"WAF 配置修改 [domain]","formatEN":"WAF conf update [domain]"} func (b *BaseApi) UpdateWebsiteWafConfig(c *gin.Context) { var req request.WebsiteWafUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -317,6 +523,16 @@ func (b *BaseApi) UpdateWebsiteWafConfig(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update website nginx conf +// @Tags Website Nginx +// @Summary Update website nginx conf +// @Description 更新 网站 nginx 配置 +// @Accept json +// @Param request body request.WebsiteNginxUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/nginx/update [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[domain] Nginx 配置修改","formatEN":"[domain] Nginx conf update"} func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) { var req request.WebsiteNginxUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -330,6 +546,16 @@ func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Operate website log +// @Tags Website +// @Summary Operate website log +// @Description 操作网站日志 +// @Accept json +// @Param request body request.WebsiteLogReq true "request" +// @Success 200 {object} response.WebsiteLog +// @Security ApiKeyAuth +// @Router /websites/log [post] +// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[domain][operate] 日志","formatEN":"[domain][operate] logs"} func (b *BaseApi) OpWebsiteLog(c *gin.Context) { var req request.WebsiteLogReq if err := c.ShouldBindJSON(&req); err != nil { @@ -344,6 +570,16 @@ func (b *BaseApi) OpWebsiteLog(c *gin.Context) { helper.SuccessWithData(c, res) } +// Change default server +// @Tags Website +// @Summary Change default server +// @Description 操作网站日志 +// @Accept json +// @Param request body request.WebsiteDefaultUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/default/server [post] +// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"修改默认 server => [domain]","formatEN":"Change default server => [domain]"} func (b *BaseApi) ChangeDefaultServer(c *gin.Context) { var req request.WebsiteDefaultUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_acme_account.go b/backend/app/api/v1/website_acme_account.go index 0212da25b..aea7a4a27 100644 --- a/backend/app/api/v1/website_acme_account.go +++ b/backend/app/api/v1/website_acme_account.go @@ -8,6 +8,15 @@ import ( "github.com/gin-gonic/gin" ) +// Page website acme account +// @Tags Website Acme +// @Summary Search website acme account with page +// @Description 获取网站 acme 列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /websites/acme/search [post] func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -25,6 +34,16 @@ func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) { }) } +// Create website acme account +// @Tags Website Acme +// @Summary Create website acme account +// @Description 创建网站 acme +// @Accept json +// @Param request body request.WebsiteAcmeAccountCreate true "request" +// @Success 200 {object} response.WebsiteAcmeAccountDTO +// @Security ApiKeyAuth +// @Router /websites/acme [post] +// @x-panel-log {"bodyKeys":["email"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建网站 acme [email]","formatEN":"Create website acme [email]"} func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) { var req request.WebsiteAcmeAccountCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -39,6 +58,16 @@ func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) { helper.SuccessWithData(c, res) } +// Delete website acme account +// @Tags Website Acme +// @Summary Delete website acme account +// @Description 删除网站 acme +// @Accept json +// @Param request body request.WebsiteResourceReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/acme/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_acme_accounts","output_colume":"email","output_value":"email"}],"formatZH":"删除网站 acme [email]","formatEN":"Delete website acme [email]"} func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_dns_account.go b/backend/app/api/v1/website_dns_account.go index d6f9d773f..0063fea9a 100644 --- a/backend/app/api/v1/website_dns_account.go +++ b/backend/app/api/v1/website_dns_account.go @@ -8,6 +8,15 @@ import ( "github.com/gin-gonic/gin" ) +// Page website dns account +// @Tags Website DNS +// @Summary Search website dns account with page +// @Description 获取网站 dns 列表分页 +// @Accept json +// @Param request body dto.PageInfo true "request" +// @Success 200 {object} dto.PageResult +// @Security ApiKeyAuth +// @Router /websites/dns/search [post] func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) { var req dto.PageInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -25,6 +34,16 @@ func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) { }) } +// Create website dns account +// @Tags Website DNS +// @Summary Create website dns account +// @Description 创建网站 dns +// @Accept json +// @Param request body request.WebsiteDnsAccountCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/dns [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建网站 dns [name]","formatEN":"Create website dns [name]"} func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) { var req request.WebsiteDnsAccountCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -38,6 +57,16 @@ func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update website dns account +// @Tags Website DNS +// @Summary Update website dns account +// @Description 更新网站 dns +// @Accept json +// @Param request body request.WebsiteDnsAccountUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/dns/update [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新网站 dns [name]","formatEN":"Update website dns [name]"} func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) { var req request.WebsiteDnsAccountUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -51,6 +80,16 @@ func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Delete website dns account +// @Tags Website DNS +// @Summary Delete website dns account +// @Description 删除网站 dns +// @Accept json +// @Param request body request.WebsiteResourceReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/dns/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_dns_accounts","output_colume":"name","output_value":"name"}],"formatZH":"删除网站 dns [name]","formatEN":"Delete website dns [name]"} func (b *BaseApi) DeleteWebsiteDnsAccount(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_group.go b/backend/app/api/v1/website_group.go index 5ec4a1995..1be63578b 100644 --- a/backend/app/api/v1/website_group.go +++ b/backend/app/api/v1/website_group.go @@ -7,6 +7,13 @@ import ( "github.com/gin-gonic/gin" ) +// List website group +// @Tags Website Group +// @Summary List website group +// @Description 获取网站组 +// @Success 200 {anrry} model.WebsiteGroup +// @Security ApiKeyAuth +// @Router /websites/groups [get] func (b *BaseApi) GetWebGroups(c *gin.Context) { list, err := websiteGroupService.GetGroups() if err != nil { @@ -16,6 +23,16 @@ func (b *BaseApi) GetWebGroups(c *gin.Context) { helper.SuccessWithData(c, list) } +// Create website group +// @Tags Website Group +// @Summary Create website group +// @Description 创建网站组 +// @Accept json +// @Param request body request.WebsiteGroupCreate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/groups [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建网站组 [name]","formatEN":"Create website groups [name]"} func (b *BaseApi) CreateWebGroup(c *gin.Context) { var req request.WebsiteGroupCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -29,6 +46,16 @@ func (b *BaseApi) CreateWebGroup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Update website group +// @Tags Website Group +// @Summary Update website group +// @Description 更新网站组 +// @Accept json +// @Param request body request.WebsiteGroupUpdate true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/groups/update [post] +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新网站组 [name]","formatEN":"Update website groups [name]"} func (b *BaseApi) UpdateWebGroup(c *gin.Context) { var req request.WebsiteGroupUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -42,6 +69,16 @@ func (b *BaseApi) UpdateWebGroup(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Delete website group +// @Tags Website Group +// @Summary Delete website group +// @Description 删除网站组 +// @Accept json +// @Param request body request.WebsiteResourceReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/groups/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_groups","output_colume":"name","output_value":"name"}],"formatZH":"删除网站组 [name]","formatEN":"Delete website group [name]"} func (b *BaseApi) DeleteWebGroup(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_ssl.go b/backend/app/api/v1/website_ssl.go index 67be17d4f..a75b88c84 100644 --- a/backend/app/api/v1/website_ssl.go +++ b/backend/app/api/v1/website_ssl.go @@ -1,14 +1,24 @@ package v1 import ( + "reflect" + "github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/app/dto/request" "github.com/1Panel-dev/1Panel/backend/constant" "github.com/gin-gonic/gin" - "reflect" ) +// Page website ssl +// @Tags Website SSL +// @Summary Search website ssl with page +// @Description 获取网站 ssl 列表分页 +// @Accept json +// @Param request body request.WebsiteSSLSearch true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/ssl/search [post] func (b *BaseApi) PageWebsiteSSL(c *gin.Context) { var req request.WebsiteSSLSearch if err := c.ShouldBindJSON(&req); err != nil { @@ -35,6 +45,16 @@ func (b *BaseApi) PageWebsiteSSL(c *gin.Context) { } } +// Create website ssl +// @Tags Website SSL +// @Summary Create website ssl +// @Description 创建网站 ssl +// @Accept json +// @Param request body request.WebsiteSSLCreate true "request" +// @Success 200 {object} request.WebsiteSSLCreate +// @Security ApiKeyAuth +// @Router /websites/ssl [post] +// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建网站 ssl [primaryDomain]","formatEN":"Create website ssl [primaryDomain]"} func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) { var req request.WebsiteSSLCreate if err := c.ShouldBindJSON(&req); err != nil { @@ -49,6 +69,16 @@ func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) { helper.SuccessWithData(c, res) } +// Reset website ssl +// @Tags Website SSL +// @Summary Reset website ssl +// @Description 重置网站 ssl +// @Accept json +// @Param request body request.WebsiteSSLRenew true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/ssl/renew [post] +// @x-panel-log {"bodyKeys":["SSLId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"SSLId","isList":false,"db":"website_ssls","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"重置 ssl [domain]","formatEN":"Renew ssl [domain]"} func (b *BaseApi) RenewWebsiteSSL(c *gin.Context) { var req request.WebsiteSSLRenew if err := c.ShouldBindJSON(&req); err != nil { @@ -62,6 +92,15 @@ func (b *BaseApi) RenewWebsiteSSL(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Resolve website ssl +// @Tags Website SSL +// @Summary Resolve website ssl +// @Description 解析网站 ssl +// @Accept json +// @Param request body request.WebsiteDNSReq true "request" +// @Success 200 {anrry} response.WebsiteDNSRes +// @Security ApiKeyAuth +// @Router /websites/ssl/resolve [post] func (b *BaseApi) GetDNSResolve(c *gin.Context) { var req request.WebsiteDNSReq if err := c.ShouldBindJSON(&req); err != nil { @@ -76,6 +115,16 @@ func (b *BaseApi) GetDNSResolve(c *gin.Context) { helper.SuccessWithData(c, res) } +// Delete website ssl +// @Tags Website SSL +// @Summary Delete website ssl +// @Description 删除网站 ssl +// @Accept json +// @Param request body request.WebsiteResourceReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/ssl/del [post] +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_ssls","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"删除 ssl [domain]","formatEN":"Delete ssl [domain]"} func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { @@ -89,6 +138,15 @@ func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) { helper.SuccessWithData(c, nil) } +// Search website ssl by website id +// @Tags Website SSL +// @Summary Search website ssl by website id +// @Description 通过网站 id 查询 ssl +// @Accept json +// @Param websiteId path integer true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/ssl/website/:websiteId [get] func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) { websiteId, err := helper.GetIntParamByKey(c, "websiteId") if err != nil { @@ -103,6 +161,15 @@ func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) { helper.SuccessWithData(c, websiteSSL) } +// Search website ssl by id +// @Tags Website SSL +// @Summary Search website ssl by id +// @Description 通过 id 查询 ssl +// @Accept json +// @Param id path integer true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Router /websites/ssl/:id [get] func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) { id, err := helper.GetParamID(c) if err != nil { diff --git a/backend/app/dto/logs.go b/backend/app/dto/logs.go index efa664ffc..f3601482d 100644 --- a/backend/app/dto/logs.go +++ b/backend/app/dto/logs.go @@ -31,3 +31,7 @@ type LoginLog struct { Message string `json:"message"` CreatedAt time.Time `json:"createdAt"` } + +type CleanLog struct { + LogType string `json:"logType" validate:"required,oneof=login operation"` +} diff --git a/backend/app/service/command.go b/backend/app/service/command.go index 09f8e8883..17dc5ddd9 100644 --- a/backend/app/service/command.go +++ b/backend/app/service/command.go @@ -2,7 +2,6 @@ package service import ( "github.com/1Panel-dev/1Panel/backend/app/dto" - "github.com/1Panel-dev/1Panel/backend/app/model" "github.com/1Panel-dev/1Panel/backend/constant" "github.com/jinzhu/copier" "github.com/pkg/errors" @@ -11,7 +10,7 @@ import ( type CommandService struct{} type ICommandService interface { - List() ([]model.Command, error) + List() ([]dto.CommandInfo, error) SearchWithPage(search dto.SearchWithPage) (int64, interface{}, error) Create(commandDto dto.CommandOperate) error Update(id uint, upMap map[string]interface{}) error @@ -22,12 +21,20 @@ func NewICommandService() ICommandService { return &CommandService{} } -func (u *CommandService) List() ([]model.Command, error) { +func (u *CommandService) List() ([]dto.CommandInfo, error) { commands, err := commandRepo.GetList() if err != nil { return nil, constant.ErrRecordNotFound } - return commands, err + var dtoCommands []dto.CommandInfo + for _, command := range commands { + var item dto.CommandInfo + if err := copier.Copy(&item, &command); err != nil { + return nil, errors.WithMessage(constant.ErrStructTransform, err.Error()) + } + dtoCommands = append(dtoCommands, item) + } + return dtoCommands, err } func (u *CommandService) SearchWithPage(search dto.SearchWithPage) (int64, interface{}, error) { diff --git a/backend/router/ro_base.go b/backend/router/ro_base.go index 2fe4d9bd4..9c3ff57c3 100644 --- a/backend/router/ro_base.go +++ b/backend/router/ro_base.go @@ -11,11 +11,11 @@ func (s *BaseRouter) InitBaseRouter(Router *gin.RouterGroup) { baseRouter := Router.Group("auth") baseApi := v1.ApiGroupApp.BaseApi { - baseRouter.GET("captcha", baseApi.Captcha) - baseRouter.POST("mfalogin", baseApi.MFALogin) - baseRouter.POST("login", baseApi.Login) - baseRouter.GET("status", baseApi.CheckIsFirstLogin) - baseRouter.POST("init", baseApi.InitUserInfo) - baseRouter.POST("logout", baseApi.LogOut) + baseRouter.GET("/captcha", baseApi.Captcha) + baseRouter.POST("/mfalogin", baseApi.MFALogin) + baseRouter.POST("/login", baseApi.Login) + baseRouter.GET("/status", baseApi.CheckIsFirstLogin) + baseRouter.POST("/init", baseApi.InitUserInfo) + baseRouter.POST("/logout", baseApi.LogOut) } } diff --git a/backend/router/ro_container.go b/backend/router/ro_container.go index fdfa01d81..3c53a3526 100644 --- a/backend/router/ro_container.go +++ b/backend/router/ro_container.go @@ -60,7 +60,7 @@ func (s *ContainerRouter) InitContainerRouter(Router *gin.RouterGroup) { baRouter.POST("/volume", baseApi.CreateVolume) baRouter.GET("/daemonjson", baseApi.LoadDaemonJson) - baRouter.GET("docker/status", baseApi.LoadDockerStatus) + baRouter.GET("/docker/status", baseApi.LoadDockerStatus) baRouter.POST("/docker/operate", baseApi.OperateDocker) baRouter.POST("/daemonjson/update", baseApi.UpdateDaemonJson) baRouter.POST("/daemonjson/update/byfile", baseApi.UpdateDaemonJsonByFile) diff --git a/backend/router/ro_log.go b/backend/router/ro_log.go index 41b729c02..b24b32d8b 100644 --- a/backend/router/ro_log.go +++ b/backend/router/ro_log.go @@ -14,8 +14,8 @@ func (s *LogRouter) InitLogRouter(Router *gin.RouterGroup) { operationRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired()) baseApi := v1.ApiGroupApp.BaseApi { - operationRouter.POST("login", baseApi.GetLoginLogs) - operationRouter.POST("operation", baseApi.GetOperationLogs) - operationRouter.POST("clean/:logtype", baseApi.CleanLogs) + operationRouter.POST("/login", baseApi.GetLoginLogs) + operationRouter.POST("/operation", baseApi.GetOperationLogs) + operationRouter.POST("/clean", baseApi.CleanLogs) } } diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 3c706b250..5edc8e48d 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -1,10 +1,17 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag package docs -import "github.com/swaggo/swag" +import ( + "bytes" + "encoding/json" + "strings" + "text/template" -const docTemplate = `{ + "github.com/swaggo/swag" +) + +var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { @@ -20,21 +27,5103 @@ const docTemplate = `{ }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", - "paths": {} + "paths": { + "/apps/installed": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取已安装应用列表", + "consumes": [ + "application/json" + ], + "tags": [ + "App" + ], + "summary": "Search app list installed", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AppInstalledSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/apps/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取应用列表", + "consumes": [ + "application/json" + ], + "tags": [ + "App" + ], + "summary": "Search app list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AppSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/backups": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Create backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create backup account [type]", + "formatZH": "创建备份账号 [type]", + "paramKeys": [] + } + } + }, + "/backups/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_accounts", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "type", + "output_value": "types" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup account [types]", + "formatZH": "删除备份账号 [types]", + "paramKeys": [] + } + } + }, + "/backups/record/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_records", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "file_name", + "output_value": "files" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup records [files]", + "formatZH": "删除备份记录 [files]", + "paramKeys": [] + } + } + }, + "/backups/record/download": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Download backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DownloadRecord" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "source", + "fileName" + ], + "formatEN": "download backup records [source][fileName]", + "formatZH": "下载备份记录 [source][fileName]", + "paramKeys": [] + } + } + }, + "/backups/record/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份记录列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Search backup records with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RecordSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/backups/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 bucket 列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "List bucket", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ForBuckets" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/backups/update": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份账号列表", + "tags": [ + "Backup Account" + ], + "summary": "Search backup account", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新备份账号信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Update backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "update backup account [types]", + "formatZH": "更新备份账号 [types]", + "paramKeys": [] + } + } + }, + "/commands": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表", + "tags": [ + "Command" + ], + "summary": "Search command", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.CommandInfo" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Search command with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchWithPage" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/commands/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Delete command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "commands", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete quick command [names]", + "formatZH": "删除快捷命令 [names]", + "paramKeys": [] + } + } + }, + "/commands/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Update command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommandOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "update quick command [name]", + "formatZH": "更新快捷命令 [name]", + "paramKeys": [] + } + } + }, + "/containers": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Create container", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContainerCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "image" + ], + "formatEN": "create container [name][image]", + "formatZH": "创建容器 [name][image]", + "paramKeys": [] + } + } + }, + "/containers/compose": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器编排", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Create compose", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create compose [name]", + "formatZH": "创建 compose [name]", + "paramKeys": [] + } + } + }, + "/containers/compose/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器编排操作", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Operate compose", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeOperation" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "operation" + ], + "formatEN": "compose [operation] [name]", + "formatZH": "compose [operation] [name]", + "paramKeys": [] + } + } + }, + "/containers/compose/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取编排列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Search compose list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/compose/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新容器编排", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Update compose", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "update compose information [name]", + "formatZH": "更新 compose [name]", + "paramKeys": [] + } + } + }, + "/containers/daemonjson": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 docker 配置信息", + "produces": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Load docker daemon.json", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.DaemonJsonConf" + } + } + } + } + }, + "/containers/daemonjson/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改 docker 配置信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Update docker daemon.json", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DaemonJsonConf" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "Updated the docker daemon.json configuration", + "formatZH": "更新 docker daemon.json 配置", + "paramKeys": [] + } + } + }, + "/containers/daemonjson/update/byfile": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传替换 docker 配置文件", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Update docker daemon.json by upload file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DaemonJsonUpdateByFile" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "Updated the docker daemon.json configuration", + "formatZH": "更新 docker daemon.json 配置", + "paramKeys": [] + } + } + }, + "/containers/docker/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Docker 操作", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Operate docker", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DockerOperation" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "operation" + ], + "formatEN": "[operation] docker service", + "formatZH": "docker 服务 [operation]", + "paramKeys": [] + } + } + }, + "/containers/docker/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 docker 服务状态", + "produces": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Load docker status", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/containers/image": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像列表", + "produces": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Search image list", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/containers/image/build": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "构建镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Build image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageBuild" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "build image [name]", + "formatZH": "构建镜像 [name]", + "paramKeys": [] + } + } + }, + "/containers/image/load": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "导入镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Load image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageLoad" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "path" + ], + "formatEN": "load image from [path]", + "formatZH": "从 [path] 加载镜像", + "paramKeys": [] + } + } + }, + "/containers/image/pull": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "拉取镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Pull image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImagePull" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "repoID", + "isList": false, + "output_colume": "name", + "output_value": "reponame" + } + ], + "bodyKeys": [ + "repoID", + "imageName" + ], + "formatEN": "image pull [reponame][imageName]", + "formatZH": "镜像拉取 [reponame][imageName]", + "paramKeys": [] + } + } + }, + "/containers/image/push": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "推送镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Push image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImagePush" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "repoID", + "isList": false, + "output_colume": "name", + "output_value": "reponame" + } + ], + "bodyKeys": [ + "repoID", + "tagName", + "name" + ], + "formatEN": "push [tagName] to [reponame][name]", + "formatZH": "[tagName] 推送到 [reponame][name]", + "paramKeys": [] + } + } + }, + "/containers/image/remove": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Delete image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "names" + ], + "formatEN": "remove image [names]", + "formatZH": "移除镜像 [names]", + "paramKeys": [] + } + } + }, + "/containers/image/save": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "导出镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Save image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageSave" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "tagName", + "path", + "name" + ], + "formatEN": "save [tagName] as [path]/[name]", + "formatZH": "保留 [tagName] 为 [path]/[name]", + "paramKeys": [] + } + } + }, + "/containers/image/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Search image list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/image/tag": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Tag 镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Tag image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageTag" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "repoID", + "isList": false, + "output_colume": "name", + "output_value": "reponame" + } + ], + "bodyKeys": [ + "repoID", + "targetName" + ], + "formatEN": "tag image [reponame][targetName]", + "formatZH": "tag 镜像 [reponame][targetName]", + "paramKeys": [] + } + } + }, + "/containers/inspect": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器详情", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Container inspect", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.InspectReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/containers/network": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器网络", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Network" + ], + "summary": "Create network", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.NetworkCreat" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create container network [name]", + "formatZH": "创建容器网络 name", + "paramKeys": [] + } + } + }, + "/containers/network/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除容器网络", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Network" + ], + "summary": "Delete network", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "names" + ], + "formatEN": "delete container network [names]", + "formatZH": "删除容器网络 [names]", + "paramKeys": [] + } + } + }, + "/containers/network/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器网络列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Network" + ], + "summary": "Search network list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器操作", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Operate Container", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContainerOperation" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "operation", + "newName" + ], + "formatEN": "container [operation] [name] [newName]", + "formatZH": "容器 [name] 执行 [operation] [newName]", + "paramKeys": [] + } + } + }, + "/containers/repo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像仓库列表", + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Search image repo list", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建镜像仓库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Create image repo", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageRepoCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create image repo [name]", + "formatZH": "创建镜像仓库 [name]", + "paramKeys": [] + } + } + }, + "/containers/repo/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除镜像仓库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Delete image repo", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageRepoDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete image repo [names]", + "formatZH": "删除镜像仓库 [names]", + "paramKeys": [] + } + } + }, + "/containers/repo/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像仓库列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Search image repo list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/repo/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新镜像仓库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Update image repo", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageRepoUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_column": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "update image repo information [name]", + "formatZH": "更新镜像仓库 [name]", + "paramKeys": [] + } + } + }, + "/containers/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Search container list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageContainer" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/search/log": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器日志", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Container logs", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContainerLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/containers/stats/:id": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器监控信息", + "tags": [ + "Container" + ], + "summary": "Container stats", + "parameters": [ + { + "type": "integer", + "description": "容器id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ContainterStats" + } + } + } + } + }, + "/containers/template": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器编排模版列表", + "produces": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Search compose template list", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器编排模版", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Create Compose template", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeTemplateCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create compose template [name]", + "formatZH": "创建 compose 模版 [name]", + "paramKeys": [] + } + } + }, + "/containers/template/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除容器编排模版", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Delete compose template", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "compose_templates", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete compose template [names]", + "formatZH": "删除 compose 模版 [names]", + "paramKeys": [] + } + } + }, + "/containers/template/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器编排模版列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Search compose template list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/template/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新容器编排模版", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Update compose template", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeTemplateUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "compose_templates", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "update compose template information [name]", + "formatZH": "更新 compose 模版 [name]", + "paramKeys": [] + } + } + }, + "/containers/volume": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器存储卷", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Create volume", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.VolumeCreat" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create container volume [name]", + "formatZH": "创建容器存储卷 [name]", + "paramKeys": [] + } + } + }, + "/containers/volume/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除容器存储卷", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Delete volume", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "names" + ], + "formatEN": "delete container volume [names]", + "formatZH": "删除容器存储卷 [names]", + "paramKeys": [] + } + } + }, + "/containers/volume/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器存储卷列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Search volume list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器存储卷分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Search volume list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/cronjob/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Delete cronjob", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete cronjob [names]", + "formatZH": "删除计划任务 [names]", + "paramKeys": [] + } + } + }, + "/cronjob/download": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载计划任务记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Download Cronjob records", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobDownload" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "job_records", + "input_colume": "id", + "input_value": "recordID", + "isList": false, + "output_colume": "file", + "output_value": "file" + } + ], + "bodyKeys": [ + "recordID" + ], + "formatEN": "download the cronjob record [file]", + "formatZH": "下载计划任务记录 [file]", + "paramKeys": [] + } + } + }, + "/cronjob/handle": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "手动执行计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Handle cronjob once", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperateByID" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "manually execute the cronjob [name]", + "formatZH": "手动执行计划任务 [name]", + "paramKeys": [] + } + } + }, + "/cronjob/status": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新计划任务状态", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Update cronjob status", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobUpdateStatus" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id", + "status" + ], + "formatEN": "change the status of cronjob [name] to [status].", + "formatZH": "修改计划任务 [name] 状态为 [status]", + "paramKeys": [] + } + } + }, + "/cronjob/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Update cronjob", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "update cronjob [name]", + "formatZH": "更新计划任务 [name]", + "paramKeys": [] + } + } + }, + "/cronjobs": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Create cronjob", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type", + "name" + ], + "formatEN": "create cronjob [type][name]", + "formatZH": "创建计划任务 [type][name]", + "paramKeys": [] + } + } + }, + "/cronjobs/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取计划任务分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search cronjob list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchWithPage" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/cronjobs/search/records": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取计划任务记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search job records", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchRecord" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/databases": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建 mysql 数据库", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Create mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlDBCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create mysql database [name]", + "formatZH": "创建 mysql 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/backup": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "备份 mysql 数据库", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Backup mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupDB" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "mysqlName", + "dbName" + ], + "formatEN": "backup mysql database [mysqlName][dbName]", + "formatZH": "备份 mysql 数据库 [mysqlName][dbName]", + "paramKeys": [] + } + } + }, + "/databases/baseinfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 基础信息", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql base info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.DBBaseInfo" + } + } + } + } + }, + "/databases/change/access": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改 mysql 访问权限", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Change mysql access", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "Update database [name] access", + "formatZH": "更新数据库 [name] 访问权限", + "paramKeys": [] + } + } + }, + "/databases/change/password": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改 mysql 密码", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Change mysql password", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "Update database [name] password", + "formatZH": "更新数据库 [name] 密码", + "paramKeys": [] + } + } + }, + "/databases/conffile/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传替换 mysql 配置文件", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Update mysql conf by upload file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlConfUpdateByFile" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "update the mysql database configuration information", + "formatZH": "更新 mysql 数据库配置信息", + "paramKeys": [] + } + } + }, + "/databases/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除 mysql 数据库", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Delete mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlDBDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "delete mysql database [name]", + "formatZH": "删除 mysql 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/del/check": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Mysql 数据库删除前检查", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Check before delete mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperateByID" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/databases/description/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 mysql 数据库库描述信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Update mysql database description", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlDescription" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id", + "description" + ], + "formatEN": "The description of the mysql database [name] is modified =\u003e [description]", + "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", + "paramKeys": [] + } + } + }, + "/databases/options": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 数据库列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search mysql database list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/databases/recover": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Mysql 数据库恢复", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Recover mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RecoverDB" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "mysqlName", + "dbName", + "backupName" + ], + "formatEN": "恢复 mysql 数据库 [mysqlName][dbName] [backupName]", + "formatZH": "恢复 mysql 数据库 [mysqlName][dbName] [backupName]", + "paramKeys": [] + } + } + }, + "/databases/recover/byupload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Mysql 数据库从上传文件恢复", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Recover mysql database by upload file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UploadRecover" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "fileDir", + "fileName", + "mysqlName", + "dbName" + ], + "formatEN": "mysql database recover [fileDir]/[fileName] from [mysqlName][dbName]", + "formatZH": "mysql 数据库从 [fileDir]/[fileName] 恢复 [mysqlName][dbName]", + "paramKeys": [] + } + } + }, + "/databases/redis/backup": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "备份 redis 数据库", + "tags": [ + "Database Redis" + ], + "summary": "Backup redis", + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "backup redis database", + "formatZH": "备份 redis 数据库", + "paramKeys": [] + } + } + }, + "/databases/redis/backup/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 备份记录分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Search redis backup list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/databases/redis/conf": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 配置信息", + "tags": [ + "Database Redis" + ], + "summary": "Load redis conf", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RedisConf" + } + } + } + } + }, + "/databases/redis/conf/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 redis 配置信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Update redis conf", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RedisConfUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "update the redis database configuration information", + "formatZH": "更新 redis 数据库配置信息", + "paramKeys": [] + } + } + }, + "/databases/redis/conffile/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传更新 redis 配置信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Update redis conf by file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RedisConfUpdateByFile" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "update the redis database configuration information", + "formatZH": "更新 redis 数据库配置信息", + "paramKeys": [] + } + } + }, + "/databases/redis/password": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 redis 密码", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Change redis password", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "change the password of the redis database", + "formatZH": "修改 redis 数据库密码", + "paramKeys": [] + } + } + }, + "/databases/redis/persistence/conf": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 持久化配置", + "tags": [ + "Database Redis" + ], + "summary": "Load redis persistence conf", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RedisPersistence" + } + } + } + } + }, + "/databases/redis/persistence/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 redis 持久化配置", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Update redis persistence conf", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RedisConfPersistenceUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "redis database persistence configuration update", + "formatZH": "redis 数据库持久化配置更新", + "paramKeys": [] + } + } + }, + "/databases/redis/recover": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "恢复 redis 数据库", + "tags": [ + "Database Redis" + ], + "summary": "Recover redis", + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "fileDir", + "fileName" + ], + "formatEN": "redis database recover from [fileDir]/[fileName]", + "formatZH": "redis 数据库从 [fileDir]/[fileName] 恢复", + "paramKeys": [] + } + } + }, + "/databases/redis/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 状态信息", + "tags": [ + "Database Redis" + ], + "summary": "Load redis status info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RedisStatus" + } + } + } + } + }, + "/databases/remote": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 远程访问权限", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql remote access", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "bool" + } + } + } + } + }, + "/databases/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 数据库列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search mysql database list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/databases/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 状态信息", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql status info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.MysqlStatus" + } + } + } + } + }, + "/databases/variables": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 性能参数信息", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql variables info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.MysqlVariables" + } + } + } + } + }, + "/databases/variables/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "mysql 性能调优", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Update mysql variables", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlVariablesUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "adjust mysql database performance parameters", + "formatZH": "调整 mysql 数据库性能参数", + "paramKeys": [] + } + } + } + }, + "definitions": { + "dto.BackupDB": { + "type": "object", + "required": [ + "dbName", + "mysqlName" + ], + "properties": { + "dbName": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.BackupOperate": { + "type": "object", + "required": [ + "type", + "vars" + ], + "properties": { + "accessKey": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "credential": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "vars": { + "type": "string" + } + } + }, + "dto.BatchDelete": { + "type": "object", + "required": [ + "names" + ], + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dto.BatchDeleteReq": { + "type": "object", + "required": [ + "ids" + ], + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.ChangeDBInfo": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "id": { + "type": "integer" + }, + "value": { + "type": "string" + } + } + }, + "dto.CommandInfo": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "dto.CommandOperate": { + "type": "object", + "required": [ + "command", + "name" + ], + "properties": { + "command": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "dto.ComposeCreate": { + "type": "object", + "required": [ + "from", + "name" + ], + "properties": { + "file": { + "type": "string" + }, + "from": { + "type": "string", + "enum": [ + "edit", + "path", + "template" + ] + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "template": { + "type": "integer" + } + } + }, + "dto.ComposeOperation": { + "type": "object", + "required": [ + "name", + "operation", + "path" + ], + "properties": { + "name": { + "type": "string" + }, + "operation": { + "type": "string", + "enum": [ + "start", + "stop", + "down" + ] + }, + "path": { + "type": "string" + } + } + }, + "dto.ComposeTemplateCreate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "dto.ComposeTemplateUpdate": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + } + } + }, + "dto.ComposeUpdate": { + "type": "object", + "required": [ + "content", + "name", + "path" + ], + "properties": { + "content": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "dto.ContainerCreate": { + "type": "object", + "properties": { + "autoRemove": { + "type": "boolean" + }, + "cmd": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": "array", + "items": { + "type": "string" + } + }, + "exposedPorts": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.PortHelper" + } + }, + "image": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "memory": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "nanoCPUs": { + "type": "integer" + }, + "publishAllPorts": { + "type": "boolean" + }, + "restartPolicy": { + "type": "string" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.VolumeHelper" + } + } + } + }, + "dto.ContainerLog": { + "type": "object", + "required": [ + "containerID", + "mode" + ], + "properties": { + "containerID": { + "type": "string" + }, + "mode": { + "type": "string" + } + } + }, + "dto.ContainerOperation": { + "type": "object", + "required": [ + "name", + "operation" + ], + "properties": { + "name": { + "type": "string" + }, + "newName": { + "type": "string" + }, + "operation": { + "type": "string", + "enum": [ + "start", + "stop", + "restart", + "kill", + "pause", + "unpause", + "rename", + "remove" + ] + } + } + }, + "dto.ContainterStats": { + "type": "object", + "properties": { + "cache": { + "type": "number" + }, + "cpuPercent": { + "type": "number" + }, + "ioRead": { + "type": "number" + }, + "ioWrite": { + "type": "number" + }, + "memory": { + "type": "number" + }, + "networkRX": { + "type": "number" + }, + "networkTX": { + "type": "number" + }, + "shotTime": { + "type": "string" + } + } + }, + "dto.CronjobCreate": { + "type": "object", + "required": [ + "name", + "specType", + "type" + ], + "properties": { + "day": { + "type": "integer", + "maximum": 31, + "minimum": 1 + }, + "dbName": { + "type": "string" + }, + "exclusionRules": { + "type": "string" + }, + "hour": { + "type": "integer", + "maximum": 23, + "minimum": 0 + }, + "keepLocal": { + "type": "boolean" + }, + "minute": { + "type": "integer", + "maximum": 59, + "minimum": 0 + }, + "name": { + "type": "string" + }, + "retainCopies": { + "type": "integer", + "minimum": 1 + }, + "script": { + "type": "string" + }, + "sourceDir": { + "type": "string" + }, + "specType": { + "type": "string" + }, + "targetDirID": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "website": { + "type": "string" + }, + "week": { + "type": "integer", + "maximum": 7, + "minimum": 1 + } + } + }, + "dto.CronjobDownload": { + "type": "object", + "required": [ + "backupAccountID", + "recordID" + ], + "properties": { + "backupAccountID": { + "type": "integer" + }, + "recordID": { + "type": "integer" + } + } + }, + "dto.CronjobUpdate": { + "type": "object", + "required": [ + "id", + "name", + "specType" + ], + "properties": { + "day": { + "type": "integer", + "maximum": 31, + "minimum": 1 + }, + "dbName": { + "type": "string" + }, + "exclusionRules": { + "type": "string" + }, + "hour": { + "type": "integer", + "maximum": 23, + "minimum": 0 + }, + "id": { + "type": "integer" + }, + "keepLocal": { + "type": "boolean" + }, + "minute": { + "type": "integer", + "maximum": 59, + "minimum": 0 + }, + "name": { + "type": "string" + }, + "retainCopies": { + "type": "integer", + "minimum": 1 + }, + "script": { + "type": "string" + }, + "sourceDir": { + "type": "string" + }, + "specType": { + "type": "string" + }, + "targetDirID": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "website": { + "type": "string" + }, + "week": { + "type": "integer", + "maximum": 7, + "minimum": 1 + } + } + }, + "dto.CronjobUpdateStatus": { + "type": "object", + "required": [ + "id", + "status" + ], + "properties": { + "id": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + }, + "dto.DBBaseInfo": { + "type": "object", + "properties": { + "containerName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "port": { + "type": "integer" + } + } + }, + "dto.DaemonJsonConf": { + "type": "object", + "properties": { + "cgroupDriver": { + "type": "string" + }, + "insecureRegistries": { + "type": "array", + "items": { + "type": "string" + } + }, + "liveRestore": { + "type": "boolean" + }, + "registryMirrors": { + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "type": "string" + } + } + }, + "dto.DaemonJsonUpdateByFile": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "file": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "dto.DockerOperation": { + "type": "object", + "required": [ + "operation" + ], + "properties": { + "operation": { + "type": "string", + "enum": [ + "start", + "restart", + "stop" + ] + } + } + }, + "dto.DownloadRecord": { + "type": "object", + "required": [ + "fileDir", + "fileName", + "source" + ], + "properties": { + "fileDir": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "source": { + "type": "string", + "enum": [ + "OSS", + "S3", + "SFTP", + "MINIO", + "LOCAL" + ] + } + } + }, + "dto.ForBuckets": { + "type": "object", + "required": [ + "credential", + "type", + "vars" + ], + "properties": { + "accessKey": { + "type": "string" + }, + "credential": { + "type": "string" + }, + "type": { + "type": "string" + }, + "vars": { + "type": "string" + } + } + }, + "dto.ImageBuild": { + "type": "object", + "required": [ + "dockerfile", + "from", + "name" + ], + "properties": { + "dockerfile": { + "type": "string" + }, + "from": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dto.ImageLoad": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "type": "string" + } + } + }, + "dto.ImagePull": { + "type": "object", + "required": [ + "imageName" + ], + "properties": { + "imageName": { + "type": "string" + }, + "repoID": { + "type": "integer" + } + } + }, + "dto.ImagePush": { + "type": "object", + "required": [ + "name", + "repoID", + "tagName" + ], + "properties": { + "name": { + "type": "string" + }, + "repoID": { + "type": "integer" + }, + "tagName": { + "type": "string" + } + } + }, + "dto.ImageRepoCreate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "auth": { + "type": "boolean" + }, + "downloadUrl": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "dto.ImageRepoDelete": { + "type": "object", + "required": [ + "ids" + ], + "properties": { + "deleteInsecure": { + "type": "boolean" + }, + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.ImageRepoUpdate": { + "type": "object", + "properties": { + "auth": { + "type": "boolean" + }, + "downloadUrl": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "password": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "dto.ImageSave": { + "type": "object", + "required": [ + "name", + "path", + "tagName" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "tagName": { + "type": "string" + } + } + }, + "dto.ImageTag": { + "type": "object", + "required": [ + "sourceID", + "targetName" + ], + "properties": { + "repoID": { + "type": "integer" + }, + "sourceID": { + "type": "string" + }, + "targetName": { + "type": "string" + } + } + }, + "dto.InspectReq": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "dto.MysqlConfUpdateByFile": { + "type": "object", + "required": [ + "mysqlName" + ], + "properties": { + "file": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.MysqlDBCreate": { + "type": "object", + "required": [ + "format", + "name", + "password", + "permission", + "username" + ], + "properties": { + "description": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "utf8mb4", + "utf8", + "gbk", + "big5" + ] + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "permission": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "dto.MysqlDBDelete": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "deleteBackup": { + "type": "boolean" + }, + "forceDelete": { + "type": "boolean" + }, + "id": { + "type": "integer" + } + } + }, + "dto.MysqlDescription": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + } + } + }, + "dto.MysqlStatus": { + "type": "object", + "properties": { + "Aborted_clients": { + "type": "string" + }, + "Aborted_connects": { + "type": "string" + }, + "Bytes_received": { + "type": "string" + }, + "Bytes_sent": { + "type": "string" + }, + "Com_commit": { + "type": "string" + }, + "Com_rollback": { + "type": "string" + }, + "Connections": { + "type": "string" + }, + "Created_tmp_disk_tables": { + "type": "string" + }, + "Created_tmp_tables": { + "type": "string" + }, + "File": { + "type": "string" + }, + "Innodb_buffer_pool_pages_dirty": { + "type": "string" + }, + "Innodb_buffer_pool_read_requests": { + "type": "string" + }, + "Innodb_buffer_pool_reads": { + "type": "string" + }, + "Key_read_requests": { + "type": "string" + }, + "Key_reads": { + "type": "string" + }, + "Key_write_requests": { + "type": "string" + }, + "Key_writes": { + "type": "string" + }, + "Max_used_connections": { + "type": "string" + }, + "Open_tables": { + "type": "string" + }, + "Opened_files": { + "type": "string" + }, + "Opened_tables": { + "type": "string" + }, + "Position": { + "type": "string" + }, + "Qcache_hits": { + "type": "string" + }, + "Qcache_inserts": { + "type": "string" + }, + "Questions": { + "type": "string" + }, + "Run": { + "type": "string" + }, + "Select_full_join": { + "type": "string" + }, + "Select_range_check": { + "type": "string" + }, + "Sort_merge_passes": { + "type": "string" + }, + "Table_locks_waited": { + "type": "string" + }, + "Threads_cached": { + "type": "string" + }, + "Threads_connected": { + "type": "string" + }, + "Threads_created": { + "type": "string" + }, + "Threads_running": { + "type": "string" + }, + "Uptime": { + "type": "string" + } + } + }, + "dto.MysqlVariables": { + "type": "object", + "properties": { + "binlog_cache_size": { + "type": "string" + }, + "innodb_buffer_pool_size": { + "type": "string" + }, + "innodb_log_buffer_size": { + "type": "string" + }, + "join_buffer_size": { + "type": "string" + }, + "key_buffer_size": { + "type": "string" + }, + "long_query_time": { + "type": "string" + }, + "max_connections": { + "type": "string" + }, + "max_heap_table_size": { + "type": "string" + }, + "query_cache_size": { + "type": "string" + }, + "query_cache_type": { + "type": "string" + }, + "read_buffer_size": { + "type": "string" + }, + "read_rnd_buffer_size": { + "type": "string" + }, + "slow_query_log": { + "type": "string" + }, + "sort_buffer_size": { + "type": "string" + }, + "table_open_cache": { + "type": "string" + }, + "thread_cache_size": { + "type": "string" + }, + "thread_stack": { + "type": "string" + }, + "tmp_table_size": { + "type": "string" + } + } + }, + "dto.MysqlVariablesUpdate": { + "type": "object", + "properties": { + "param": { + "type": "string" + }, + "value": {} + } + }, + "dto.NetworkCreat": { + "type": "object", + "properties": { + "driver": { + "type": "string" + }, + "gateway": { + "type": "string" + }, + "ipRange": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "string" + } + }, + "subnet": { + "type": "string" + } + } + }, + "dto.OperateByID": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + } + } + }, + "dto.PageContainer": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "filters": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } + }, + "dto.PageInfo": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } + }, + "dto.PageResult": { + "type": "object", + "properties": { + "items": {}, + "total": { + "type": "integer" + } + } + }, + "dto.PortHelper": { + "type": "object", + "properties": { + "containerPort": { + "type": "integer" + }, + "hostPort": { + "type": "integer" + } + } + }, + "dto.RecordSearch": { + "type": "object", + "required": [ + "name", + "page", + "pageSize", + "type" + ], + "properties": { + "detailName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "dto.RecoverDB": { + "type": "object", + "required": [ + "backupName", + "dbName", + "mysqlName" + ], + "properties": { + "backupName": { + "type": "string" + }, + "dbName": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.RedisConf": { + "type": "object", + "properties": { + "containerName": { + "type": "string" + }, + "maxclients": { + "type": "string" + }, + "maxmemory": { + "type": "string" + }, + "name": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "requirepass": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } + }, + "dto.RedisConfPersistenceUpdate": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "appendfsync": { + "type": "string" + }, + "appendonly": { + "type": "string" + }, + "save": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "aof", + "rbd" + ] + } + } + }, + "dto.RedisConfUpdate": { + "type": "object", + "properties": { + "maxclients": { + "type": "string" + }, + "maxmemory": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } + }, + "dto.RedisConfUpdateByFile": { + "type": "object", + "properties": { + "file": { + "type": "string" + }, + "restartNow": { + "type": "boolean" + } + } + }, + "dto.RedisPersistence": { + "type": "object", + "properties": { + "appendfsync": { + "type": "string" + }, + "appendonly": { + "type": "string" + }, + "save": { + "type": "string" + } + } + }, + "dto.RedisStatus": { + "type": "object", + "properties": { + "connected_clients": { + "type": "string" + }, + "instantaneous_ops_per_sec": { + "type": "string" + }, + "keyspace_hits": { + "type": "string" + }, + "keyspace_misses": { + "type": "string" + }, + "latest_fork_usec": { + "type": "string" + }, + "mem_fragmentation_ratio": { + "type": "string" + }, + "tcp_port": { + "type": "string" + }, + "total_commands_processed": { + "type": "string" + }, + "total_connections_received": { + "type": "string" + }, + "uptime_in_days": { + "type": "string" + }, + "used_memory": { + "type": "string" + }, + "used_memory_peak": { + "type": "string" + }, + "used_memory_rss": { + "type": "string" + } + } + }, + "dto.SearchRecord": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "cronjobID": { + "type": "integer" + }, + "endTime": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "startTime": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "dto.SearchWithPage": { + "type": "object", + "required": [ + "info", + "page", + "pageSize" + ], + "properties": { + "info": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } + }, + "dto.UploadRecover": { + "type": "object", + "required": [ + "dbName", + "mysqlName" + ], + "properties": { + "dbName": { + "type": "string" + }, + "fileDir": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.VolumeCreat": { + "type": "object", + "properties": { + "driver": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dto.VolumeHelper": { + "type": "object", + "properties": { + "containerDir": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "sourceDir": { + "type": "string" + } + } + }, + "request.AppInstalledSearch": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "name": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "request.AppSearch": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "name": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + } + } + } + } }` +type swaggerInfo struct { + Version string + Host string + BasePath string + Schemes []string + Title string + Description string +} + // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "localhost", - BasePath: "/api/v1", - Schemes: []string{}, - Title: "1Panel", - Description: "开源Linux面板", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, +var SwaggerInfo = swaggerInfo{ + Version: "1.0", + Host: "localhost", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "1Panel", + Description: "开源Linux面板", +} + +type s struct{} + +func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + + t, err := template.New("swagger_info").Funcs(template.FuncMap{ + "marshal": func(v interface{}) string { + a, _ := json.Marshal(v) + return string(a) + }, + "escape": func(v interface{}) string { + // escape tabs + str := strings.Replace(v.(string), "\t", "\\t", -1) + // replace " with \", and if that results in \\", replace that with \\\" + str = strings.Replace(str, "\"", "\\\"", -1) + return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) + }, + }).Parse(doc) + if err != nil { + return doc + } + + var tpl bytes.Buffer + if err := t.Execute(&tpl, sInfo); err != nil { + return doc + } + + return tpl.String() } func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) + swag.Register("swagger", &s{}) } diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 6289c55a3..387032bb3 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -13,5 +13,5049 @@ }, "host": "localhost", "basePath": "/api/v1", - "paths": {} + "paths": { + "/apps/installed": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取已安装应用列表", + "consumes": [ + "application/json" + ], + "tags": [ + "App" + ], + "summary": "Search app list installed", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AppInstalledSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/apps/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取应用列表", + "consumes": [ + "application/json" + ], + "tags": [ + "App" + ], + "summary": "Search app list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AppSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/backups": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Create backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create backup account [type]", + "formatZH": "创建备份账号 [type]", + "paramKeys": [] + } + } + }, + "/backups/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_accounts", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "type", + "output_value": "types" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup account [types]", + "formatZH": "删除备份账号 [types]", + "paramKeys": [] + } + } + }, + "/backups/record/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_records", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "file_name", + "output_value": "files" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup records [files]", + "formatZH": "删除备份记录 [files]", + "paramKeys": [] + } + } + }, + "/backups/record/download": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Download backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DownloadRecord" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "source", + "fileName" + ], + "formatEN": "download backup records [source][fileName]", + "formatZH": "下载备份记录 [source][fileName]", + "paramKeys": [] + } + } + }, + "/backups/record/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份记录列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Search backup records with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RecordSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/backups/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 bucket 列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "List bucket", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ForBuckets" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/backups/update": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份账号列表", + "tags": [ + "Backup Account" + ], + "summary": "Search backup account", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新备份账号信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Update backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "update backup account [types]", + "formatZH": "更新备份账号 [types]", + "paramKeys": [] + } + } + }, + "/commands": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表", + "tags": [ + "Command" + ], + "summary": "Search command", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.CommandInfo" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Search command with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchWithPage" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/commands/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Delete command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "commands", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete quick command [names]", + "formatZH": "删除快捷命令 [names]", + "paramKeys": [] + } + } + }, + "/commands/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Update command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommandOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "update quick command [name]", + "formatZH": "更新快捷命令 [name]", + "paramKeys": [] + } + } + }, + "/containers": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Create container", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContainerCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "image" + ], + "formatEN": "create container [name][image]", + "formatZH": "创建容器 [name][image]", + "paramKeys": [] + } + } + }, + "/containers/compose": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器编排", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Create compose", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create compose [name]", + "formatZH": "创建 compose [name]", + "paramKeys": [] + } + } + }, + "/containers/compose/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器编排操作", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Operate compose", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeOperation" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "operation" + ], + "formatEN": "compose [operation] [name]", + "formatZH": "compose [operation] [name]", + "paramKeys": [] + } + } + }, + "/containers/compose/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取编排列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Search compose list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/compose/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新容器编排", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose" + ], + "summary": "Update compose", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "update compose information [name]", + "formatZH": "更新 compose [name]", + "paramKeys": [] + } + } + }, + "/containers/daemonjson": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 docker 配置信息", + "produces": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Load docker daemon.json", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.DaemonJsonConf" + } + } + } + } + }, + "/containers/daemonjson/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改 docker 配置信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Update docker daemon.json", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DaemonJsonConf" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "Updated the docker daemon.json configuration", + "formatZH": "更新 docker daemon.json 配置", + "paramKeys": [] + } + } + }, + "/containers/daemonjson/update/byfile": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传替换 docker 配置文件", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Update docker daemon.json by upload file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DaemonJsonUpdateByFile" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "Updated the docker daemon.json configuration", + "formatZH": "更新 docker daemon.json 配置", + "paramKeys": [] + } + } + }, + "/containers/docker/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Docker 操作", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Operate docker", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DockerOperation" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "operation" + ], + "formatEN": "[operation] docker service", + "formatZH": "docker 服务 [operation]", + "paramKeys": [] + } + } + }, + "/containers/docker/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 docker 服务状态", + "produces": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Load docker status", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/containers/image": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像列表", + "produces": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Search image list", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/containers/image/build": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "构建镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Build image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageBuild" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "build image [name]", + "formatZH": "构建镜像 [name]", + "paramKeys": [] + } + } + }, + "/containers/image/load": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "导入镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Load image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageLoad" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "path" + ], + "formatEN": "load image from [path]", + "formatZH": "从 [path] 加载镜像", + "paramKeys": [] + } + } + }, + "/containers/image/pull": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "拉取镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Pull image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImagePull" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "repoID", + "isList": false, + "output_colume": "name", + "output_value": "reponame" + } + ], + "bodyKeys": [ + "repoID", + "imageName" + ], + "formatEN": "image pull [reponame][imageName]", + "formatZH": "镜像拉取 [reponame][imageName]", + "paramKeys": [] + } + } + }, + "/containers/image/push": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "推送镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Push image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImagePush" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "repoID", + "isList": false, + "output_colume": "name", + "output_value": "reponame" + } + ], + "bodyKeys": [ + "repoID", + "tagName", + "name" + ], + "formatEN": "push [tagName] to [reponame][name]", + "formatZH": "[tagName] 推送到 [reponame][name]", + "paramKeys": [] + } + } + }, + "/containers/image/remove": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Delete image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "names" + ], + "formatEN": "remove image [names]", + "formatZH": "移除镜像 [names]", + "paramKeys": [] + } + } + }, + "/containers/image/save": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "导出镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Save image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageSave" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "tagName", + "path", + "name" + ], + "formatEN": "save [tagName] as [path]/[name]", + "formatZH": "保留 [tagName] 为 [path]/[name]", + "paramKeys": [] + } + } + }, + "/containers/image/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Search image list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/image/tag": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Tag 镜像", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Image" + ], + "summary": "Tag image", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageTag" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "repoID", + "isList": false, + "output_colume": "name", + "output_value": "reponame" + } + ], + "bodyKeys": [ + "repoID", + "targetName" + ], + "formatEN": "tag image [reponame][targetName]", + "formatZH": "tag 镜像 [reponame][targetName]", + "paramKeys": [] + } + } + }, + "/containers/inspect": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器详情", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Container inspect", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.InspectReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/containers/network": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器网络", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Network" + ], + "summary": "Create network", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.NetworkCreat" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create container network [name]", + "formatZH": "创建容器网络 name", + "paramKeys": [] + } + } + }, + "/containers/network/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除容器网络", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Network" + ], + "summary": "Delete network", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "names" + ], + "formatEN": "delete container network [names]", + "formatZH": "删除容器网络 [names]", + "paramKeys": [] + } + } + }, + "/containers/network/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器网络列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Network" + ], + "summary": "Search network list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器操作", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Operate Container", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContainerOperation" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "operation", + "newName" + ], + "formatEN": "container [operation] [name] [newName]", + "formatZH": "容器 [name] 执行 [operation] [newName]", + "paramKeys": [] + } + } + }, + "/containers/repo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像仓库列表", + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Search image repo list", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建镜像仓库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Create image repo", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageRepoCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create image repo [name]", + "formatZH": "创建镜像仓库 [name]", + "paramKeys": [] + } + } + }, + "/containers/repo/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除镜像仓库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Delete image repo", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageRepoDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete image repo [names]", + "formatZH": "删除镜像仓库 [names]", + "paramKeys": [] + } + } + }, + "/containers/repo/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取镜像仓库列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Search image repo list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/repo/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新镜像仓库", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Image-repo" + ], + "summary": "Update image repo", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ImageRepoUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "image_repos", + "input_column": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "update image repo information [name]", + "formatZH": "更新镜像仓库 [name]", + "paramKeys": [] + } + } + }, + "/containers/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Search container list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageContainer" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/search/log": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器日志", + "consumes": [ + "application/json" + ], + "tags": [ + "Container" + ], + "summary": "Container logs", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContainerLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/containers/stats/:id": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "容器监控信息", + "tags": [ + "Container" + ], + "summary": "Container stats", + "parameters": [ + { + "type": "integer", + "description": "容器id", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ContainterStats" + } + } + } + } + }, + "/containers/template": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器编排模版列表", + "produces": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Search compose template list", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器编排模版", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Create Compose template", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeTemplateCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create compose template [name]", + "formatZH": "创建 compose 模版 [name]", + "paramKeys": [] + } + } + }, + "/containers/template/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除容器编排模版", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Delete compose template", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "compose_templates", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete compose template [names]", + "formatZH": "删除 compose 模版 [names]", + "paramKeys": [] + } + } + }, + "/containers/template/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器编排模版列表分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Search compose template list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/containers/template/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新容器编排模版", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Compose-template" + ], + "summary": "Update compose template", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ComposeTemplateUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "compose_templates", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "update compose template information [name]", + "formatZH": "更新 compose 模版 [name]", + "paramKeys": [] + } + } + }, + "/containers/volume": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建容器存储卷", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Create volume", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.VolumeCreat" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create container volume [name]", + "formatZH": "创建容器存储卷 [name]", + "paramKeys": [] + } + } + }, + "/containers/volume/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除容器存储卷", + "consumes": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Delete volume", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "names" + ], + "formatEN": "delete container volume [names]", + "formatZH": "删除容器存储卷 [names]", + "paramKeys": [] + } + } + }, + "/containers/volume/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器存储卷列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Search volume list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取容器存储卷分页", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Container Volume" + ], + "summary": "Search volume list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/cronjob/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Delete cronjob", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete cronjob [names]", + "formatZH": "删除计划任务 [names]", + "paramKeys": [] + } + } + }, + "/cronjob/download": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载计划任务记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Download Cronjob records", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobDownload" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "job_records", + "input_colume": "id", + "input_value": "recordID", + "isList": false, + "output_colume": "file", + "output_value": "file" + } + ], + "bodyKeys": [ + "recordID" + ], + "formatEN": "download the cronjob record [file]", + "formatZH": "下载计划任务记录 [file]", + "paramKeys": [] + } + } + }, + "/cronjob/handle": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "手动执行计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Handle cronjob once", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperateByID" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "manually execute the cronjob [name]", + "formatZH": "手动执行计划任务 [name]", + "paramKeys": [] + } + } + }, + "/cronjob/status": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新计划任务状态", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Update cronjob status", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobUpdateStatus" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id", + "status" + ], + "formatEN": "change the status of cronjob [name] to [status].", + "formatZH": "修改计划任务 [name] 状态为 [status]", + "paramKeys": [] + } + } + }, + "/cronjob/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Update cronjob", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "cronjobs", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "update cronjob [name]", + "formatZH": "更新计划任务 [name]", + "paramKeys": [] + } + } + }, + "/cronjobs": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建计划任务", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Create cronjob", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CronjobCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type", + "name" + ], + "formatEN": "create cronjob [type][name]", + "formatZH": "创建计划任务 [type][name]", + "paramKeys": [] + } + } + }, + "/cronjobs/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取计划任务分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search cronjob list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchWithPage" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/cronjobs/search/records": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取计划任务记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search job records", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchRecord" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/databases": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建 mysql 数据库", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Create mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlDBCreate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "create mysql database [name]", + "formatZH": "创建 mysql 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/backup": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "备份 mysql 数据库", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Backup mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupDB" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "mysqlName", + "dbName" + ], + "formatEN": "backup mysql database [mysqlName][dbName]", + "formatZH": "备份 mysql 数据库 [mysqlName][dbName]", + "paramKeys": [] + } + } + }, + "/databases/baseinfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 基础信息", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql base info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.DBBaseInfo" + } + } + } + } + }, + "/databases/change/access": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改 mysql 访问权限", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Change mysql access", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "Update database [name] access", + "formatZH": "更新数据库 [name] 访问权限", + "paramKeys": [] + } + } + }, + "/databases/change/password": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "修改 mysql 密码", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Change mysql password", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "Update database [name] password", + "formatZH": "更新数据库 [name] 密码", + "paramKeys": [] + } + } + }, + "/databases/conffile/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传替换 mysql 配置文件", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Update mysql conf by upload file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlConfUpdateByFile" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "update the mysql database configuration information", + "formatZH": "更新 mysql 数据库配置信息", + "paramKeys": [] + } + } + }, + "/databases/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除 mysql 数据库", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Delete mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlDBDelete" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "delete mysql database [name]", + "formatZH": "删除 mysql 数据库 [name]", + "paramKeys": [] + } + } + }, + "/databases/del/check": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Mysql 数据库删除前检查", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Check before delete mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperateByID" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/databases/description/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 mysql 数据库库描述信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Update mysql database description", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlDescription" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "database_mysqls", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id", + "description" + ], + "formatEN": "The description of the mysql database [name] is modified =\u003e [description]", + "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", + "paramKeys": [] + } + } + }, + "/databases/options": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 数据库列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search mysql database list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/databases/recover": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Mysql 数据库恢复", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Recover mysql database", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RecoverDB" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "mysqlName", + "dbName", + "backupName" + ], + "formatEN": "恢复 mysql 数据库 [mysqlName][dbName] [backupName]", + "formatZH": "恢复 mysql 数据库 [mysqlName][dbName] [backupName]", + "paramKeys": [] + } + } + }, + "/databases/recover/byupload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "Mysql 数据库从上传文件恢复", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Recover mysql database by upload file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.UploadRecover" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "fileDir", + "fileName", + "mysqlName", + "dbName" + ], + "formatEN": "mysql database recover [fileDir]/[fileName] from [mysqlName][dbName]", + "formatZH": "mysql 数据库从 [fileDir]/[fileName] 恢复 [mysqlName][dbName]", + "paramKeys": [] + } + } + }, + "/databases/redis/backup": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "备份 redis 数据库", + "tags": [ + "Database Redis" + ], + "summary": "Backup redis", + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "backup redis database", + "formatZH": "备份 redis 数据库", + "paramKeys": [] + } + } + }, + "/databases/redis/backup/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 备份记录分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Search redis backup list", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/databases/redis/conf": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 配置信息", + "tags": [ + "Database Redis" + ], + "summary": "Load redis conf", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RedisConf" + } + } + } + } + }, + "/databases/redis/conf/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 redis 配置信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Update redis conf", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RedisConfUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "update the redis database configuration information", + "formatZH": "更新 redis 数据库配置信息", + "paramKeys": [] + } + } + }, + "/databases/redis/conffile/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "上传更新 redis 配置信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Update redis conf by file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RedisConfUpdateByFile" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "update the redis database configuration information", + "formatZH": "更新 redis 数据库配置信息", + "paramKeys": [] + } + } + }, + "/databases/redis/password": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 redis 密码", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Change redis password", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ChangeDBInfo" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "change the password of the redis database", + "formatZH": "修改 redis 数据库密码", + "paramKeys": [] + } + } + }, + "/databases/redis/persistence/conf": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 持久化配置", + "tags": [ + "Database Redis" + ], + "summary": "Load redis persistence conf", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RedisPersistence" + } + } + } + } + }, + "/databases/redis/persistence/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新 redis 持久化配置", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Redis" + ], + "summary": "Update redis persistence conf", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RedisConfPersistenceUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "redis database persistence configuration update", + "formatZH": "redis 数据库持久化配置更新", + "paramKeys": [] + } + } + }, + "/databases/redis/recover": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "恢复 redis 数据库", + "tags": [ + "Database Redis" + ], + "summary": "Recover redis", + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "fileDir", + "fileName" + ], + "formatEN": "redis database recover from [fileDir]/[fileName]", + "formatZH": "redis 数据库从 [fileDir]/[fileName] 恢复", + "paramKeys": [] + } + } + }, + "/databases/redis/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 redis 状态信息", + "tags": [ + "Database Redis" + ], + "summary": "Load redis status info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.RedisStatus" + } + } + } + } + }, + "/databases/remote": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 远程访问权限", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql remote access", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "bool" + } + } + } + } + }, + "/databases/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 数据库列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Cronjob" + ], + "summary": "Search mysql database list with page", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/databases/status": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 状态信息", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql status info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.MysqlStatus" + } + } + } + } + }, + "/databases/variables": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 mysql 性能参数信息", + "tags": [ + "Database Mysql" + ], + "summary": "Load mysql variables info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.MysqlVariables" + } + } + } + } + }, + "/databases/variables/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "mysql 性能调优", + "consumes": [ + "application/json" + ], + "tags": [ + "Database Mysql" + ], + "summary": "Update mysql variables", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.MysqlVariablesUpdate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [], + "formatEN": "adjust mysql database performance parameters", + "formatZH": "调整 mysql 数据库性能参数", + "paramKeys": [] + } + } + } + }, + "definitions": { + "dto.BackupDB": { + "type": "object", + "required": [ + "dbName", + "mysqlName" + ], + "properties": { + "dbName": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.BackupOperate": { + "type": "object", + "required": [ + "type", + "vars" + ], + "properties": { + "accessKey": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "credential": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "vars": { + "type": "string" + } + } + }, + "dto.BatchDelete": { + "type": "object", + "required": [ + "names" + ], + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dto.BatchDeleteReq": { + "type": "object", + "required": [ + "ids" + ], + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.ChangeDBInfo": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "id": { + "type": "integer" + }, + "value": { + "type": "string" + } + } + }, + "dto.CommandInfo": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "dto.CommandOperate": { + "type": "object", + "required": [ + "command", + "name" + ], + "properties": { + "command": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + } + }, + "dto.ComposeCreate": { + "type": "object", + "required": [ + "from", + "name" + ], + "properties": { + "file": { + "type": "string" + }, + "from": { + "type": "string", + "enum": [ + "edit", + "path", + "template" + ] + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "template": { + "type": "integer" + } + } + }, + "dto.ComposeOperation": { + "type": "object", + "required": [ + "name", + "operation", + "path" + ], + "properties": { + "name": { + "type": "string" + }, + "operation": { + "type": "string", + "enum": [ + "start", + "stop", + "down" + ] + }, + "path": { + "type": "string" + } + } + }, + "dto.ComposeTemplateCreate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "dto.ComposeTemplateUpdate": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + } + } + }, + "dto.ComposeUpdate": { + "type": "object", + "required": [ + "content", + "name", + "path" + ], + "properties": { + "content": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "dto.ContainerCreate": { + "type": "object", + "properties": { + "autoRemove": { + "type": "boolean" + }, + "cmd": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": "array", + "items": { + "type": "string" + } + }, + "exposedPorts": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.PortHelper" + } + }, + "image": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "memory": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "nanoCPUs": { + "type": "integer" + }, + "publishAllPorts": { + "type": "boolean" + }, + "restartPolicy": { + "type": "string" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.VolumeHelper" + } + } + } + }, + "dto.ContainerLog": { + "type": "object", + "required": [ + "containerID", + "mode" + ], + "properties": { + "containerID": { + "type": "string" + }, + "mode": { + "type": "string" + } + } + }, + "dto.ContainerOperation": { + "type": "object", + "required": [ + "name", + "operation" + ], + "properties": { + "name": { + "type": "string" + }, + "newName": { + "type": "string" + }, + "operation": { + "type": "string", + "enum": [ + "start", + "stop", + "restart", + "kill", + "pause", + "unpause", + "rename", + "remove" + ] + } + } + }, + "dto.ContainterStats": { + "type": "object", + "properties": { + "cache": { + "type": "number" + }, + "cpuPercent": { + "type": "number" + }, + "ioRead": { + "type": "number" + }, + "ioWrite": { + "type": "number" + }, + "memory": { + "type": "number" + }, + "networkRX": { + "type": "number" + }, + "networkTX": { + "type": "number" + }, + "shotTime": { + "type": "string" + } + } + }, + "dto.CronjobCreate": { + "type": "object", + "required": [ + "name", + "specType", + "type" + ], + "properties": { + "day": { + "type": "integer", + "maximum": 31, + "minimum": 1 + }, + "dbName": { + "type": "string" + }, + "exclusionRules": { + "type": "string" + }, + "hour": { + "type": "integer", + "maximum": 23, + "minimum": 0 + }, + "keepLocal": { + "type": "boolean" + }, + "minute": { + "type": "integer", + "maximum": 59, + "minimum": 0 + }, + "name": { + "type": "string" + }, + "retainCopies": { + "type": "integer", + "minimum": 1 + }, + "script": { + "type": "string" + }, + "sourceDir": { + "type": "string" + }, + "specType": { + "type": "string" + }, + "targetDirID": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "website": { + "type": "string" + }, + "week": { + "type": "integer", + "maximum": 7, + "minimum": 1 + } + } + }, + "dto.CronjobDownload": { + "type": "object", + "required": [ + "backupAccountID", + "recordID" + ], + "properties": { + "backupAccountID": { + "type": "integer" + }, + "recordID": { + "type": "integer" + } + } + }, + "dto.CronjobUpdate": { + "type": "object", + "required": [ + "id", + "name", + "specType" + ], + "properties": { + "day": { + "type": "integer", + "maximum": 31, + "minimum": 1 + }, + "dbName": { + "type": "string" + }, + "exclusionRules": { + "type": "string" + }, + "hour": { + "type": "integer", + "maximum": 23, + "minimum": 0 + }, + "id": { + "type": "integer" + }, + "keepLocal": { + "type": "boolean" + }, + "minute": { + "type": "integer", + "maximum": 59, + "minimum": 0 + }, + "name": { + "type": "string" + }, + "retainCopies": { + "type": "integer", + "minimum": 1 + }, + "script": { + "type": "string" + }, + "sourceDir": { + "type": "string" + }, + "specType": { + "type": "string" + }, + "targetDirID": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "website": { + "type": "string" + }, + "week": { + "type": "integer", + "maximum": 7, + "minimum": 1 + } + } + }, + "dto.CronjobUpdateStatus": { + "type": "object", + "required": [ + "id", + "status" + ], + "properties": { + "id": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + }, + "dto.DBBaseInfo": { + "type": "object", + "properties": { + "containerName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "port": { + "type": "integer" + } + } + }, + "dto.DaemonJsonConf": { + "type": "object", + "properties": { + "cgroupDriver": { + "type": "string" + }, + "insecureRegistries": { + "type": "array", + "items": { + "type": "string" + } + }, + "liveRestore": { + "type": "boolean" + }, + "registryMirrors": { + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "type": "string" + } + } + }, + "dto.DaemonJsonUpdateByFile": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "file": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "dto.DockerOperation": { + "type": "object", + "required": [ + "operation" + ], + "properties": { + "operation": { + "type": "string", + "enum": [ + "start", + "restart", + "stop" + ] + } + } + }, + "dto.DownloadRecord": { + "type": "object", + "required": [ + "fileDir", + "fileName", + "source" + ], + "properties": { + "fileDir": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "source": { + "type": "string", + "enum": [ + "OSS", + "S3", + "SFTP", + "MINIO", + "LOCAL" + ] + } + } + }, + "dto.ForBuckets": { + "type": "object", + "required": [ + "credential", + "type", + "vars" + ], + "properties": { + "accessKey": { + "type": "string" + }, + "credential": { + "type": "string" + }, + "type": { + "type": "string" + }, + "vars": { + "type": "string" + } + } + }, + "dto.ImageBuild": { + "type": "object", + "required": [ + "dockerfile", + "from", + "name" + ], + "properties": { + "dockerfile": { + "type": "string" + }, + "from": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dto.ImageLoad": { + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "type": "string" + } + } + }, + "dto.ImagePull": { + "type": "object", + "required": [ + "imageName" + ], + "properties": { + "imageName": { + "type": "string" + }, + "repoID": { + "type": "integer" + } + } + }, + "dto.ImagePush": { + "type": "object", + "required": [ + "name", + "repoID", + "tagName" + ], + "properties": { + "name": { + "type": "string" + }, + "repoID": { + "type": "integer" + }, + "tagName": { + "type": "string" + } + } + }, + "dto.ImageRepoCreate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "auth": { + "type": "boolean" + }, + "downloadUrl": { + "type": "string" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "dto.ImageRepoDelete": { + "type": "object", + "required": [ + "ids" + ], + "properties": { + "deleteInsecure": { + "type": "boolean" + }, + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.ImageRepoUpdate": { + "type": "object", + "properties": { + "auth": { + "type": "boolean" + }, + "downloadUrl": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "password": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "dto.ImageSave": { + "type": "object", + "required": [ + "name", + "path", + "tagName" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "tagName": { + "type": "string" + } + } + }, + "dto.ImageTag": { + "type": "object", + "required": [ + "sourceID", + "targetName" + ], + "properties": { + "repoID": { + "type": "integer" + }, + "sourceID": { + "type": "string" + }, + "targetName": { + "type": "string" + } + } + }, + "dto.InspectReq": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "dto.MysqlConfUpdateByFile": { + "type": "object", + "required": [ + "mysqlName" + ], + "properties": { + "file": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.MysqlDBCreate": { + "type": "object", + "required": [ + "format", + "name", + "password", + "permission", + "username" + ], + "properties": { + "description": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "utf8mb4", + "utf8", + "gbk", + "big5" + ] + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "permission": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "dto.MysqlDBDelete": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "deleteBackup": { + "type": "boolean" + }, + "forceDelete": { + "type": "boolean" + }, + "id": { + "type": "integer" + } + } + }, + "dto.MysqlDescription": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "integer" + } + } + }, + "dto.MysqlStatus": { + "type": "object", + "properties": { + "Aborted_clients": { + "type": "string" + }, + "Aborted_connects": { + "type": "string" + }, + "Bytes_received": { + "type": "string" + }, + "Bytes_sent": { + "type": "string" + }, + "Com_commit": { + "type": "string" + }, + "Com_rollback": { + "type": "string" + }, + "Connections": { + "type": "string" + }, + "Created_tmp_disk_tables": { + "type": "string" + }, + "Created_tmp_tables": { + "type": "string" + }, + "File": { + "type": "string" + }, + "Innodb_buffer_pool_pages_dirty": { + "type": "string" + }, + "Innodb_buffer_pool_read_requests": { + "type": "string" + }, + "Innodb_buffer_pool_reads": { + "type": "string" + }, + "Key_read_requests": { + "type": "string" + }, + "Key_reads": { + "type": "string" + }, + "Key_write_requests": { + "type": "string" + }, + "Key_writes": { + "type": "string" + }, + "Max_used_connections": { + "type": "string" + }, + "Open_tables": { + "type": "string" + }, + "Opened_files": { + "type": "string" + }, + "Opened_tables": { + "type": "string" + }, + "Position": { + "type": "string" + }, + "Qcache_hits": { + "type": "string" + }, + "Qcache_inserts": { + "type": "string" + }, + "Questions": { + "type": "string" + }, + "Run": { + "type": "string" + }, + "Select_full_join": { + "type": "string" + }, + "Select_range_check": { + "type": "string" + }, + "Sort_merge_passes": { + "type": "string" + }, + "Table_locks_waited": { + "type": "string" + }, + "Threads_cached": { + "type": "string" + }, + "Threads_connected": { + "type": "string" + }, + "Threads_created": { + "type": "string" + }, + "Threads_running": { + "type": "string" + }, + "Uptime": { + "type": "string" + } + } + }, + "dto.MysqlVariables": { + "type": "object", + "properties": { + "binlog_cache_size": { + "type": "string" + }, + "innodb_buffer_pool_size": { + "type": "string" + }, + "innodb_log_buffer_size": { + "type": "string" + }, + "join_buffer_size": { + "type": "string" + }, + "key_buffer_size": { + "type": "string" + }, + "long_query_time": { + "type": "string" + }, + "max_connections": { + "type": "string" + }, + "max_heap_table_size": { + "type": "string" + }, + "query_cache_size": { + "type": "string" + }, + "query_cache_type": { + "type": "string" + }, + "read_buffer_size": { + "type": "string" + }, + "read_rnd_buffer_size": { + "type": "string" + }, + "slow_query_log": { + "type": "string" + }, + "sort_buffer_size": { + "type": "string" + }, + "table_open_cache": { + "type": "string" + }, + "thread_cache_size": { + "type": "string" + }, + "thread_stack": { + "type": "string" + }, + "tmp_table_size": { + "type": "string" + } + } + }, + "dto.MysqlVariablesUpdate": { + "type": "object", + "properties": { + "param": { + "type": "string" + }, + "value": {} + } + }, + "dto.NetworkCreat": { + "type": "object", + "properties": { + "driver": { + "type": "string" + }, + "gateway": { + "type": "string" + }, + "ipRange": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "string" + } + }, + "subnet": { + "type": "string" + } + } + }, + "dto.OperateByID": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + } + } + }, + "dto.PageContainer": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "filters": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } + }, + "dto.PageInfo": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } + }, + "dto.PageResult": { + "type": "object", + "properties": { + "items": {}, + "total": { + "type": "integer" + } + } + }, + "dto.PortHelper": { + "type": "object", + "properties": { + "containerPort": { + "type": "integer" + }, + "hostPort": { + "type": "integer" + } + } + }, + "dto.RecordSearch": { + "type": "object", + "required": [ + "name", + "page", + "pageSize", + "type" + ], + "properties": { + "detailName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "dto.RecoverDB": { + "type": "object", + "required": [ + "backupName", + "dbName", + "mysqlName" + ], + "properties": { + "backupName": { + "type": "string" + }, + "dbName": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.RedisConf": { + "type": "object", + "properties": { + "containerName": { + "type": "string" + }, + "maxclients": { + "type": "string" + }, + "maxmemory": { + "type": "string" + }, + "name": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "requirepass": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } + }, + "dto.RedisConfPersistenceUpdate": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "appendfsync": { + "type": "string" + }, + "appendonly": { + "type": "string" + }, + "save": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "aof", + "rbd" + ] + } + } + }, + "dto.RedisConfUpdate": { + "type": "object", + "properties": { + "maxclients": { + "type": "string" + }, + "maxmemory": { + "type": "string" + }, + "timeout": { + "type": "string" + } + } + }, + "dto.RedisConfUpdateByFile": { + "type": "object", + "properties": { + "file": { + "type": "string" + }, + "restartNow": { + "type": "boolean" + } + } + }, + "dto.RedisPersistence": { + "type": "object", + "properties": { + "appendfsync": { + "type": "string" + }, + "appendonly": { + "type": "string" + }, + "save": { + "type": "string" + } + } + }, + "dto.RedisStatus": { + "type": "object", + "properties": { + "connected_clients": { + "type": "string" + }, + "instantaneous_ops_per_sec": { + "type": "string" + }, + "keyspace_hits": { + "type": "string" + }, + "keyspace_misses": { + "type": "string" + }, + "latest_fork_usec": { + "type": "string" + }, + "mem_fragmentation_ratio": { + "type": "string" + }, + "tcp_port": { + "type": "string" + }, + "total_commands_processed": { + "type": "string" + }, + "total_connections_received": { + "type": "string" + }, + "uptime_in_days": { + "type": "string" + }, + "used_memory": { + "type": "string" + }, + "used_memory_peak": { + "type": "string" + }, + "used_memory_rss": { + "type": "string" + } + } + }, + "dto.SearchRecord": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "cronjobID": { + "type": "integer" + }, + "endTime": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "startTime": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "dto.SearchWithPage": { + "type": "object", + "required": [ + "info", + "page", + "pageSize" + ], + "properties": { + "info": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } + }, + "dto.UploadRecover": { + "type": "object", + "required": [ + "dbName", + "mysqlName" + ], + "properties": { + "dbName": { + "type": "string" + }, + "fileDir": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "mysqlName": { + "type": "string" + } + } + }, + "dto.VolumeCreat": { + "type": "object", + "properties": { + "driver": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "dto.VolumeHelper": { + "type": "object", + "properties": { + "containerDir": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "sourceDir": { + "type": "string" + } + } + }, + "request.AppInstalledSearch": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "name": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "request.AppSearch": { + "type": "object", + "required": [ + "page", + "pageSize" + ], + "properties": { + "name": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + } + } + } + } } \ No newline at end of file diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index 6e10747e0..1bd2ab316 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -1,4 +1,1010 @@ basePath: /api/v1 +definitions: + dto.BackupDB: + properties: + dbName: + type: string + mysqlName: + type: string + required: + - dbName + - mysqlName + type: object + dto.BackupOperate: + properties: + accessKey: + type: string + bucket: + type: string + credential: + type: string + id: + type: integer + type: + type: string + vars: + type: string + required: + - type + - vars + type: object + dto.BatchDelete: + properties: + names: + items: + type: string + type: array + required: + - names + type: object + dto.BatchDeleteReq: + properties: + ids: + items: + type: integer + type: array + required: + - ids + type: object + dto.ChangeDBInfo: + properties: + id: + type: integer + value: + type: string + required: + - value + type: object + dto.CommandInfo: + properties: + command: + type: string + id: + type: integer + name: + type: string + type: object + dto.CommandOperate: + properties: + command: + type: string + id: + type: integer + name: + type: string + required: + - command + - name + type: object + dto.ComposeCreate: + properties: + file: + type: string + from: + enum: + - edit + - path + - template + type: string + name: + type: string + path: + type: string + template: + type: integer + required: + - from + - name + type: object + dto.ComposeOperation: + properties: + name: + type: string + operation: + enum: + - start + - stop + - down + type: string + path: + type: string + required: + - name + - operation + - path + type: object + dto.ComposeTemplateCreate: + properties: + content: + type: string + description: + type: string + name: + type: string + required: + - name + type: object + dto.ComposeTemplateUpdate: + properties: + content: + type: string + description: + type: string + id: + type: integer + type: object + dto.ComposeUpdate: + properties: + content: + type: string + name: + type: string + path: + type: string + required: + - content + - name + - path + type: object + dto.ContainerCreate: + properties: + autoRemove: + type: boolean + cmd: + items: + type: string + type: array + env: + items: + type: string + type: array + exposedPorts: + items: + $ref: '#/definitions/dto.PortHelper' + type: array + image: + type: string + labels: + items: + type: string + type: array + memory: + type: integer + name: + type: string + nanoCPUs: + type: integer + publishAllPorts: + type: boolean + restartPolicy: + type: string + volumes: + items: + $ref: '#/definitions/dto.VolumeHelper' + type: array + type: object + dto.ContainerLog: + properties: + containerID: + type: string + mode: + type: string + required: + - containerID + - mode + type: object + dto.ContainerOperation: + properties: + name: + type: string + newName: + type: string + operation: + enum: + - start + - stop + - restart + - kill + - pause + - unpause + - rename + - remove + type: string + required: + - name + - operation + type: object + dto.ContainterStats: + properties: + cache: + type: number + cpuPercent: + type: number + ioRead: + type: number + ioWrite: + type: number + memory: + type: number + networkRX: + type: number + networkTX: + type: number + shotTime: + type: string + type: object + dto.CronjobCreate: + properties: + day: + maximum: 31 + minimum: 1 + type: integer + dbName: + type: string + exclusionRules: + type: string + hour: + maximum: 23 + minimum: 0 + type: integer + keepLocal: + type: boolean + minute: + maximum: 59 + minimum: 0 + type: integer + name: + type: string + retainCopies: + minimum: 1 + type: integer + script: + type: string + sourceDir: + type: string + specType: + type: string + targetDirID: + type: integer + type: + type: string + url: + type: string + website: + type: string + week: + maximum: 7 + minimum: 1 + type: integer + required: + - name + - specType + - type + type: object + dto.CronjobDownload: + properties: + backupAccountID: + type: integer + recordID: + type: integer + required: + - backupAccountID + - recordID + type: object + dto.CronjobUpdate: + properties: + day: + maximum: 31 + minimum: 1 + type: integer + dbName: + type: string + exclusionRules: + type: string + hour: + maximum: 23 + minimum: 0 + type: integer + id: + type: integer + keepLocal: + type: boolean + minute: + maximum: 59 + minimum: 0 + type: integer + name: + type: string + retainCopies: + minimum: 1 + type: integer + script: + type: string + sourceDir: + type: string + specType: + type: string + targetDirID: + type: integer + url: + type: string + website: + type: string + week: + maximum: 7 + minimum: 1 + type: integer + required: + - id + - name + - specType + type: object + dto.CronjobUpdateStatus: + properties: + id: + type: integer + status: + type: string + required: + - id + - status + type: object + dto.DBBaseInfo: + properties: + containerName: + type: string + name: + type: string + port: + type: integer + type: object + dto.DaemonJsonConf: + properties: + cgroupDriver: + type: string + insecureRegistries: + items: + type: string + type: array + liveRestore: + type: boolean + registryMirrors: + items: + type: string + type: array + status: + type: string + type: object + dto.DaemonJsonUpdateByFile: + properties: + file: + type: string + path: + type: string + required: + - path + type: object + dto.DockerOperation: + properties: + operation: + enum: + - start + - restart + - stop + type: string + required: + - operation + type: object + dto.DownloadRecord: + properties: + fileDir: + type: string + fileName: + type: string + source: + enum: + - OSS + - S3 + - SFTP + - MINIO + - LOCAL + type: string + required: + - fileDir + - fileName + - source + type: object + dto.ForBuckets: + properties: + accessKey: + type: string + credential: + type: string + type: + type: string + vars: + type: string + required: + - credential + - type + - vars + type: object + dto.ImageBuild: + properties: + dockerfile: + type: string + from: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - dockerfile + - from + - name + type: object + dto.ImageLoad: + properties: + path: + type: string + required: + - path + type: object + dto.ImagePull: + properties: + imageName: + type: string + repoID: + type: integer + required: + - imageName + type: object + dto.ImagePush: + properties: + name: + type: string + repoID: + type: integer + tagName: + type: string + required: + - name + - repoID + - tagName + type: object + dto.ImageRepoCreate: + properties: + auth: + type: boolean + downloadUrl: + type: string + name: + type: string + password: + type: string + protocol: + type: string + username: + type: string + required: + - name + type: object + dto.ImageRepoDelete: + properties: + deleteInsecure: + type: boolean + ids: + items: + type: integer + type: array + required: + - ids + type: object + dto.ImageRepoUpdate: + properties: + auth: + type: boolean + downloadUrl: + type: string + id: + type: integer + password: + type: string + protocol: + type: string + username: + type: string + type: object + dto.ImageSave: + properties: + name: + type: string + path: + type: string + tagName: + type: string + required: + - name + - path + - tagName + type: object + dto.ImageTag: + properties: + repoID: + type: integer + sourceID: + type: string + targetName: + type: string + required: + - sourceID + - targetName + type: object + dto.InspectReq: + properties: + id: + type: string + type: + type: string + type: object + dto.MysqlConfUpdateByFile: + properties: + file: + type: string + mysqlName: + type: string + required: + - mysqlName + type: object + dto.MysqlDBCreate: + properties: + description: + type: string + format: + enum: + - utf8mb4 + - utf8 + - gbk + - big5 + type: string + name: + type: string + password: + type: string + permission: + type: string + username: + type: string + required: + - format + - name + - password + - permission + - username + type: object + dto.MysqlDBDelete: + properties: + deleteBackup: + type: boolean + forceDelete: + type: boolean + id: + type: integer + required: + - id + type: object + dto.MysqlDescription: + properties: + description: + type: string + id: + type: integer + required: + - id + type: object + dto.MysqlStatus: + properties: + Aborted_clients: + type: string + Aborted_connects: + type: string + Bytes_received: + type: string + Bytes_sent: + type: string + Com_commit: + type: string + Com_rollback: + type: string + Connections: + type: string + Created_tmp_disk_tables: + type: string + Created_tmp_tables: + type: string + File: + type: string + Innodb_buffer_pool_pages_dirty: + type: string + Innodb_buffer_pool_read_requests: + type: string + Innodb_buffer_pool_reads: + type: string + Key_read_requests: + type: string + Key_reads: + type: string + Key_write_requests: + type: string + Key_writes: + type: string + Max_used_connections: + type: string + Open_tables: + type: string + Opened_files: + type: string + Opened_tables: + type: string + Position: + type: string + Qcache_hits: + type: string + Qcache_inserts: + type: string + Questions: + type: string + Run: + type: string + Select_full_join: + type: string + Select_range_check: + type: string + Sort_merge_passes: + type: string + Table_locks_waited: + type: string + Threads_cached: + type: string + Threads_connected: + type: string + Threads_created: + type: string + Threads_running: + type: string + Uptime: + type: string + type: object + dto.MysqlVariables: + properties: + binlog_cache_size: + type: string + innodb_buffer_pool_size: + type: string + innodb_log_buffer_size: + type: string + join_buffer_size: + type: string + key_buffer_size: + type: string + long_query_time: + type: string + max_connections: + type: string + max_heap_table_size: + type: string + query_cache_size: + type: string + query_cache_type: + type: string + read_buffer_size: + type: string + read_rnd_buffer_size: + type: string + slow_query_log: + type: string + sort_buffer_size: + type: string + table_open_cache: + type: string + thread_cache_size: + type: string + thread_stack: + type: string + tmp_table_size: + type: string + type: object + dto.MysqlVariablesUpdate: + properties: + param: + type: string + value: {} + type: object + dto.NetworkCreat: + properties: + driver: + type: string + gateway: + type: string + ipRange: + type: string + labels: + items: + type: string + type: array + name: + type: string + options: + items: + type: string + type: array + subnet: + type: string + type: object + dto.OperateByID: + properties: + id: + type: integer + required: + - id + type: object + dto.PageContainer: + properties: + filters: + type: string + page: + type: integer + pageSize: + type: integer + required: + - page + - pageSize + type: object + dto.PageInfo: + properties: + page: + type: integer + pageSize: + type: integer + required: + - page + - pageSize + type: object + dto.PageResult: + properties: + items: {} + total: + type: integer + type: object + dto.PortHelper: + properties: + containerPort: + type: integer + hostPort: + type: integer + type: object + dto.RecordSearch: + properties: + detailName: + type: string + name: + type: string + page: + type: integer + pageSize: + type: integer + type: + type: string + required: + - name + - page + - pageSize + - type + type: object + dto.RecoverDB: + properties: + backupName: + type: string + dbName: + type: string + mysqlName: + type: string + required: + - backupName + - dbName + - mysqlName + type: object + dto.RedisConf: + properties: + containerName: + type: string + maxclients: + type: string + maxmemory: + type: string + name: + type: string + port: + type: integer + requirepass: + type: string + timeout: + type: string + type: object + dto.RedisConfPersistenceUpdate: + properties: + appendfsync: + type: string + appendonly: + type: string + save: + type: string + type: + enum: + - aof + - rbd + type: string + required: + - type + type: object + dto.RedisConfUpdate: + properties: + maxclients: + type: string + maxmemory: + type: string + timeout: + type: string + type: object + dto.RedisConfUpdateByFile: + properties: + file: + type: string + restartNow: + type: boolean + type: object + dto.RedisPersistence: + properties: + appendfsync: + type: string + appendonly: + type: string + save: + type: string + type: object + dto.RedisStatus: + properties: + connected_clients: + type: string + instantaneous_ops_per_sec: + type: string + keyspace_hits: + type: string + keyspace_misses: + type: string + latest_fork_usec: + type: string + mem_fragmentation_ratio: + type: string + tcp_port: + type: string + total_commands_processed: + type: string + total_connections_received: + type: string + uptime_in_days: + type: string + used_memory: + type: string + used_memory_peak: + type: string + used_memory_rss: + type: string + type: object + dto.SearchRecord: + properties: + cronjobID: + type: integer + endTime: + type: string + page: + type: integer + pageSize: + type: integer + startTime: + type: string + status: + type: string + required: + - page + - pageSize + type: object + dto.SearchWithPage: + properties: + info: + type: string + page: + type: integer + pageSize: + type: integer + required: + - info + - page + - pageSize + type: object + dto.UploadRecover: + properties: + dbName: + type: string + fileDir: + type: string + fileName: + type: string + mysqlName: + type: string + required: + - dbName + - mysqlName + type: object + dto.VolumeCreat: + properties: + driver: + type: string + labels: + items: + type: string + type: array + name: + type: string + options: + items: + type: string + type: array + type: object + dto.VolumeHelper: + properties: + containerDir: + type: string + mode: + type: string + sourceDir: + type: string + type: object + request.AppInstalledSearch: + properties: + name: + type: string + page: + type: integer + pageSize: + type: integer + type: + type: string + required: + - page + - pageSize + type: object + request.AppSearch: + properties: + name: + type: string + page: + type: integer + pageSize: + type: integer + tags: + items: + type: string + type: array + type: + type: string + required: + - page + - pageSize + type: object host: localhost info: contact: {} @@ -9,5 +1015,2259 @@ info: termsOfService: http://swagger.io/terms/ title: 1Panel version: "1.0" -paths: {} +paths: + /apps/installed: + post: + consumes: + - application/json + description: 获取已安装应用列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.AppInstalledSearch' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Search app list installed + tags: + - App + /apps/search: + post: + consumes: + - application/json + description: 获取应用列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.AppSearch' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Search app list + tags: + - App + /backups: + post: + consumes: + - application/json + description: 创建备份账号 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BackupOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create backup account + tags: + - Backup Account + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - type + formatEN: create backup account [type] + formatZH: 创建备份账号 [type] + paramKeys: [] + /backups/del: + post: + consumes: + - application/json + description: 删除备份账号 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete backup account + tags: + - Backup Account + x-panel-log: + BeforeFuntions: + - db: backup_accounts + input_colume: id + input_value: ids + isList: true + output_colume: type + output_value: types + bodyKeys: + - ids + formatEN: delete backup account [types] + formatZH: 删除备份账号 [types] + paramKeys: [] + /backups/record/del: + post: + consumes: + - application/json + description: 删除备份记录 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete backup record + tags: + - Backup Account + x-panel-log: + BeforeFuntions: + - db: backup_records + input_colume: id + input_value: ids + isList: true + output_colume: file_name + output_value: files + bodyKeys: + - ids + formatEN: delete backup records [files] + formatZH: 删除备份记录 [files] + paramKeys: [] + /backups/record/download: + post: + consumes: + - application/json + description: 下载备份记录 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.DownloadRecord' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Download backup record + tags: + - Backup Account + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - source + - fileName + formatEN: download backup records [source][fileName] + formatZH: 下载备份记录 [source][fileName] + paramKeys: [] + /backups/record/search: + post: + consumes: + - application/json + description: 获取备份记录列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.RecordSearch' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Search backup records with page + tags: + - Backup Account + /backups/search: + post: + consumes: + - application/json + description: 获取 bucket 列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ForBuckets' + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: List bucket + tags: + - Backup Account + /backups/update: + get: + description: 获取备份账号列表 + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: Search backup account + tags: + - Backup Account + post: + consumes: + - application/json + description: 更新备份账号信息 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BackupOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update backup account + tags: + - Backup Account + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - type + formatEN: update backup account [types] + formatZH: 更新备份账号 [types] + paramKeys: [] + /commands: + get: + description: 获取快速命令列表 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.CommandInfo' + security: + - ApiKeyAuth: [] + summary: Search command + tags: + - Command + post: + consumes: + - application/json + description: 获取快速命令列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SearchWithPage' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search command with page + tags: + - Command + /commands/del: + post: + consumes: + - application/json + description: 删除快速命令 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete command + tags: + - Command + x-panel-log: + BeforeFuntions: + - db: commands + input_colume: id + input_value: ids + isList: true + output_colume: name + output_value: names + bodyKeys: + - ids + formatEN: delete quick command [names] + formatZH: 删除快捷命令 [names] + paramKeys: [] + /commands/update: + post: + consumes: + - application/json + description: 更新快速命令 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CommandOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update command + tags: + - Command + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: update quick command [name] + formatZH: 更新快捷命令 [name] + paramKeys: [] + /containers: + post: + consumes: + - application/json + description: 创建容器 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ContainerCreate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create container + tags: + - Container + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + - image + formatEN: create container [name][image] + formatZH: 创建容器 [name][image] + paramKeys: [] + /containers/compose: + post: + consumes: + - application/json + description: 创建容器编排 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ComposeCreate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create compose + tags: + - Container Compose + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: create compose [name] + formatZH: 创建 compose [name] + paramKeys: [] + /containers/compose/operate: + post: + consumes: + - application/json + description: 容器编排操作 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ComposeOperation' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Operate compose + tags: + - Container Compose + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + - operation + formatEN: compose [operation] [name] + formatZH: compose [operation] [name] + paramKeys: [] + /containers/compose/search: + post: + consumes: + - application/json + description: 获取编排列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search compose list with page + tags: + - Container Compose + /containers/compose/update: + post: + consumes: + - application/json + description: 更新容器编排 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ComposeUpdate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update compose + tags: + - Container Compose + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: update compose information [name] + formatZH: 更新 compose [name] + paramKeys: [] + /containers/daemonjson: + get: + description: 获取 docker 配置信息 + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.DaemonJsonConf' + security: + - ApiKeyAuth: [] + summary: Load docker daemon.json + tags: + - Container Docker + /containers/daemonjson/update: + post: + consumes: + - application/json + description: 修改 docker 配置信息 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.DaemonJsonConf' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update docker daemon.json + tags: + - Container Docker + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: Updated the docker daemon.json configuration + formatZH: 更新 docker daemon.json 配置 + paramKeys: [] + /containers/daemonjson/update/byfile: + post: + consumes: + - application/json + description: 上传替换 docker 配置文件 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.DaemonJsonUpdateByFile' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update docker daemon.json by upload file + tags: + - Container Docker + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: Updated the docker daemon.json configuration + formatZH: 更新 docker daemon.json 配置 + paramKeys: [] + /containers/docker/operate: + post: + consumes: + - application/json + description: Docker 操作 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.DockerOperation' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Operate docker + tags: + - Container Docker + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - operation + formatEN: '[operation] docker service' + formatZH: docker 服务 [operation] + paramKeys: [] + /containers/docker/status: + get: + description: 获取 docker 服务状态 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Load docker status + tags: + - Container Docker + /containers/image: + get: + description: 获取镜像列表 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: Search image list + tags: + - Container Image + /containers/image/build: + post: + consumes: + - application/json + description: 构建镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageBuild' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Build image + tags: + - Container Image + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: build image [name] + formatZH: 构建镜像 [name] + paramKeys: [] + /containers/image/load: + post: + consumes: + - application/json + description: 导入镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageLoad' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Load image + tags: + - Container Image + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - path + formatEN: load image from [path] + formatZH: 从 [path] 加载镜像 + paramKeys: [] + /containers/image/pull: + post: + consumes: + - application/json + description: 拉取镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImagePull' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Pull image + tags: + - Container Image + x-panel-log: + BeforeFuntions: + - db: image_repos + input_colume: id + input_value: repoID + isList: false + output_colume: name + output_value: reponame + bodyKeys: + - repoID + - imageName + formatEN: image pull [reponame][imageName] + formatZH: 镜像拉取 [reponame][imageName] + paramKeys: [] + /containers/image/push: + post: + consumes: + - application/json + description: 推送镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImagePush' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Push image + tags: + - Container Image + x-panel-log: + BeforeFuntions: + - db: image_repos + input_colume: id + input_value: repoID + isList: false + output_colume: name + output_value: reponame + bodyKeys: + - repoID + - tagName + - name + formatEN: push [tagName] to [reponame][name] + formatZH: '[tagName] 推送到 [reponame][name]' + paramKeys: [] + /containers/image/remove: + post: + consumes: + - application/json + description: 删除镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDelete' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete image + tags: + - Container Image + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - names + formatEN: remove image [names] + formatZH: 移除镜像 [names] + paramKeys: [] + /containers/image/save: + post: + consumes: + - application/json + description: 导出镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageSave' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Save image + tags: + - Container Image + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - tagName + - path + - name + formatEN: save [tagName] as [path]/[name] + formatZH: 保留 [tagName] 为 [path]/[name] + paramKeys: [] + /containers/image/search: + post: + consumes: + - application/json + description: 获取镜像列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search image list with page + tags: + - Container Image + /containers/image/tag: + post: + consumes: + - application/json + description: Tag 镜像 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageTag' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Tag image + tags: + - Container Image + x-panel-log: + BeforeFuntions: + - db: image_repos + input_colume: id + input_value: repoID + isList: false + output_colume: name + output_value: reponame + bodyKeys: + - repoID + - targetName + formatEN: tag image [reponame][targetName] + formatZH: tag 镜像 [reponame][targetName] + paramKeys: [] + /containers/inspect: + post: + consumes: + - application/json + description: 容器详情 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.InspectReq' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Container inspect + tags: + - Container + /containers/network: + post: + consumes: + - application/json + description: 创建容器网络 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.NetworkCreat' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create network + tags: + - Container Network + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: create container network [name] + formatZH: 创建容器网络 name + paramKeys: [] + /containers/network/del: + post: + consumes: + - application/json + description: 删除容器网络 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDelete' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete network + tags: + - Container Network + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - names + formatEN: delete container network [names] + formatZH: 删除容器网络 [names] + paramKeys: [] + /containers/network/search: + post: + consumes: + - application/json + description: 获取容器网络列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search network list with page + tags: + - Container Network + /containers/operate: + post: + consumes: + - application/json + description: 容器操作 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ContainerOperation' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Operate Container + tags: + - Container + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + - operation + - newName + formatEN: container [operation] [name] [newName] + formatZH: 容器 [name] 执行 [operation] [newName] + paramKeys: [] + /containers/repo: + get: + description: 获取镜像仓库列表 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: Search image repo list + tags: + - Container Image-repo + post: + consumes: + - application/json + description: 创建镜像仓库 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageRepoCreate' + produces: + - application/json + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create image repo + tags: + - Container Image-repo + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: create image repo [name] + formatZH: 创建镜像仓库 [name] + paramKeys: [] + /containers/repo/del: + post: + consumes: + - application/json + description: 删除镜像仓库 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageRepoDelete' + produces: + - application/json + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete image repo + tags: + - Container Image-repo + x-panel-log: + BeforeFuntions: + - db: image_repos + input_colume: id + input_value: ids + isList: true + output_colume: name + output_value: names + bodyKeys: + - ids + formatEN: delete image repo [names] + formatZH: 删除镜像仓库 [names] + paramKeys: [] + /containers/repo/search: + post: + consumes: + - application/json + description: 获取镜像仓库列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search image repo list with page + tags: + - Container Image-repo + /containers/repo/update: + post: + consumes: + - application/json + description: 更新镜像仓库 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ImageRepoUpdate' + produces: + - application/json + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update image repo + tags: + - Container Image-repo + x-panel-log: + BeforeFuntions: + - db: image_repos + input_column: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: update image repo information [name] + formatZH: 更新镜像仓库 [name] + paramKeys: [] + /containers/search: + post: + consumes: + - application/json + description: 获取容器列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageContainer' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search container list with page + tags: + - Container + /containers/search/log: + post: + consumes: + - application/json + description: 容器日志 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ContainerLog' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Container logs + tags: + - Container + /containers/stats/:id: + get: + description: 容器监控信息 + parameters: + - description: 容器id + in: path + name: id + required: true + type: integer + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.ContainterStats' + security: + - ApiKeyAuth: [] + summary: Container stats + tags: + - Container + /containers/template: + get: + description: 获取容器编排模版列表 + produces: + - application/json + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: Search compose template list + tags: + - Container Compose-template + post: + consumes: + - application/json + description: 创建容器编排模版 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ComposeTemplateCreate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create Compose template + tags: + - Container Compose-template + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: create compose template [name] + formatZH: 创建 compose 模版 [name] + paramKeys: [] + /containers/template/del: + post: + consumes: + - application/json + description: 删除容器编排模版 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDelete' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete compose template + tags: + - Container Compose-template + x-panel-log: + BeforeFuntions: + - db: compose_templates + input_colume: id + input_value: ids + isList: true + output_colume: name + output_value: names + bodyKeys: + - ids + formatEN: delete compose template [names] + formatZH: 删除 compose 模版 [names] + paramKeys: [] + /containers/template/search: + post: + consumes: + - application/json + description: 获取容器编排模版列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search compose template list with page + tags: + - Container Compose-template + /containers/template/update: + post: + consumes: + - application/json + description: 更新容器编排模版 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ComposeTemplateUpdate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update compose template + tags: + - Container Compose-template + x-panel-log: + BeforeFuntions: + - db: compose_templates + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: update compose template information [name] + formatZH: 更新 compose 模版 [name] + paramKeys: [] + /containers/volume: + post: + consumes: + - application/json + description: 创建容器存储卷 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.VolumeCreat' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create volume + tags: + - Container Volume + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: create container volume [name] + formatZH: 创建容器存储卷 [name] + paramKeys: [] + /containers/volume/del: + post: + consumes: + - application/json + description: 删除容器存储卷 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDelete' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete volume + tags: + - Container Volume + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - names + formatEN: delete container volume [names] + formatZH: 删除容器存储卷 [names] + paramKeys: [] + /containers/volume/search: + get: + consumes: + - application/json + description: 获取容器存储卷列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search volume list + tags: + - Container Volume + post: + consumes: + - application/json + description: 获取容器存储卷分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search volume list with page + tags: + - Container Volume + /cronjob/del: + post: + consumes: + - application/json + description: 删除计划任务 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete cronjob + tags: + - Cronjob + x-panel-log: + BeforeFuntions: + - db: cronjobs + input_colume: id + input_value: ids + isList: true + output_colume: name + output_value: names + bodyKeys: + - ids + formatEN: delete cronjob [names] + formatZH: 删除计划任务 [names] + paramKeys: [] + /cronjob/download: + post: + consumes: + - application/json + description: 下载计划任务记录 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CronjobDownload' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Download Cronjob records + tags: + - Cronjob + x-panel-log: + BeforeFuntions: + - db: job_records + input_colume: id + input_value: recordID + isList: false + output_colume: file + output_value: file + bodyKeys: + - recordID + formatEN: download the cronjob record [file] + formatZH: 下载计划任务记录 [file] + paramKeys: [] + /cronjob/handle: + post: + consumes: + - application/json + description: 手动执行计划任务 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.OperateByID' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Handle cronjob once + tags: + - Cronjob + x-panel-log: + BeforeFuntions: + - db: cronjobs + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: manually execute the cronjob [name] + formatZH: 手动执行计划任务 [name] + paramKeys: [] + /cronjob/status: + post: + consumes: + - application/json + description: 更新计划任务状态 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CronjobUpdateStatus' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update cronjob status + tags: + - Cronjob + x-panel-log: + BeforeFuntions: + - db: cronjobs + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + - status + formatEN: change the status of cronjob [name] to [status]. + formatZH: 修改计划任务 [name] 状态为 [status] + paramKeys: [] + /cronjob/update: + post: + consumes: + - application/json + description: 更新计划任务 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CronjobUpdate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update cronjob + tags: + - Cronjob + x-panel-log: + BeforeFuntions: + - db: cronjobs + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: update cronjob [name] + formatZH: 更新计划任务 [name] + paramKeys: [] + /cronjobs: + post: + consumes: + - application/json + description: 创建计划任务 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CronjobCreate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create cronjob + tags: + - Cronjob + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - type + - name + formatEN: create cronjob [type][name] + formatZH: 创建计划任务 [type][name] + paramKeys: [] + /cronjobs/search: + post: + consumes: + - application/json + description: 获取计划任务分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SearchWithPage' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search cronjob list with page + tags: + - Cronjob + /cronjobs/search/records: + post: + consumes: + - application/json + description: 获取计划任务记录 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SearchRecord' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search job records + tags: + - Cronjob + /databases: + post: + consumes: + - application/json + description: 创建 mysql 数据库 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.MysqlDBCreate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create mysql database + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: create mysql database [name] + formatZH: 创建 mysql 数据库 [name] + paramKeys: [] + /databases/backup: + post: + consumes: + - application/json + description: 备份 mysql 数据库 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BackupDB' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Backup mysql database + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - mysqlName + - dbName + formatEN: backup mysql database [mysqlName][dbName] + formatZH: 备份 mysql 数据库 [mysqlName][dbName] + paramKeys: [] + /databases/baseinfo: + get: + description: 获取 mysql 基础信息 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.DBBaseInfo' + security: + - ApiKeyAuth: [] + summary: Load mysql base info + tags: + - Database Mysql + /databases/change/access: + post: + consumes: + - application/json + description: 修改 mysql 访问权限 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ChangeDBInfo' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Change mysql access + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: + - db: database_mysqls + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: Update database [name] access + formatZH: 更新数据库 [name] 访问权限 + paramKeys: [] + /databases/change/password: + post: + consumes: + - application/json + description: 修改 mysql 密码 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ChangeDBInfo' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Change mysql password + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: + - db: database_mysqls + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: Update database [name] password + formatZH: 更新数据库 [name] 密码 + paramKeys: [] + /databases/conffile/update: + post: + consumes: + - application/json + description: 上传替换 mysql 配置文件 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.MysqlConfUpdateByFile' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update mysql conf by upload file + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: update the mysql database configuration information + formatZH: 更新 mysql 数据库配置信息 + paramKeys: [] + /databases/del: + post: + consumes: + - application/json + description: 删除 mysql 数据库 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.MysqlDBDelete' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete mysql database + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: + - db: database_mysqls + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: delete mysql database [name] + formatZH: 删除 mysql 数据库 [name] + paramKeys: [] + /databases/del/check: + post: + consumes: + - application/json + description: Mysql 数据库删除前检查 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.OperateByID' + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: Check before delete mysql database + tags: + - Database Mysql + /databases/description/update: + post: + consumes: + - application/json + description: 更新 mysql 数据库库描述信息 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.MysqlDescription' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update mysql database description + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: + - db: database_mysqls + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + - description + formatEN: The description of the mysql database [name] is modified => [description] + formatZH: mysql 数据库 [name] 描述信息修改 [description] + paramKeys: [] + /databases/options: + get: + consumes: + - application/json + description: 获取 mysql 数据库列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: Search mysql database list + tags: + - Cronjob + /databases/recover: + post: + consumes: + - application/json + description: Mysql 数据库恢复 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.RecoverDB' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Recover mysql database + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - mysqlName + - dbName + - backupName + formatEN: 恢复 mysql 数据库 [mysqlName][dbName] [backupName] + formatZH: 恢复 mysql 数据库 [mysqlName][dbName] [backupName] + paramKeys: [] + /databases/recover/byupload: + post: + consumes: + - application/json + description: Mysql 数据库从上传文件恢复 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.UploadRecover' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Recover mysql database by upload file + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - fileDir + - fileName + - mysqlName + - dbName + formatEN: mysql database recover [fileDir]/[fileName] from [mysqlName][dbName] + formatZH: mysql 数据库从 [fileDir]/[fileName] 恢复 [mysqlName][dbName] + paramKeys: [] + /databases/redis/backup: + post: + description: 备份 redis 数据库 + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Backup redis + tags: + - Database Redis + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: backup redis database + formatZH: 备份 redis 数据库 + paramKeys: [] + /databases/redis/backup/search: + post: + consumes: + - application/json + description: 获取 redis 备份记录分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search redis backup list + tags: + - Database Redis + /databases/redis/conf: + get: + description: 获取 redis 配置信息 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.RedisConf' + security: + - ApiKeyAuth: [] + summary: Load redis conf + tags: + - Database Redis + /databases/redis/conf/update: + post: + consumes: + - application/json + description: 更新 redis 配置信息 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.RedisConfUpdate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update redis conf + tags: + - Database Redis + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: update the redis database configuration information + formatZH: 更新 redis 数据库配置信息 + paramKeys: [] + /databases/redis/conffile/update: + post: + consumes: + - application/json + description: 上传更新 redis 配置信息 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.RedisConfUpdateByFile' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update redis conf by file + tags: + - Database Redis + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: update the redis database configuration information + formatZH: 更新 redis 数据库配置信息 + paramKeys: [] + /databases/redis/password: + post: + consumes: + - application/json + description: 更新 redis 密码 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ChangeDBInfo' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Change redis password + tags: + - Database Redis + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: change the password of the redis database + formatZH: 修改 redis 数据库密码 + paramKeys: [] + /databases/redis/persistence/conf: + get: + description: 获取 redis 持久化配置 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.RedisPersistence' + security: + - ApiKeyAuth: [] + summary: Load redis persistence conf + tags: + - Database Redis + /databases/redis/persistence/update: + post: + consumes: + - application/json + description: 更新 redis 持久化配置 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.RedisConfPersistenceUpdate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update redis persistence conf + tags: + - Database Redis + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: redis database persistence configuration update + formatZH: redis 数据库持久化配置更新 + paramKeys: [] + /databases/redis/recover: + post: + description: 恢复 redis 数据库 + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Recover redis + tags: + - Database Redis + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - fileDir + - fileName + formatEN: redis database recover from [fileDir]/[fileName] + formatZH: redis 数据库从 [fileDir]/[fileName] 恢复 + paramKeys: [] + /databases/redis/status: + get: + description: 获取 redis 状态信息 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.RedisStatus' + security: + - ApiKeyAuth: [] + summary: Load redis status info + tags: + - Database Redis + /databases/remote: + get: + description: 获取 mysql 远程访问权限 + responses: + "200": + description: OK + schema: + type: bool + security: + - ApiKeyAuth: [] + summary: Load mysql remote access + tags: + - Database Mysql + /databases/search: + post: + consumes: + - application/json + description: 获取 mysql 数据库列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.PageInfo' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Search mysql database list with page + tags: + - Cronjob + /databases/status: + get: + description: 获取 mysql 状态信息 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.MysqlStatus' + security: + - ApiKeyAuth: [] + summary: Load mysql status info + tags: + - Database Mysql + /databases/variables: + get: + description: 获取 mysql 性能参数信息 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.MysqlVariables' + security: + - ApiKeyAuth: [] + summary: Load mysql variables info + tags: + - Database Mysql + /databases/variables/update: + post: + consumes: + - application/json + description: mysql 性能调优 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.MysqlVariablesUpdate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update mysql variables + tags: + - Database Mysql + x-panel-log: + BeforeFuntions: [] + bodyKeys: [] + formatEN: adjust mysql database performance parameters + formatZH: 调整 mysql 数据库性能参数 + paramKeys: [] swagger: "2.0" diff --git a/cmd/server/main.go b/cmd/server/main.go index d879560ec..a539df8a7 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -2,23 +2,22 @@ package main import ( "fmt" + "os" + "github.com/1Panel-dev/1Panel/cmd/server/cmd" _ "github.com/1Panel-dev/1Panel/cmd/server/docs" - "os" ) // @title 1Panel // @version 1.0 // @description 开源Linux面板 // @termsOfService http://swagger.io/terms/ - // @license.name Apache 2.0 // @license.url http://www.apache.org/licenses/LICENSE-2.0.html - // @host localhost // @BasePath /api/v1 -//go:generate swag init -o ./docs -d ../../backend/app/api/v1 -g ../../../../cmd/server/main.go +//go:generate swag init -o ./docs -g main.go -d ../../backend/app -g ../../cmd/server/main.go func main() { if err := cmd.RootCmd.Execute(); err != nil { fmt.Fprintln(os.Stderr, err) diff --git a/cmd/server/operation/operation.json b/cmd/server/operation/operation.json index ce64ccad9..5306a369e 100644 --- a/cmd/server/operation/operation.json +++ b/cmd/server/operation/operation.json @@ -1,854 +1,4 @@ [ - { - "api": "/api/v1/containers", - "method": "POST", - "bodyKeys": [ - "name", - "image" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建容器 [name][image]", - "formatEN": "create container [name][image]" - }, - { - "api": "/api/v1/containers/operate", - "method": "POST", - "bodyKeys": [ - "name", - "operation", - "newName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "容器 [name] 执行 [operation] [newName]", - "formatEN": "container [operation] [name] [newName]" - }, - { - "api": "/api/v1/containers/repo", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建镜像仓库 [name]", - "formatEN": "create image repo [name]" - }, - { - "api": "/api/v1/containers/repo/update", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_column": "id", - "input_value": "id", - "isList": false, - "db": "image_repos", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "更新镜像仓库 [name]", - "formatEN": "update image repo information [name]" - }, - { - "api": "/api/v1/containers/repo/del", - "method": "POST", - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "ids", - "isList": true, - "db": "image_repos", - "output_colume": "name", - "output_value": "names" - } - ], - "formatZH": "删除镜像仓库 [names]", - "formatEN": "delete image repo [names]" - }, - { - "api": "/api/v1/containers/compose", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建 compose [name]", - "formatEN": "create compose [name]" - }, - { - "api": "/api/v1/containers/compose/operate", - "method": "POST", - "bodyKeys": [ - "name", - "operation" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "compose [operation] [name]", - "formatEN": "compose [operation] [name]" - }, - { - "api": "/api/v1/containers/compose/update", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 compose [name]", - "formatEN": "update compose information [name]" - }, - { - "api": "/api/v1/containers/template/update", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "compose_templates", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "更新 compose 模版 [name]", - "formatEN": "update compose template information [name]" - }, - { - "api": "/api/v1/containers/template", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建 compose 模版 [name]", - "formatEN": "create compose template [name]" - }, - { - "api": "/api/v1/containers/template/del", - "method": "POST", - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "ids", - "isList": true, - "db": "compose_templates", - "output_colume": "name", - "output_value": "names" - } - ], - "formatZH": "删除 compose 模版 [names]", - "formatEN": "delete compose template [names]" - }, - { - "api": "/api/v1/containers/image/pull", - "method": "POST", - "bodyKeys": [ - "repoID", - "imageName" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "repoID", - "isList": false, - "db": "image_repos", - "output_colume": "name", - "output_value": "reponame" - } - ], - "formatZH": "镜像拉取 [reponame][imageName]", - "formatEN": "image pull [reponame][imageName]" - }, - { - "api": "/api/v1/containers/image/push", - "method": "POST", - "bodyKeys": [ - "repoID", - "tagName", - "name" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "repoID", - "isList": false, - "db": "image_repos", - "output_colume": "name", - "output_value": "reponame" - } - ], - "formatZH": "[tagName] 推送到 [reponame][name]", - "formatEN": "push [tagName] to [reponame][name]" - }, - { - "api": "/api/v1/containers/image/save", - "method": "POST", - "bodyKeys": [ - "tagName", - "path", - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "保留 [tagName] 为 [path]/[name]", - "formatEN": "save [tagName] as [path]/[name]" - }, - { - "api": "/api/v1/containers/image/load", - "method": "POST", - "bodyKeys": [ - "path" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "从 [path] 加载镜像", - "formatEN": "load image from [path]" - }, - { - "api": "/api/v1/containers/image/remove", - "method": "POST", - "bodyKeys": [ - "names" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "移除镜像 [names]", - "formatEN": "remove image [names]" - }, - { - "api": "/api/v1/containers/image/tag", - "method": "POST", - "bodyKeys": [ - "repoID", - "targetName" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "repoID", - "isList": false, - "db": "image_repos", - "output_colume": "name", - "output_value": "reponame" - } - ], - "formatZH": "tag 镜像 [reponame][targetName]", - "formatEN": "tag image [reponame][targetName]" - }, - { - "api": "/api/v1/containers/image/build", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "构建镜像 [name]", - "formatEN": "build image [name]" - }, - { - "api": "/api/v1/containers/network", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建容器网络 name", - "formatEN": "create container network [name]" - }, - { - "api": "/api/v1/containers/network/del", - "method": "POST", - "bodyKeys": [ - "names" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "删除容器网络 [names]", - "formatEN": "delete container network [names]" - }, - { - "api": "/api/v1/containers/volume", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建容器存储卷 [name]", - "formatEN": "create container volume [name]" - }, - { - "api": "/api/v1/containers/volume/del", - "method": "POST", - "bodyKeys": [ - "names" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "删除容器存储卷 [names]", - "formatEN": "delete container volume [names]" - }, - { - "api": "/api/v1/containers/docker/operate", - "method": "POST", - "bodyKeys": [ - "operation" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "docker 服务 [operation]", - "formatEN": "[operation] docker service" - }, - { - "api": "/api/v1/containers/daemonjson/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 docker daemon.json 配置", - "formatEN": "Updated the docker daemon.json configuration" - }, - { - "api": "/api/v1/containers/daemonjson/update/byfile", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 docker daemon.json 配置", - "formatEN": "Updated the docker daemon.json configuration" - }, - { - "api": "/api/v1/cronjobs/del", - "method": "POST", - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "ids", - "isList": true, - "db": "cronjobs", - "output_colume": "name", - "output_value": "names" - } - ], - "formatZH": "删除计划任务 [names]", - "formatEN": "delete cronjob [names]" - }, - { - "api": "/api/v1/cronjobs/update", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "cronjobs", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "更新计划任务 [name]", - "formatEN": "update cronjob [name]" - }, - { - "api": "/api/v1/cronjobs/status", - "method": "POST", - "bodyKeys": [ - "id", - "status" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "cronjobs", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "修改计划任务 [name] 状态为 [status]", - "formatEN": "change the status of cronjob [name] to [status]." - }, - { - "api": "/api/v1/cronjobs/handle", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "cronjobs", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "手动执行计划任务 [name]", - "formatEN": "manually execute the cronjob [name]" - }, - { - "api": "/api/v1/databases", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建 mysql 数据库 [name]", - "formatEN": "create mysql database [name]" - }, - { - "api": "/api/v1/databases/backup", - "method": "POST", - "bodyKeys": [ - "mysqlName", - "dbName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "备份 mysql 数据库 [mysqlName][dbName]", - "formatEN": "backup mysql database [mysqlName][dbName]" - }, - { - "api": "/api/v1/databases/recover", - "method": "POST", - "bodyKeys": [ - "mysqlName", - "dbName", - "backupName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "恢复 mysql 数据库 [mysqlName][dbName] [backupName]", - "formatEN": "恢复 mysql 数据库 [mysqlName][dbName] [backupName]" - }, - { - "api": "/api/v1/databases/recover/byupload", - "method": "POST", - "bodyKeys": [ - "fileDir", - "fileName", - "mysqlName", - "dbName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "mysql 数据库从 [fileDir]/[fileName] 恢复 [mysqlName][dbName]", - "formatEN": "mysql database recover [fileDir]/[fileName] from [mysqlName][dbName]" - }, - { - "api": "/api/v1/databases/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "database_mysqls", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "删除 mysql 数据库 [name]", - "formatEN": "delete mysql database [name]" - }, - { - "api": "/api/v1/databases/description/update", - "method": "POST", - "bodyKeys": ["id", "description"], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "database_mysqls", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "mysql 数据库 [name] 描述信息修改 [description]", - "formatEN": "The description of the mysql database [name] is modified => [description]" - }, - { - "api": "/api/v1/databases/variables/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "调整 mysql 数据库性能参数", - "formatEN": "adjust mysql database performance parameters" - }, - { - "api": "/api/v1/databases/conffile/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 mysql 数据库配置信息", - "formatEN": "update the mysql database configuration information" - }, - { - "api": "/api/v1/databases/redis/password", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "修改 redis 数据库密码", - "formatEN": "change the password of the redis database" - }, - { - "api": "/api/v1/databases/redis/backup", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "备份 redis 数据库", - "formatEN": "backup redis database" - }, - { - "api": "/api/v1/databases/redis/recover", - "method": "POST", - "bodyKeys": [ - "fileDir", - "fileName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "redis 数据库从 [fileDir]/[fileName] 恢复", - "formatEN": "redis database recover from [fileDir]/[fileName]" - }, - { - "api": "/api/v1/databases/redis/conf/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 redis 数据库配置信息", - "formatEN": "update the redis database configuration information" - }, - { - "api": "/api/v1/databases/redis/conffile/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 redis 数据库配置信息", - "formatEN": "update the redis database configuration information" - }, - { - "api": "/api/v1/databases/redis/persistence/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "redis 数据库持久化配置更新", - "formatEN": "redis database persistence configuration update" - }, - { - "api": "/api/v1/commands", - "method": "POST", - "bodyKeys": [ - "name", - "command" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建快捷命令 [name][command]", - "formatEN": "create quick command [name][command]" - }, - { - "api": "/api/v1/commands/del", - "method": "POST", - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "ids", - "isList": true, - "db": "commands", - "output_colume": "name", - "output_value": "names" - } - ], - "formatZH": "删除快捷命令 [names]", - "formatEN": "delete quick command [names]" - }, - { - "api": "/api/v1/commands/update", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新快捷命令 [name]", - "formatEN": "update quick command [name]" - }, - { - "api": "/api/v1/backups", - "method": "POST", - "bodyKeys": [ - "type" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建备份账号 [type]", - "formatEN": "create backup account [type]" - }, - { - "api": "/api/v1/backups/del", - "method": "POST", - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "ids", - "isList": true, - "db": "backup_accounts", - "output_colume": "type", - "output_value": "types" - } - ], - "formatZH": "删除备份账号 [types]", - "formatEN": "delete backup account [types]" - }, - { - "api": "/api/v1/backups/update", - "method": "POST", - "bodyKeys": [ - "type" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新备份账号 [types]", - "formatEN": "update backup account [types]" - }, - { - "api": "/api/v1/backups/record/download", - "method": "POST", - "bodyKeys": [ - "source", - "fileName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "下载备份记录 [source][fileName]", - "formatEN": "download backup records [source][fileName]" - }, - { - "api": "/api/v1/backups/record/del", - "method": "POST", - "bodyKeys": [ - "ids" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "ids", - "isList": true, - "db": "backup_records", - "output_colume": "file_name", - "output_value": "files" - } - ], - "formatZH": "删除备份记录 [files]", - "formatEN": "delete backup records [files]" - }, - { - "api": "/api/v1/groups/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "groups", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "删除组 [name]", - "formatEN": "delete group [name]" - }, - { - "api": "/api/v1/groups/update", - "method": "POST", - "bodyKeys": [ - "name", - "type" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新组 [name][type]", - "formatEN": "update group [name][type]" - }, - { - "api": "/api/v1/groups", - "method": "POST", - "bodyKeys": [ - "name", - "type" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建组 [name][type]", - "formatEN": "create group [name][type]" - }, - { - "api": "/api/v1/hosts/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "hosts", - "output_colume": "addr", - "output_value": "addr" - } - ], - "formatZH": "删除主机 [addr]", - "formatEN": "delete host [addr]" - }, - { - "api": "/api/v1/hosts/update", - "method": "POST", - "bodyKeys": [ - "name", - "addr" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新主机信息 [name][addr]", - "formatEN": "update host [name][addr]" - }, - { - "api": "/api/v1/hosts", - "method": "POST", - "bodyKeys": [ - "name", - "addr" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建主机 [name][addr]", - "formatEN": "create host [name][addr]" - }, - { - "api": "/api/v1/settings/expired/handle", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "重置过期密码", - "formatEN": "reset an expired Password" - }, - { - "api": "/api/v1/settings/update", - "method": "POST", - "bodyKeys": [ - "key", - "value" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "修改系统配置 [key] => [value]", - "formatEN": "update system setting [key] => [value]" - }, - { - "api": "/api/v1/settings/password/update", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "修改系统密码", - "formatEN": "update system password" - }, - { - "api": "/api/v1/settings/time/sync", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "系统时间同步", - "formatEN": "sync system time" - }, - { - "api": "/api/v1/settings/monitor/clean", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "清空监控数据", - "formatEN": "clean monitor datas" - }, - { - "api": "/api/v1/settings/mfa/bind", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "mfa 绑定", - "formatEN": "bind mfa" - }, { "api": "/api/v1/apps/sync", "method": "POST", @@ -976,413 +126,5 @@ "BeforeFuntions": [], "formatZH": "应用端口修改 [key]-[name] => [port]", "formatEN": "Application port update [key]-[name] => [port]" - }, - { - "api": "/api/v1/apps/files", - "method": "POST", - "bodyKeys": [ - "path" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建文件/文件夹 [path]", - "formatEN": "Create dir or file [path]" - }, - { - "api": "/api/v1/apps/files/del", - "method": "POST", - "bodyKeys": [ - "path" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "删除文件/文件夹 [path]", - "formatEN": "Delete dir or file [path]" - }, - { - "api": "/api/v1/apps/files/batch/del", - "method": "POST", - "bodyKeys": [ - "paths" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "批量删除文件/文件夹 [paths]", - "formatEN": "Batch delete dir or file [paths]" - }, - { - "api": "/api/v1/apps/files/mode", - "method": "POST", - "bodyKeys": [ - "path", - "mode" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "修改权限 [paths] => [mode]", - "formatEN": "Change mode [paths] => [mode]" - }, - { - "api": "/api/v1/apps/files/compress", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "压缩文件 [name]", - "formatEN": "Compress file [name]" - }, - { - "api": "/api/v1/apps/files/decompress", - "method": "POST", - "bodyKeys": [ - "path" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "解压 [path]", - "formatEN": "Decompress file [path]" - }, - { - "api": "/api/v1/apps/files/upload", - "method": "POST", - "bodyKeys": [ - "path" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "上传文件 [path]", - "formatEN": "Upload file [path]" - }, - { - "api": "/api/v1/apps/files/rename", - "method": "POST", - "bodyKeys": [ - "oldName", - "newName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "重命名 [oldName] => [newName]", - "formatEN": "Rename [oldName] => [newName]" - }, - { - "api": "/api/v1/apps/files/wget", - "method": "POST", - "bodyKeys": [ - "url", - "path", - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "下载 url => [path]/[name]", - "formatEN": "Download url => [path]/[name]" - }, - { - "api": "/api/v1/apps/files/move", - "method": "POST", - "bodyKeys": [ - "oldPaths", - "newPath" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "移动文件 [oldPaths] => [newPath]", - "formatEN": "Move [oldPaths] => [newPath]" - }, - { - "api": "/api/v1/apps/files/download", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "下载文件 [name]", - "formatEN": "Download file [name]" - }, - { - "api": "/api/v1/apps/nginx/update", - "method": "POST", - "bodyKeys": [ - "websiteId" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "websiteId", - "isList": false, - "db": "websites", - "output_colume": "primary_domain", - "output_value": "domain" - } - ], - "formatZH": "更新 nginx 配置 [domain]", - "formatEN": "Update nginx conf [domain]" - }, - { - "api": "/api/v1/apps/nginx/file", - "method": "POST", - "bodyKeys": [], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新 nginx 配置", - "formatEN": "Update nginx conf" - }, - { - "api": "/api/v1/websites/acme", - "method": "POST", - "bodyKeys": [ - "email" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建网站 acme [email]", - "formatEN": "Create website acme [email]" - }, - { - "api": "/api/v1/websites/acme/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "website_acme_accounts", - "output_colume": "email", - "output_value": "email" - } - ], - "formatZH": "删除网站 acme [email]", - "formatEN": "Delete website acme [email]" - }, - { - "api": "/api/v1/websites/dns", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建网站 dns [name]", - "formatEN": "Create website dns [name]" - }, - { - "api": "/api/v1/websites/dns/update", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新网站 dns [name]", - "formatEN": "Update website dns [name]" - }, - { - "api": "/api/v1/websites/dns/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "website_dns_accounts", - "output_colume": "name", - "output_value": "name" - } - ], - "formatZH": "删除网站 dns [name]", - "formatEN": "Delete website dns [name]" - }, - { - "api": "/api/v1/websites/groups", - "method": "POST", - "bodyKeys": [ - "name" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建网站组 [name]", - "formatEN": "Create website groups [name]" - }, - { - "api": "/api/v1/websites/ssl", - "method": "POST", - "bodyKeys": [ - "primaryDomain" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建网站 ssl [primaryDomain]", - "formatEN": "Create website ssl [primaryDomain]" - }, - { - "api": "/api/v1/websites/ssl/renew", - "method": "POST", - "bodyKeys": [ - "SSLId" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "SSLId", - "isList": false, - "db": "website_ssls", - "output_colume": "primary_domain", - "output_value": "domain" - } - ], - "formatZH": "重置 ssl [domain]", - "formatEN": "Renew ssl [domain]" - }, - { - "api": "/api/v1/websites", - "method": "POST", - "bodyKeys": [ - "primaryDomain" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建网站 [primaryDomain]", - "formatEN": "Create website [primaryDomain]" - }, - { - "api": "/api/v1/websites/update", - "method": "POST", - "bodyKeys": [ - "primaryDomain" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "更新网站 [primaryDomain]", - "formatEN": "Update website [primaryDomain]" - }, - { - "api": "/api/v1/websites/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "websites", - "output_colume": "primary_domain", - "output_value": "domain" - } - ], - "formatZH": "删除网站 [domain]", - "formatEN": "Delete website [domain]" - }, - { - "api": "/api/v1/websites/recover", - "method": "POST", - "bodyKeys": [ - "websiteName", - "backupName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "[websiteName] 从备份恢复 [backupName]", - "formatEN": "[websiteName] recover from backups [backupName]" - }, - { - "api": "/api/v1/websites/recover/byupload", - "method": "POST", - "bodyKeys": [ - "websiteName", - "fileDir", - "fileName" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "[websiteName] 从上传恢复 [fileDir]/[fileName]", - "formatEN": "[websiteName] recover from uploads [fileDir]/[fileName]" - }, - { - "api": "/api/v1/websites/domains/del", - "method": "POST", - "bodyKeys": [ - "id" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "id", - "isList": false, - "db": "website_domains", - "output_colume": "domain", - "output_value": "domain" - } - ], - "formatZH": "删除域名 [domain]", - "formatEN": "Delete domain [domain]" - }, - { - "api": "/api/v1/websites/domains", - "method": "POST", - "bodyKeys": [ - "domain" - ], - "paramKeys": [], - "BeforeFuntions": [], - "formatZH": "创建域名 [domain]", - "formatEN": "Create domain [domain]" - }, - { - "api": "/api/v1/websites/config/update", - "method": "POST", - "bodyKeys": [ - "websiteId" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "websiteId", - "isList": false, - "db": "websites", - "output_colume": "primary_domain", - "output_value": "domain" - } - ], - "formatZH": "nginx 配置修改 [domain]", - "formatEN": "Nginx conf update [domain]" - }, - { - "api": "/api/v1/websites/waf/update", - "method": "POST", - "bodyKeys": [ - "websiteId" - ], - "paramKeys": [], - "BeforeFuntions": [ - { - "input_colume": "id", - "input_value": "websiteId", - "isList": false, - "db": "websites", - "output_colume": "primary_domain", - "output_value": "domain" - } - ], - "formatZH": "WAF 配置修改 [domain]", - "formatEN": "WAF conf update [domain]" } ] \ No newline at end of file diff --git a/frontend/src/api/interface/log.ts b/frontend/src/api/interface/log.ts index 3352ecbde..f43f01742 100644 --- a/frontend/src/api/interface/log.ts +++ b/frontend/src/api/interface/log.ts @@ -28,4 +28,7 @@ export namespace Log { message: string; createdAt: DateTimeFormats; } + export interface CleanLog { + logType: string; + } } diff --git a/frontend/src/api/modules/log.ts b/frontend/src/api/modules/log.ts index 4c0bdee35..02c628a1d 100644 --- a/frontend/src/api/modules/log.ts +++ b/frontend/src/api/modules/log.ts @@ -10,6 +10,6 @@ export const getLoginLogs = (info: ReqPage) => { return http.post>(`/logs/login`, info); }; -export const cleanLogs = (logtype: string) => { - return http.post(`/logs/clean/${logtype}`); +export const cleanLogs = (param: Log.CleanLog) => { + return http.post(`/logs/clean`, param); }; diff --git a/frontend/src/views/log/login/index.vue b/frontend/src/views/log/login/index.vue index 16aaa0b49..47aa787cb 100644 --- a/frontend/src/views/log/login/index.vue +++ b/frontend/src/views/log/login/index.vue @@ -74,7 +74,7 @@ const onClean = async () => { }; const onSubmitClean = async () => { - await cleanLogs('login'); + await cleanLogs({ logType: 'login' }); search(); ElMessage.success(i18n.global.t('commons.msg.operationSuccess')); }; diff --git a/frontend/src/views/log/operation/index.vue b/frontend/src/views/log/operation/index.vue index 665066cf1..93a1ec40d 100644 --- a/frontend/src/views/log/operation/index.vue +++ b/frontend/src/views/log/operation/index.vue @@ -86,7 +86,7 @@ const onClean = async () => { }; const onSubmitClean = async () => { - await cleanLogs('operation'); + await cleanLogs({ logType: 'operation' }); search(); ElMessage.success(i18n.global.t('commons.msg.operationSuccess')); }; diff --git a/go.mod b/go.mod index 1b3222dd7..1535832ba 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/spf13/cobra v1.0.0 github.com/spf13/viper v1.12.0 github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a - github.com/swaggo/gin-swagger v1.5.1 + github.com/swaggo/gin-swagger v1.5.3 github.com/swaggo/swag v1.8.4 github.com/xlzd/gotp v0.0.0-20220817083547-a63b9d03d72f golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa diff --git a/go.sum b/go.sum index 8e37210f5..479725b05 100644 --- a/go.sum +++ b/go.sum @@ -929,11 +929,10 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= -github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY= github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= -github.com/swaggo/gin-swagger v1.5.1 h1:PFmlJU1LPn8DjrR0meVLX5gyFdgcPOkLcoFRRFx7WcY= -github.com/swaggo/gin-swagger v1.5.1/go.mod h1:Cbj/MlHApPOjZdf4joWFXLLgmZVPyh54GPvPPyVjVZM= +github.com/swaggo/gin-swagger v1.5.3 h1:8mWmHLolIbrhJJTflsaFoZzRBYVmEE7JZGIq08EiC0Q= +github.com/swaggo/gin-swagger v1.5.3/go.mod h1:3XJKSfHjDMB5dBo/0rrTXidPmgLeqsX89Yp4uA50HpI= github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= github.com/swaggo/swag v1.8.4 h1:oGB351qH1JqUqK1tsMYEE5qTBbPk394BhsZxmUfebcI= github.com/swaggo/swag v1.8.4/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg=