wings/api/routes_server.go

21 lines
1.2 KiB
Go
Raw Normal View History

package api
func (api *API) registerServerRoutes() {
api.router.GET("/servers", AuthHandler("c:list"), handleGetServers)
api.router.POST("/servers", AuthHandler("c:create"), handlePostServers)
2017-08-31 21:57:33 +00:00
api.router.GET("/servers/:server", AuthHandler("s:get"), handleGetServer)
api.router.PATCH("/servers/:server", AuthHandler("s:config"), handlePatchServer)
api.router.DELETE("/servers/:server", AuthHandler("g:server:delete"), handleDeleteServer)
2017-08-02 21:23:41 +00:00
2017-08-31 21:57:33 +00:00
api.router.POST("/servers/:server/reinstall", AuthHandler("s:install-server"), handlePostServerReinstall)
api.router.POST("/servers/:server/rebuild", AuthHandler("g:server:rebuild"), handlePostServerRebuild)
api.router.POST("/servers/:server/password", AuthHandler(""), handlePostServerPassword)
api.router.POST("/servers/:server/power", AuthHandler("s:power"), handlePostServerPower)
2017-08-31 21:57:33 +00:00
api.router.POST("/servers/:server/command", AuthHandler("s:command"), handlePostServerCommand)
api.router.GET("/servers/:server/log", AuthHandler("s:console"), handleGetServerLog)
api.router.POST("/servers/:server/suspend", AuthHandler(""), handlePostServerSuspend)
api.router.POST("/servers/:server/unsuspend", AuthHandler(""), handlePostServerUnsuspend)
}