1Panel/backend/router/ro_container.go

82 lines
3.3 KiB
Go
Raw Normal View History

package router
import (
2022-10-18 18:39:45 +08:00
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
"github.com/1Panel-dev/1Panel/backend/middleware"
"github.com/gin-gonic/gin"
)
type ContainerRouter struct{}
func (s *ContainerRouter) InitContainerRouter(Router *gin.RouterGroup) {
baRouter := Router.Group("containers").
Use(middleware.JwtAuth()).
Use(middleware.SessionAuth()).
Use(middleware.PasswordExpired())
baseApi := v1.ApiGroupApp.BaseApi
{
2023-02-24 18:50:35 +08:00
baRouter.GET("/exec", baseApi.ContainerWsSsh)
2022-11-16 18:27:22 +08:00
baRouter.GET("/stats/:id", baseApi.ContainerStats)
2022-10-18 18:39:45 +08:00
baRouter.POST("", baseApi.ContainerCreate)
2023-06-15 11:00:11 +08:00
baRouter.POST("/update", baseApi.ContainerUpdate)
baRouter.POST("/upgrade", baseApi.ContainerUpgrade)
2023-06-15 11:00:11 +08:00
baRouter.POST("/info", baseApi.ContainerInfo)
baRouter.POST("/search", baseApi.SearchContainer)
baRouter.POST("/list", baseApi.ListContainer)
baRouter.GET("/list/stats", baseApi.ContainerListStats)
baRouter.GET("/search/log", baseApi.ContainerLogs)
baRouter.GET("/limit", baseApi.LoadResouceLimit)
baRouter.POST("/clean/log", baseApi.CleanContainerLog)
2022-10-11 19:47:16 +08:00
baRouter.POST("/inspect", baseApi.Inspect)
baRouter.POST("/operate", baseApi.ContainerOperation)
baRouter.POST("/prune", baseApi.ContainerPrune)
2022-10-09 16:17:15 +08:00
baRouter.GET("/repo", baseApi.ListRepo)
2023-02-27 11:46:23 +08:00
baRouter.POST("/repo/status", baseApi.CheckRepoStatus)
baRouter.POST("/repo/search", baseApi.SearchRepo)
baRouter.POST("/repo/update", baseApi.UpdateRepo)
baRouter.POST("/repo", baseApi.CreateRepo)
baRouter.POST("/repo/del", baseApi.DeleteRepo)
2022-10-17 16:04:39 +08:00
baRouter.POST("/compose/search", baseApi.SearchCompose)
2022-12-06 15:05:13 +08:00
baRouter.POST("/compose", baseApi.CreateCompose)
baRouter.POST("/compose/test", baseApi.TestCompose)
2022-10-17 16:04:39 +08:00
baRouter.POST("/compose/operate", baseApi.OperatorCompose)
2022-12-06 15:05:13 +08:00
baRouter.POST("/compose/update", baseApi.ComposeUpdate)
2022-10-17 16:04:39 +08:00
baRouter.GET("/template", baseApi.ListComposeTemplate)
baRouter.POST("/template/search", baseApi.SearchComposeTemplate)
baRouter.POST("/template/update", baseApi.UpdateComposeTemplate)
baRouter.POST("/template", baseApi.CreateComposeTemplate)
baRouter.POST("/template/del", baseApi.DeleteComposeTemplate)
2022-10-17 09:10:06 +08:00
2022-10-12 18:55:47 +08:00
baRouter.GET("/image", baseApi.ListImage)
baRouter.POST("/image/search", baseApi.SearchImage)
baRouter.POST("/image/pull", baseApi.ImagePull)
baRouter.POST("/image/push", baseApi.ImagePush)
baRouter.POST("/image/save", baseApi.ImageSave)
baRouter.POST("/image/load", baseApi.ImageLoad)
baRouter.POST("/image/remove", baseApi.ImageRemove)
2022-10-11 17:46:52 +08:00
baRouter.POST("/image/tag", baseApi.ImageTag)
2022-10-12 13:42:58 +08:00
baRouter.POST("/image/build", baseApi.ImageBuild)
2022-10-11 14:20:51 +08:00
baRouter.GET("/network", baseApi.ListNetwork)
2022-10-11 14:20:51 +08:00
baRouter.POST("/network/del", baseApi.DeleteNetwork)
baRouter.POST("/network/search", baseApi.SearchNetwork)
baRouter.POST("/network", baseApi.CreateNetwork)
baRouter.GET("/volume", baseApi.ListVolume)
2022-10-11 14:20:51 +08:00
baRouter.POST("/volume/del", baseApi.DeleteVolume)
baRouter.POST("/volume/search", baseApi.SearchVolume)
baRouter.POST("/volume", baseApi.CreateVolume)
2022-11-14 19:19:42 +08:00
baRouter.GET("/daemonjson", baseApi.LoadDaemonJson)
baRouter.GET("/daemonjson/file", baseApi.LoadDaemonJsonFile)
2023-01-04 22:31:51 +08:00
baRouter.GET("/docker/status", baseApi.LoadDockerStatus)
2022-12-07 17:28:14 +08:00
baRouter.POST("/docker/operate", baseApi.OperateDocker)
2022-11-14 19:19:42 +08:00
baRouter.POST("/daemonjson/update", baseApi.UpdateDaemonJson)
baRouter.POST("/logoption/update", baseApi.UpdateLogOption)
2022-11-14 19:19:42 +08:00
baRouter.POST("/daemonjson/update/byfile", baseApi.UpdateDaemonJsonByFile)
}
}