MCPcopy Create free account
hub / github.com/cloudbase/garm / InstanceSystemInfoHandler

Method InstanceSystemInfoHandler

apiserver/controllers/instances.go:398–416  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

396}
397
398func (a *APIController) InstanceSystemInfoHandler(w http.ResponseWriter, r *http.Request) {
399 ctx := r.Context()
400
401 var updateMessage runnerParams.UpdateSystemInfoParams
402 if err := json.NewDecoder(r.Body).Decode(&updateMessage); err != nil {
403 slog.With(slog.Any("error", err)).ErrorContext(ctx, "failed to decode")
404 handleError(ctx, w, gErrors.ErrBadRequest)
405 return
406 }
407
408 if err := a.r.UpdateSystemInfo(ctx, updateMessage); err != nil {
409 slog.With(slog.Any("error", err)).ErrorContext(ctx, "error saving status message")
410 handleError(ctx, w, err)
411 return
412 }
413
414 w.Header().Set("Content-Type", "application/json")
415 w.WriteHeader(http.StatusOK)
416}

Callers

nothing calls this directly

Calls 3

handleErrorFunction · 0.85
UpdateSystemInfoMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected