Api: add cache reset (#18941)
This commit is contained in:
parent
634bc4513d
commit
d405ee4ba6
2 changed files with 6 additions and 0 deletions
|
|
@ -301,6 +301,7 @@ func (s *HTTPd) RegisterSystemHandler(valueChan chan<- util.Param, cache *util.P
|
|||
routes := map[string]route{
|
||||
"log": {"GET", "/log", logHandler},
|
||||
"logareas": {"GET", "/log/areas", logAreasHandler},
|
||||
"reset": {"POST", "/reset", resetHandler},
|
||||
"shutdown": {"POST", "/shutdown", func(w http.ResponseWriter, r *http.Request) {
|
||||
shutdown()
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
|
|
|
|||
|
|
@ -292,6 +292,11 @@ func logAreasHandler(w http.ResponseWriter, r *http.Request) {
|
|||
jsonResult(w, logstash.Areas())
|
||||
}
|
||||
|
||||
func resetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
util.ResetCached()
|
||||
jsonResult(w, "OK")
|
||||
}
|
||||
|
||||
func logHandler(w http.ResponseWriter, r *http.Request) {
|
||||
a := r.URL.Query()["area"]
|
||||
l := logstash.LogLevelToThreshold(r.URL.Query().Get("level"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue