diff --git a/http.go b/http.go index 8a8a5b8..9a3bbbd 100644 --- a/http.go +++ b/http.go @@ -543,31 +543,6 @@ func (rt *Router) routeServerBackup(w http.ResponseWriter, r *http.Request, ps h w.WriteHeader(http.StatusAccepted) } -func (rt *Router) routeServerBackup(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - s := rt.GetServer(ps.ByName("server")) - defer r.Body.Close() - - data := rt.ReaderToBytes(r.Body) - b, err := s.NewBackup(data) - if err != nil { - zap.S().Errorw("failed to create backup struct for server", zap.String("server", s.Uuid), zap.Error(err)) - - http.Error(w, "failed to update data structure", http.StatusInternalServerError) - return - } - - zap.S().Infow("starting backup process for server", zap.String("server", s.Uuid), zap.String("backup", b.Uuid)) - go func(bk *server.Backup) { - if err := bk.BackupAndNotify(); err != nil { - zap.S().Errorw("failed to generate backup for server", zap.Error(err)) - } else { - zap.S().Infow("completed backup process for server", zap.String("backup", b.Uuid)) - } - }(b) - - w.WriteHeader(http.StatusAccepted) -} - func (rt *Router) routeSystemInformation(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { defer r.Body.Close()