github.com/thomasobenaus/nomad@v0.11.1/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  
    24  func (s *HTTPServer) entOnly(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
    25  	return nil, CodedError(501, ErrEntOnly)
    26  }
    27  
    28  // auditHandler wraps the passed handlerFn
    29  func (s *HTTPServer) auditHandler(h handlerFn) handlerFn {
    30  	return h
    31  }
    32  
    33  // auditHTTPHandler wraps  the passed handlerByteFn
    34  func (s *HTTPServer) auditNonJSONHandler(h handlerByteFn) handlerByteFn {
    35  	return h
    36  }
    37  
    38  // auditHTTPHandler wraps the passed http.Handler
    39  func (s *HTTPServer) auditHTTPHandler(h http.Handler) http.Handler {
    40  	return h
    41  }