(w http.ResponseWriter, r *http.Request, nodeID string)
| 429 | } |
| 430 | |
| 431 | func (a *API) handleNodeConfig(w http.ResponseWriter, r *http.Request, nodeID string) { |
| 432 | if r.Method != http.MethodGet { |
| 433 | writeMethodNotAllowed(w, http.MethodGet) |
| 434 | return |
| 435 | } |
| 436 | client, err := a.clientFor(nodeID) |
| 437 | if err != nil { |
| 438 | writeNodeError(w, err) |
| 439 | return |
| 440 | } |
| 441 | ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second) |
| 442 | defer cancel() |
| 443 | out, err := client.Config(ctx) |
| 444 | if err != nil { |
| 445 | writeJSON(w, http.StatusUnprocessableEntity, map[string]any{"error": err.Error()}) |
| 446 | return |
| 447 | } |
| 448 | writeJSON(w, http.StatusOK, out) |
| 449 | } |
| 450 | |
| 451 | func (a *API) handleNodeLogs(w http.ResponseWriter, r *http.Request, nodeID string) { |
| 452 | if r.Method != http.MethodGet { |
no test coverage detected