"bufio"
"bytes"
"crypto/md5"
+ "encoding/json"
"errors"
"fmt"
"github.com/gorilla/mux"
for _, vol := range KeepVolumes {
st.Volumes[vol] = GetVolumeStatus(vol)
}
+
+ if jstat, err := json.Marshal(st); err == nil {
+ w.Write(jstat)
+ } else {
+ log.Printf("json.Marshal: %s\n", err)
+ log.Printf("NodeStatus = %v\n", st)
+ http.Error(w, err.Error(), 500)
+ }
}
// GetVolumeStatus