This commit is contained in:
@@ -106,6 +106,12 @@ func main() {
|
||||
scriptManageHandlers := handlers.NewScriptHandlersGroup(scriptSvc, cmdr,
|
||||
os.Getenv("WHEREAMI"))
|
||||
|
||||
graphPath := os.Getenv("GRAPH_YAML_PATH")
|
||||
if graphPath == "" {
|
||||
graphPath = "/etc/hellreign/services.yaml"
|
||||
}
|
||||
graphHandlers := handlers.NewGraphHandlers(graphPath)
|
||||
|
||||
agents := handlers.NewAgentsGroup(h, coll)
|
||||
auth := handlers.AuthGroup{Handlers: h}
|
||||
agentReg := handlers.NewAgentRegistrationGroup(h)
|
||||
@@ -212,6 +218,16 @@ func main() {
|
||||
jobsGroup.GET("/metrics", jobsHandlers.GetJobMetrics)
|
||||
}
|
||||
|
||||
// Service dependency graph (requires admin permission)
|
||||
graphGroup := v1.Group("/graph")
|
||||
graphGroup.Use(auth.AuthMiddleware(), handlers.RequireAdmin())
|
||||
{
|
||||
graphGroup.GET("", graphHandlers.GetYAML)
|
||||
graphGroup.PUT("", graphHandlers.UpdateYAML)
|
||||
graphGroup.GET("/order", graphHandlers.StartupOrder)
|
||||
graphGroup.GET("/cycle", graphHandlers.CycleCheck)
|
||||
}
|
||||
|
||||
// Agent registration
|
||||
agentRegGroup := v1.Group("/agents")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user