mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 00:09:16 +08:00
fix: correct Swagger API definitions (#7606)
Signed-off-by: Ryan Wang <i@ryanc.cc>
This commit is contained in:
parent
fc401ffd8f
commit
5187b20252
@ -68,7 +68,7 @@ func (b *BaseApi) SyncApp(c *gin.Context) {
|
||||
// @Success 200 {object} response.AppDTO
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/:key [get]
|
||||
// @Router /apps/{key} [get]
|
||||
func (b *BaseApi) GetApp(c *gin.Context) {
|
||||
appKey, err := helper.GetStrParamByKey(c, "key")
|
||||
if err != nil {
|
||||
@ -88,11 +88,11 @@ func (b *BaseApi) GetApp(c *gin.Context) {
|
||||
// @Accept json
|
||||
// @Param appId path integer true "app id"
|
||||
// @Param version path string true "app version"
|
||||
// @Param version path string true "app type"
|
||||
// @Param type path string true "app type"
|
||||
// @Success 200 {object} response.AppDetailDTO
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/detail/:appId/:version/:type [get]
|
||||
// @Router /apps/detail/{appId}/{version}/{type} [get]
|
||||
func (b *BaseApi) GetAppDetail(c *gin.Context) {
|
||||
appID, err := helper.GetIntParamByKey(c, "appId")
|
||||
if err != nil {
|
||||
@ -112,11 +112,11 @@ func (b *BaseApi) GetAppDetail(c *gin.Context) {
|
||||
// @Tags App
|
||||
// @Summary Get app detail by id
|
||||
// @Accept json
|
||||
// @Param appId path integer true "id"
|
||||
// @Param id path integer true "id"
|
||||
// @Success 200 {object} response.AppDetailDTO
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/details/:id [get]
|
||||
// @Router /apps/details/{id} [get]
|
||||
func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
|
||||
appDetailID, err := helper.GetIntParamByKey(c, "id")
|
||||
if err != nil {
|
||||
|
@ -104,10 +104,11 @@ func (b *BaseApi) LoadPort(c *gin.Context) {
|
||||
// @Summary Search app password by key
|
||||
// @Accept json
|
||||
// @Param request body dto.OperationWithNameAndType true "request"
|
||||
// @Param key path string true "key"
|
||||
// @Success 200 {string} response.DatabaseConn
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/installed/conninfo/:key [get]
|
||||
// @Router /apps/installed/conninfo/{key} [get]
|
||||
func (b *BaseApi) LoadConnInfo(c *gin.Context) {
|
||||
var req dto.OperationWithNameAndType
|
||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||
@ -128,7 +129,7 @@ func (b *BaseApi) LoadConnInfo(c *gin.Context) {
|
||||
// @Success 200 {array} dto.AppResource
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/installed/delete/check/:appInstallId [get]
|
||||
// @Router /apps/installed/delete/check/{appInstallId} [get]
|
||||
func (b *BaseApi) DeleteCheck(c *gin.Context) {
|
||||
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
|
||||
if err != nil {
|
||||
@ -187,7 +188,7 @@ func (b *BaseApi) OperateInstalled(c *gin.Context) {
|
||||
// @Success 200 {array} response.AppService
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/services/:key [get]
|
||||
// @Router /apps/services/{key} [get]
|
||||
func (b *BaseApi) GetServices(c *gin.Context) {
|
||||
key := c.Param("key")
|
||||
services, err := appInstallService.GetServices(key)
|
||||
@ -201,7 +202,6 @@ func (b *BaseApi) GetServices(c *gin.Context) {
|
||||
// @Tags App
|
||||
// @Summary Search app update version by install id
|
||||
// @Accept json
|
||||
// @Param appInstallId path integer true "request"
|
||||
// @Success 200 {array} dto.AppVersion
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
@ -269,7 +269,7 @@ func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
|
||||
// @Success 200 {object} response.AppParam
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /apps/installed/params/:appInstallId [get]
|
||||
// @Router /apps/installed/params/{appInstallId} [get]
|
||||
func (b *BaseApi) GetParams(c *gin.Context) {
|
||||
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
|
||||
if err != nil {
|
||||
|
@ -120,6 +120,7 @@ func (b *BaseApi) LoadClamBaseInfo(c *gin.Context) {
|
||||
// @Summary Operate Clam
|
||||
// @Accept json
|
||||
// @Param request body dto.Operate true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/clam/operate [post]
|
||||
@ -142,6 +143,7 @@ func (b *BaseApi) OperateClam(c *gin.Context) {
|
||||
// @Summary Clean clam record
|
||||
// @Accept json
|
||||
// @Param request body dto.OperateByID true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/clam/record/clean [post]
|
||||
|
@ -106,7 +106,7 @@ func (b *BaseApi) SearchRedisCommand(c *gin.Context) {
|
||||
// @Tags Command
|
||||
// @Summary Tree commands
|
||||
// @Accept json
|
||||
// @Success 200 {Array} dto.CommandTree
|
||||
// @Success 200 {array} dto.CommandTree
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /hosts/command/tree [get]
|
||||
@ -122,7 +122,7 @@ func (b *BaseApi) SearchCommandTree(c *gin.Context) {
|
||||
|
||||
// @Tags Redis Command
|
||||
// @Summary List redis commands
|
||||
// @Success 200 {Array} dto.RedisCommand
|
||||
// @Success 200 {array} dto.RedisCommand
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /hosts/command/redis [get]
|
||||
|
@ -1,13 +1,14 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"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"
|
||||
"github.com/pkg/errors"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// @Tags Container
|
||||
@ -394,7 +395,7 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) {
|
||||
// @Success 200 {object} dto.ContainerStats
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /containers/stats/:id [get]
|
||||
// @Router /containers/stats/{id} [get]
|
||||
func (b *BaseApi) ContainerStats(c *gin.Context) {
|
||||
containerID, ok := c.Params.Get("id")
|
||||
if !ok {
|
||||
@ -438,6 +439,7 @@ func (b *BaseApi) Inspect(c *gin.Context) {
|
||||
// @Param since query string false "since"
|
||||
// @Param follow query string false "follow"
|
||||
// @Param tail query string false "tail"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /containers/search/log [post]
|
||||
@ -464,6 +466,7 @@ func (b *BaseApi) ContainerLogs(c *gin.Context) {
|
||||
// @Summary Download Container logs
|
||||
// @Accept json
|
||||
// @Param request body dto.ContainerLog true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /containers/download/log [post]
|
||||
@ -680,6 +683,7 @@ func (b *BaseApi) ComposeUpdate(c *gin.Context) {
|
||||
// @Param since query string false "date"
|
||||
// @Param follow query string false "follow"
|
||||
// @Param tail query string false "tail"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /containers/compose/search/log [get]
|
||||
|
@ -34,7 +34,7 @@ func (b *BaseApi) LoadDashboardOsInfo(c *gin.Context) {
|
||||
// @Success 200 {object} dto.DashboardBase
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /dashboard/base/:ioOption/:netOption [get]
|
||||
// @Router /dashboard/base/{ioOption}/{netOption} [get]
|
||||
func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) {
|
||||
ioOption, ok := c.Params.Get("ioOption")
|
||||
if !ok {
|
||||
@ -78,7 +78,7 @@ func (b *BaseApi) LoadDashboardCurrentInfo(c *gin.Context) {
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /dashboard/system/restart/:operation [post]
|
||||
// @Router /dashboard/system/restart/{operation} [post]
|
||||
func (b *BaseApi) SystemRestart(c *gin.Context) {
|
||||
operation, ok := c.Params.Get("operation")
|
||||
if !ok {
|
||||
|
@ -93,10 +93,11 @@ func (b *BaseApi) SearchDatabase(c *gin.Context) {
|
||||
|
||||
// @Tags Database
|
||||
// @Summary List databases
|
||||
// @Param type path string true "type"
|
||||
// @Success 200 {array} dto.DatabaseOption
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /databases/db/list/:type [get]
|
||||
// @Router /databases/db/list/{type} [get]
|
||||
func (b *BaseApi) ListDatabase(c *gin.Context) {
|
||||
dbType, err := helper.GetStrParamByKey(c, "type")
|
||||
if err != nil {
|
||||
@ -114,10 +115,11 @@ func (b *BaseApi) ListDatabase(c *gin.Context) {
|
||||
|
||||
// @Tags Database
|
||||
// @Summary Retrieve database list based on type
|
||||
// @Param type path string true "type"
|
||||
// @Success 200 {array} dto.DatabaseItem
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /databases/db/item/:type [get]
|
||||
// @Router /databases/db/item/{type} [get]
|
||||
func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
|
||||
dbType, err := helper.GetStrParamByKey(c, "type")
|
||||
if err != nil {
|
||||
@ -135,10 +137,11 @@ func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
|
||||
|
||||
// @Tags Database
|
||||
// @Summary Get databases
|
||||
// @Param name path string true "name"
|
||||
// @Success 200 {object} dto.DatabaseInfo
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /databases/db/:name [get]
|
||||
// @Router /databases/db/{name} [get]
|
||||
func (b *BaseApi) GetDatabase(c *gin.Context) {
|
||||
name, err := helper.GetStrParamByKey(c, "name")
|
||||
if err != nil {
|
||||
|
@ -217,6 +217,7 @@ func (b *BaseApi) ListDBName(c *gin.Context) {
|
||||
// @Summary Load mysql database from remote
|
||||
// @Accept json
|
||||
// @Param request body dto.MysqlLoadDB true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /databases/load [post]
|
||||
|
@ -168,9 +168,11 @@ func (b *BaseApi) SearchPostgresql(c *gin.Context) {
|
||||
// @Summary Load postgresql database from remote
|
||||
// @Accept json
|
||||
// @Param request body dto.PostgresqlLoadDB true "request"
|
||||
// @Param database path string true "database"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /databases/pg/:database/load [post]
|
||||
// @Router /databases/pg/{database}/load [post]
|
||||
func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
|
||||
database, err := helper.GetStrParamByKey(c, "database")
|
||||
if err != nil {
|
||||
|
@ -28,7 +28,7 @@ func (b *BaseApi) LoadDeviceBaseInfo(c *gin.Context) {
|
||||
// @Tags Device
|
||||
// @Summary list time zone options
|
||||
// @Accept json
|
||||
// @Success 200 {Array} string
|
||||
// @Success 200 {array} string
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/device/zone/options [get]
|
||||
|
@ -29,7 +29,7 @@ func (b *BaseApi) LoadFail2BanBaseInfo(c *gin.Context) {
|
||||
// @Summary Page fail2ban ip list
|
||||
// @Accept json
|
||||
// @Param request body dto.Fail2BanSearch true "request"
|
||||
// @Success 200 {Array} string
|
||||
// @Success 200 {array} string
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/fail2ban/search [post]
|
||||
@ -52,6 +52,7 @@ func (b *BaseApi) SearchFail2Ban(c *gin.Context) {
|
||||
// @Summary Operate fail2ban
|
||||
// @Accept json
|
||||
// @Param request body dto.Operate true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/fail2ban/operate [post]
|
||||
@ -74,6 +75,7 @@ func (b *BaseApi) OperateFail2Ban(c *gin.Context) {
|
||||
// @Summary Operate sshd of fail2ban
|
||||
// @Accept json
|
||||
// @Param request body dto.Operate true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/fail2ban/operate/sshd [post]
|
||||
|
@ -290,6 +290,7 @@ func (b *BaseApi) SaveContent(c *gin.Context) {
|
||||
|
||||
// @Tags File
|
||||
// @Summary Upload file
|
||||
// @Accept multipart/form-data
|
||||
// @Param file formData file true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
@ -662,6 +663,7 @@ func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int,
|
||||
|
||||
// @Tags File
|
||||
// @Summary Chunk upload file
|
||||
// @Accept multipart/form-data
|
||||
// @Param file formData file true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
|
@ -55,6 +55,7 @@ func (b *BaseApi) LoadFtpLogInfo(c *gin.Context) {
|
||||
// @Summary Operate FTP
|
||||
// @Accept json
|
||||
// @Param request body dto.Operate true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /toolbox/ftp/operate [post]
|
||||
|
@ -56,7 +56,7 @@ func (b *BaseApi) TestByInfo(c *gin.Context) {
|
||||
// @Success 200 {boolean} connStatus
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /hosts/test/byid/:id [post]
|
||||
// @Router /hosts/test/byid/{id} [post]
|
||||
func (b *BaseApi) TestByID(c *gin.Context) {
|
||||
id, err := helper.GetParamID(c)
|
||||
if err != nil {
|
||||
|
@ -118,7 +118,7 @@ func (b *BaseApi) UpdateRuntime(c *gin.Context) {
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /runtimes/:id [get]
|
||||
// @Router /runtimes/{id} [get]
|
||||
func (b *BaseApi) GetRuntime(c *gin.Context) {
|
||||
id, err := helper.GetIntParamByKey(c, "id")
|
||||
if err != nil {
|
||||
|
@ -26,6 +26,7 @@ func (b *BaseApi) GetSSHInfo(c *gin.Context) {
|
||||
// @Summary Operate SSH
|
||||
// @Accept json
|
||||
// @Param request body dto.Operate true "request"
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /host/ssh/operate [post]
|
||||
|
@ -166,7 +166,7 @@ func (b *BaseApi) UpdateWebsite(c *gin.Context) {
|
||||
// @Success 200 {object} response.WebsiteDTO
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/:id [get]
|
||||
// @Router /websites/{id} [get]
|
||||
func (b *BaseApi) GetWebsite(c *gin.Context) {
|
||||
id, err := helper.GetParamID(c)
|
||||
if err != nil {
|
||||
@ -185,10 +185,11 @@ func (b *BaseApi) GetWebsite(c *gin.Context) {
|
||||
// @Summary Search website nginx by id
|
||||
// @Accept json
|
||||
// @Param id path integer true "request"
|
||||
// @Param type path string true "type"
|
||||
// @Success 200 {object} response.FileInfo
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/:id/config/:type [get]
|
||||
// @Router /websites/{id}/config/{type} [get]
|
||||
func (b *BaseApi) GetWebsiteNginx(c *gin.Context) {
|
||||
id, err := helper.GetParamID(c)
|
||||
if err != nil {
|
||||
@ -254,7 +255,7 @@ func (b *BaseApi) UpdateNginxConfig(c *gin.Context) {
|
||||
// @Success 200 {object} response.WebsiteHTTPS
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/:id/https [get]
|
||||
// @Router /websites/{id}/https [get]
|
||||
func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
|
||||
id, err := helper.GetParamID(c)
|
||||
if err != nil {
|
||||
@ -272,11 +273,12 @@ func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
|
||||
// @Tags Website HTTPS
|
||||
// @Summary Update https conf
|
||||
// @Accept json
|
||||
// @Param id path integer true "request"
|
||||
// @Param request body request.WebsiteHTTPSOp true "request"
|
||||
// @Success 200 {object} response.WebsiteHTTPS
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/:id/https [post]
|
||||
// @Router /websites/{id}/https [post]
|
||||
// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"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
|
||||
@ -386,7 +388,7 @@ func (b *BaseApi) ChangeDefaultServer(c *gin.Context) {
|
||||
// @Success 200 {object} response.PHPConfig
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/php/config/:id [get]
|
||||
// @Router /websites/php/config/{id} [get]
|
||||
func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) {
|
||||
id, err := helper.GetParamID(c)
|
||||
if err != nil {
|
||||
@ -782,10 +784,11 @@ func (b *BaseApi) GetDirConfig(c *gin.Context) {
|
||||
// @Tags Website
|
||||
// @Summary Get default html
|
||||
// @Accept json
|
||||
// @Param type path string true "type"
|
||||
// @Success 200 {object} response.FileInfo
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/default/html/:type [get]
|
||||
// @Router /websites/default/html/{type} [get]
|
||||
func (b *BaseApi) GetDefaultHtml(c *gin.Context) {
|
||||
resourceType, err := helper.GetStrParamByKey(c, "type")
|
||||
if err != nil {
|
||||
|
@ -57,7 +57,7 @@ func (b *BaseApi) CreateWebDomain(c *gin.Context) {
|
||||
// @Success 200 {array} model.WebsiteDomain
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/domains/:websiteId [get]
|
||||
// @Router /websites/domains/{websiteId} [get]
|
||||
func (b *BaseApi) GetWebDomains(c *gin.Context) {
|
||||
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
|
||||
if err != nil {
|
||||
|
@ -138,7 +138,7 @@ func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) {
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/ssl/website/:websiteId [get]
|
||||
// @Router /websites/ssl/website/{websiteId} [get]
|
||||
func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
|
||||
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
|
||||
if err != nil {
|
||||
@ -160,7 +160,7 @@ func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
|
||||
// @Success 200
|
||||
// @Security ApiKeyAuth
|
||||
// @Security Timestamp
|
||||
// @Router /websites/ssl/:id [get]
|
||||
// @Router /websites/ssl/{id} [get]
|
||||
func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) {
|
||||
id, err := helper.GetParamID(c)
|
||||
if err != nil {
|
||||
|
@ -19,7 +19,7 @@ type Fail2BanSearch struct {
|
||||
}
|
||||
|
||||
type Fail2BanUpdate struct {
|
||||
Key string `json:"key" validate:"required,oneof=port bantime findtime maxretry banaction logpath port"`
|
||||
Key string `json:"key" validate:"required,oneof=port bantime findtime maxretry banaction logpath"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -34,6 +34,8 @@ definitions:
|
||||
type: string
|
||||
apiKey:
|
||||
type: string
|
||||
apiKeyValidityTime:
|
||||
type: string
|
||||
ipWhiteList:
|
||||
type: string
|
||||
type: object
|
||||
@ -384,6 +386,17 @@ definitions:
|
||||
- command
|
||||
- name
|
||||
type: object
|
||||
dto.CommandTree:
|
||||
properties:
|
||||
children:
|
||||
items:
|
||||
$ref: '#/definitions/dto.CommandInfo'
|
||||
type: array
|
||||
id:
|
||||
type: integer
|
||||
label:
|
||||
type: string
|
||||
type: object
|
||||
dto.CommonBackup:
|
||||
properties:
|
||||
detailName:
|
||||
@ -1362,7 +1375,6 @@ definitions:
|
||||
- maxretry
|
||||
- banaction
|
||||
- logpath
|
||||
- port
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
@ -1822,6 +1834,7 @@ definitions:
|
||||
- zh
|
||||
- en
|
||||
- tw
|
||||
- ru
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
@ -2977,6 +2990,8 @@ definitions:
|
||||
type: string
|
||||
apiKey:
|
||||
type: string
|
||||
apiKeyValidityTime:
|
||||
type: string
|
||||
appStoreLastModified:
|
||||
type: string
|
||||
appStoreSyncStatus:
|
||||
@ -5662,7 +5677,7 @@ info:
|
||||
title: 1Panel
|
||||
version: "1.0"
|
||||
paths:
|
||||
/apps/:key:
|
||||
/apps/{key}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -5694,7 +5709,7 @@ paths:
|
||||
summary: Get app list update
|
||||
tags:
|
||||
- App
|
||||
/apps/detail/:appId/:version/:type:
|
||||
/apps/detail/{appId}/{version}/{type}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -5711,7 +5726,7 @@ paths:
|
||||
type: string
|
||||
- description: app type
|
||||
in: path
|
||||
name: version
|
||||
name: type
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -5725,14 +5740,14 @@ paths:
|
||||
summary: Search app detail by appid
|
||||
tags:
|
||||
- App
|
||||
/apps/details/:id:
|
||||
/apps/details/{id}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: id
|
||||
in: path
|
||||
name: appId
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
responses:
|
||||
@ -5834,7 +5849,7 @@ paths:
|
||||
summary: Search default config by key
|
||||
tags:
|
||||
- App
|
||||
/apps/installed/conninfo/:key:
|
||||
/apps/installed/conninfo/{key}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -5845,6 +5860,11 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.OperationWithNameAndType'
|
||||
- description: key
|
||||
in: path
|
||||
name: key
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -5856,7 +5876,7 @@ paths:
|
||||
summary: Search app password by key
|
||||
tags:
|
||||
- App
|
||||
/apps/installed/delete/check/:appInstallId:
|
||||
/apps/installed/delete/check/{appInstallId}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -5991,7 +6011,7 @@ paths:
|
||||
formatEN: '[operate] App [appKey][appName]'
|
||||
formatZH: '[operate] 应用 [appKey][appName]'
|
||||
paramKeys: []
|
||||
/apps/installed/params/:appInstallId:
|
||||
/apps/installed/params/{appInstallId}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -6109,12 +6129,6 @@ paths:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: request
|
||||
in: path
|
||||
name: appInstallId
|
||||
required: true
|
||||
type: integer
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -6148,7 +6162,7 @@ paths:
|
||||
summary: List apps
|
||||
tags:
|
||||
- App
|
||||
/apps/services/:key:
|
||||
/apps/services/{key}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -6447,7 +6461,9 @@ paths:
|
||||
in: query
|
||||
name: tail
|
||||
type: string
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -6645,7 +6661,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ContainerLog'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -7469,14 +7487,16 @@ paths:
|
||||
in: query
|
||||
name: tail
|
||||
type: string
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
summary: Container logs
|
||||
tags:
|
||||
- Container
|
||||
/containers/stats/:id:
|
||||
/containers/stats/{id}:
|
||||
get:
|
||||
parameters:
|
||||
- description: container id
|
||||
@ -8071,7 +8091,7 @@ paths:
|
||||
formatEN: update cronjob [name]
|
||||
formatZH: 更新计划任务 [name]
|
||||
paramKeys: []
|
||||
/dashboard/base/:ioOption/:netOption:
|
||||
/dashboard/base/{ioOption}/{netOption}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -8134,7 +8154,7 @@ paths:
|
||||
summary: Load dashboard current info
|
||||
tags:
|
||||
- Dashboard
|
||||
/dashboard/system/restart/:operation:
|
||||
/dashboard/system/restart/{operation}:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -8372,8 +8392,14 @@ paths:
|
||||
formatEN: create database [name][type]
|
||||
formatZH: 创建远程数据库 [name][type]
|
||||
paramKeys: []
|
||||
/databases/db/:name:
|
||||
/databases/db/{name}:
|
||||
get:
|
||||
parameters:
|
||||
- description: name
|
||||
in: path
|
||||
name: name
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -8446,8 +8472,14 @@ paths:
|
||||
formatEN: delete database [names]
|
||||
formatZH: 删除远程数据库 [names]
|
||||
paramKeys: []
|
||||
/databases/db/item/:type:
|
||||
/databases/db/item/{type}:
|
||||
get:
|
||||
parameters:
|
||||
- description: type
|
||||
in: path
|
||||
name: type
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -8461,8 +8493,14 @@ paths:
|
||||
summary: Retrieve database list based on type
|
||||
tags:
|
||||
- Database
|
||||
/databases/db/list/:type:
|
||||
/databases/db/list/{type}:
|
||||
get:
|
||||
parameters:
|
||||
- description: type
|
||||
in: path
|
||||
name: type
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -8627,7 +8665,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.MysqlLoadDB'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -8685,7 +8725,7 @@ paths:
|
||||
formatEN: create postgresql database [name]
|
||||
formatZH: 创建 postgresql 数据库 [name]
|
||||
paramKeys: []
|
||||
/databases/pg/:database/load:
|
||||
/databases/pg/{database}/load:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -8696,7 +8736,14 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.PostgresqlLoadDB'
|
||||
responses: {}
|
||||
- description: database
|
||||
in: path
|
||||
name: database
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -9332,6 +9379,8 @@ paths:
|
||||
paramKeys: []
|
||||
/files/chunkupload:
|
||||
post:
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
parameters:
|
||||
- description: request
|
||||
in: formData
|
||||
@ -9862,6 +9911,8 @@ paths:
|
||||
- File
|
||||
/files/upload:
|
||||
post:
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
parameters:
|
||||
- description: request
|
||||
in: formData
|
||||
@ -10152,7 +10203,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.Operate'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -10522,7 +10575,9 @@ paths:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: Array
|
||||
items:
|
||||
$ref: '#/definitions/dto.RedisCommand'
|
||||
type: array
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -10641,7 +10696,9 @@ paths:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: Array
|
||||
items:
|
||||
$ref: '#/definitions/dto.CommandTree'
|
||||
type: array
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -10892,7 +10949,7 @@ paths:
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
summary: Uodate address group
|
||||
summary: Update address group
|
||||
tags:
|
||||
- Firewall
|
||||
/hosts/firewall/update/description:
|
||||
@ -10994,7 +11051,7 @@ paths:
|
||||
summary: Page host
|
||||
tags:
|
||||
- Host
|
||||
/hosts/test/byid/:id:
|
||||
/hosts/test/byid/{id}:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -11394,7 +11451,7 @@ paths:
|
||||
formatEN: Create runtime [name]
|
||||
formatZH: 创建运行环境 [name]
|
||||
paramKeys: []
|
||||
/runtimes/:id:
|
||||
/runtimes/{id}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -12879,7 +12936,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.Operate'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -12904,7 +12963,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.OperateByID'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -13254,7 +13315,9 @@ paths:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: Array
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -13298,7 +13361,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.Operate'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -13323,7 +13388,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.Operate'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -13345,7 +13412,9 @@ paths:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: Array
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -13507,7 +13576,9 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.Operate'
|
||||
responses: {}
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
- Timestamp: []
|
||||
@ -13641,7 +13712,7 @@ paths:
|
||||
formatEN: Create website [primaryDomain]
|
||||
formatZH: 创建网站 [primaryDomain]
|
||||
paramKeys: []
|
||||
/websites/:id:
|
||||
/websites/{id}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -13662,7 +13733,7 @@ paths:
|
||||
summary: Search website by id
|
||||
tags:
|
||||
- Website
|
||||
/websites/:id/config/:type:
|
||||
/websites/{id}/config/{type}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -13672,6 +13743,11 @@ paths:
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: type
|
||||
in: path
|
||||
name: type
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -13683,7 +13759,7 @@ paths:
|
||||
summary: Search website nginx by id
|
||||
tags:
|
||||
- Website Nginx
|
||||
/websites/:id/https:
|
||||
/websites/{id}/https:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -13708,6 +13784,11 @@ paths:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: request
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: integer
|
||||
- description: request
|
||||
in: body
|
||||
name: request
|
||||
@ -14145,10 +14226,16 @@ paths:
|
||||
formatEN: Nginx conf update [domain]
|
||||
formatZH: nginx 配置修改 [domain]
|
||||
paramKeys: []
|
||||
/websites/default/html/:type:
|
||||
/websites/default/html/{type}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
parameters:
|
||||
- description: type
|
||||
in: path
|
||||
name: type
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@ -14478,7 +14565,7 @@ paths:
|
||||
formatEN: Create domain [domain]
|
||||
formatZH: 创建域名 [domain]
|
||||
paramKeys: []
|
||||
/websites/domains/:websiteId:
|
||||
/websites/domains/{websiteId}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -14740,7 +14827,7 @@ paths:
|
||||
formatEN: '[domain] PHP conf update'
|
||||
formatZH: '[domain] PHP 配置修改'
|
||||
paramKeys: []
|
||||
/websites/php/config/:id:
|
||||
/websites/php/config/{id}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -15103,7 +15190,7 @@ paths:
|
||||
formatEN: Create website ssl [primaryDomain]
|
||||
formatZH: 创建网站 ssl [primaryDomain]
|
||||
paramKeys: []
|
||||
/websites/ssl/:id:
|
||||
/websites/ssl/{id}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -15325,7 +15412,7 @@ paths:
|
||||
formatEN: Upload ssl [type]
|
||||
formatZH: 上传 ssl [type]
|
||||
paramKeys: []
|
||||
/websites/ssl/website/:websiteId:
|
||||
/websites/ssl/website/{websiteId}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -15385,7 +15472,7 @@ securityDefinitions:
|
||||
-H "1Panel-Timestamp: <current_unix_timestamp>"
|
||||
```
|
||||
- `1Panel-Token` is the key for the panel API Key.
|
||||
in: Header
|
||||
in: header
|
||||
name: 1Panel-Token
|
||||
type: apiKey
|
||||
Timestamp:
|
||||
|
@ -4,9 +4,10 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
_ "net/http/pprof"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/cmd/server/cmd"
|
||||
_ "github.com/1Panel-dev/1Panel/cmd/server/docs"
|
||||
_ "net/http/pprof"
|
||||
)
|
||||
|
||||
// @title 1Panel
|
||||
@ -28,7 +29,7 @@ import (
|
||||
// @description ```
|
||||
// @description - `1Panel-Token` is the key for the panel API Key.
|
||||
// @type apiKey
|
||||
// @in Header
|
||||
// @in header
|
||||
// @name 1Panel-Token
|
||||
|
||||
// @securityDefinitions.apikey Timestamp
|
||||
|
Loading…
x
Reference in New Issue
Block a user