Merge branch 'wtsi/13809-root_url-protocol-port-configuration'
[arvados.git] / services / keepstore / handlers.go
index 258604ce59c50176a4d4473fd7dbf87c8d66de9c..c31ab9c2e38fde497f451e95c2a99437735e4455 100644 (file)
@@ -86,17 +86,11 @@ func MakeRESTRouter() http.Handler {
        // 400 Bad Request.
        rtr.NotFoundHandler = http.HandlerFunc(BadRequestHandler)
 
-       theConfig.metrics.setup()
-
        rtr.limiter = httpserver.NewRequestLimiter(theConfig.MaxRequests, rtr)
 
-       mux := http.NewServeMux()
-       mux.Handle("/", theConfig.metrics.Instrument(
-               httpserver.AddRequestIDs(httpserver.LogRequests(rtr.limiter))))
-       mux.HandleFunc("/metrics.json", theConfig.metrics.exportJSON)
-       mux.Handle("/metrics", theConfig.metrics.exportProm)
-
-       return mux
+       stack := httpserver.Instrument(nil, nil,
+               httpserver.AddRequestIDs(httpserver.LogRequests(nil, rtr.limiter)))
+       return stack.ServeAPI(stack)
 }
 
 // BadRequestHandler is a HandleFunc to address bad requests.
@@ -514,7 +508,7 @@ type PullRequest struct {
        Servers []string `json:"servers"`
 
        // Destination mount, or "" for "anywhere"
-       MountUUID string
+       MountUUID string `json:"mount_uuid"`
 }
 
 // PullHandler processes "PUT /pull" requests for the data manager.
@@ -547,13 +541,13 @@ func PullHandler(resp http.ResponseWriter, req *http.Request) {
        pullq.ReplaceQueue(plist)
 }
 
-// TrashRequest consists of a block locator and it's Mtime
+// TrashRequest consists of a block locator and its Mtime
 type TrashRequest struct {
        Locator    string `json:"locator"`
        BlockMtime int64  `json:"block_mtime"`
 
        // Target mount, or "" for "everywhere"
-       MountUUID string
+       MountUUID string `json:"mount_uuid"`
 }
 
 // TrashHandler processes /trash requests.