mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-02 13:48:43 +00:00
simplify routes (#437)
This commit is contained in:
parent
72aa979644
commit
fd9448cad7
2 changed files with 6 additions and 21 deletions
|
@ -113,22 +113,11 @@ func apiRoutes(e *gin.Engine) {
|
||||||
|
|
||||||
queue := e.Group("/api/queue")
|
queue := e.Group("/api/queue")
|
||||||
{
|
{
|
||||||
queue.GET("/info",
|
queue.Use(session.MustAdmin())
|
||||||
session.MustAdmin(),
|
queue.GET("/info", api.GetQueueInfo)
|
||||||
api.GetQueueInfo,
|
queue.GET("/pause", api.PauseQueue)
|
||||||
)
|
queue.GET("/resume", api.ResumeQueue)
|
||||||
queue.GET("/pause",
|
queue.GET("/norunningbuilds", api.BlockTilQueueHasRunningItem)
|
||||||
session.MustAdmin(),
|
|
||||||
api.PauseQueue,
|
|
||||||
)
|
|
||||||
queue.GET("/resume",
|
|
||||||
session.MustAdmin(),
|
|
||||||
api.ResumeQueue,
|
|
||||||
)
|
|
||||||
queue.GET("/norunningbuilds",
|
|
||||||
session.MustAdmin(),
|
|
||||||
api.BlockTilQueueHasRunningItem,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
debugger := e.Group("/api/debug")
|
debugger := e.Group("/api/debug")
|
||||||
|
|
|
@ -67,11 +67,7 @@ func Load(serveHTTP func(w http.ResponseWriter, r *http.Request), middleware ...
|
||||||
auth.POST("/token", api.GetLoginToken)
|
auth.POST("/token", api.GetLoginToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor := e.Group("/metrics")
|
e.GET("/metrics", metrics.PromHandler())
|
||||||
{
|
|
||||||
monitor.GET("", metrics.PromHandler())
|
|
||||||
}
|
|
||||||
|
|
||||||
e.GET("/version", api.Version)
|
e.GET("/version", api.Version)
|
||||||
e.GET("/healthz", api.Health)
|
e.GET("/healthz", api.Health)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue