-// MountBlocks responds to "GET /mounts/{uuid}/blocks" requests.
-func (rtr *router) MountBlocks(resp http.ResponseWriter, req *http.Request) {
- if !IsSystemAuth(GetAPIToken(req)) {
- http.Error(resp, UnauthorizedError.Error(), UnauthorizedError.HTTPCode)
- return
- }
-
- uuid := mux.Vars(req)["uuid"]
- prefix := mux.Vars(req)["prefix"]
- if v := KeepVM.Lookup(uuid, false); v == nil {
- http.Error(resp, "mount not found", http.StatusNotFound)
- } else if err := v.IndexTo(prefix, resp); err != nil {
- http.Error(resp, err.Error(), http.StatusInternalServerError)
- } else {
- resp.Write([]byte{'\n'})
- }
-}
-