filer: add API to add/modify/delete tagging

This commit is contained in:
Chris Lu
2020-11-09 01:00:07 -08:00
parent 4f676aa7d3
commit 6856b0d57e
3 changed files with 118 additions and 6 deletions

View File

@@ -26,11 +26,19 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
stats.FilerRequestHistogram.WithLabelValues("head").Observe(time.Since(start).Seconds())
case "DELETE":
stats.FilerRequestCounter.WithLabelValues("delete").Inc()
fs.DeleteHandler(w, r)
if _, ok := r.URL.Query()["tagging"]; ok {
fs.DeleteTaggingHandler(w,r)
} else {
fs.DeleteHandler(w, r)
}
stats.FilerRequestHistogram.WithLabelValues("delete").Observe(time.Since(start).Seconds())
case "PUT":
stats.FilerRequestCounter.WithLabelValues("put").Inc()
fs.PostHandler(w, r)
if _, ok := r.URL.Query()["tagging"]; ok {
fs.PutTaggingHandler(w,r)
} else {
fs.PostHandler(w, r)
}
stats.FilerRequestHistogram.WithLabelValues("put").Observe(time.Since(start).Seconds())
case "POST":
stats.FilerRequestCounter.WithLabelValues("post").Inc()