package adminapi import ( "net/http" ) // AgentRestartView names the nodes whose agents were told to restart. type AgentRestartView struct { Nodes []string `json:"nodes"` } // SetAgentRestarter enables POST /api/v1/agents/restart. func (a *API) SetAgentRestarter(f func(reason string) []string) { a.restartAgents = f } func (a *API) restartAgentsHandler(w http.ResponseWriter, r *http.Request) { if a.restartAgents == nil { writeError(w, http.StatusNotImplemented, "this control plane has no agents to restart") return } nodes := a.restartAgents("llmgw restart, by " + actorOf(r)) writeJSON(w, http.StatusAccepted, AgentRestartView{Nodes: nodes}) }