Skip to content

Commit

Permalink
cluster/http: handle boot
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 25, 2024
1 parent 287cddc commit cf988c1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion internal/cluster/http/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,25 @@ func (s *Service) handleEvent(w http.ResponseWriter, r *http.Request, params Que
}
func (s *Service) handleBackup(w http.ResponseWriter, r *http.Request, params QueryParams) {}
func (s *Service) handleLoad(w http.ResponseWriter, r *http.Request, params QueryParams) {}
func (s *Service) handleBoot(w http.ResponseWriter, r *http.Request, params QueryParams) {}
func (s *Service) handleNodes(w http.ResponseWriter, r *http.Request, params QueryParams) {}
func (s *Service) handleRemove(w http.ResponseWriter, r *http.Request, params QueryParams) {}
func (s *Service) handleBoot(w http.ResponseWriter, r *http.Request, params QueryParams) {
if !s.CheckRequestPerm(r, v1.Credential_LOAD) {
w.WriteHeader(http.StatusUnauthorized)
return
}

if r.Method != "POST" {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
s.log.Info("Starting booting process")
_, err := s.store.ReadFrom(r.Context(), r.Body)
if err != nil {
http.Error(w, err.Error(), http.StatusServiceUnavailable)
return
}
}
func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request, params QueryParams) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
if !s.CheckRequestPerm(r, v1.Credential_STATUS) {
Expand Down

0 comments on commit cf988c1

Please sign in to comment.