github.com/ilhicas/nomad@v0.11.8/command/agent/http_oss.go (about) 1 // +build !ent 2 3 package agent 4 5 import ( 6 "net/http" 7 ) 8 9 // registerEnterpriseHandlers is a no-op for the oss release 10 func (s *HTTPServer) registerEnterpriseHandlers() { 11 s.mux.HandleFunc("/v1/namespaces", s.wrap(s.entOnly)) 12 s.mux.HandleFunc("/v1/namespace", s.wrap(s.entOnly)) 13 s.mux.HandleFunc("/v1/namespace/", s.wrap(s.entOnly)) 14 15 s.mux.HandleFunc("/v1/sentinel/policies", s.wrap(s.entOnly)) 16 s.mux.HandleFunc("/v1/sentinel/policy/", s.wrap(s.entOnly)) 17 18 s.mux.HandleFunc("/v1/quotas", s.wrap(s.entOnly)) 19 s.mux.HandleFunc("/v1/quota-usages", s.wrap(s.entOnly)) 20 s.mux.HandleFunc("/v1/quota/", s.wrap(s.entOnly)) 21 s.mux.HandleFunc("/v1/quota", s.wrap(s.entOnly)) 22 23 s.mux.HandleFunc("/v1/operator/license", s.wrap(s.entOnly)) 24 } 25 26 func (s *HTTPServer) entOnly(resp http.ResponseWriter, req *http.Request) (interface{}, error) { 27 return nil, CodedError(501, ErrEntOnly) 28 } 29 30 // auditHandler wraps the passed handlerFn 31 func (s *HTTPServer) auditHandler(h handlerFn) handlerFn { 32 return h 33 } 34 35 // auditHTTPHandler wraps the passed handlerByteFn 36 func (s *HTTPServer) auditNonJSONHandler(h handlerByteFn) handlerByteFn { 37 return h 38 } 39 40 // auditHTTPHandler wraps the passed http.Handler 41 func (s *HTTPServer) auditHTTPHandler(h http.Handler) http.Handler { 42 return h 43 }