maintenance/maintenance.go
func (s Service) OnHandler(w http.ResponseWriter, r *http.Request) {
	changed, err := s.store.On()
	if err != nil {
		s.logger.Errorf("maintenance on: %s", err)
		jsonInternalServerErrorResponse(w)
		return
	}
	if changed {
		s.logger.Infof("maintenance on")
		jsonCreatedResponse(w)
		return
	}
	jsonOKResponse(w)
}
func (s Service) OnHandler(w http.ResponseWriter, r *http.Request) {
	changed, err := s.store.On()
	if err != nil {
		s.logger.Errorf("maintenance on: %s", err)
		jsonInternalServerErrorResponse(w)
		return
	}
	if changed {
		s.logger.Infof("maintenance on")
		jsonCreatedResponse(w)
		return
	}
	jsonOKResponse(w)
}
// OnHandler can be used in JSON-encoded HTTP API to enable maintenance.
// It returns HTTP Status Created if the maintenance is enabled.
// If the maintenance is already enabled, it returns HTTP Status OK.