show volume status

This commit is contained in:
Chris Lu
2012-10-10 01:10:05 -07:00
parent 1d0be87e0e
commit 3aefea0fe2
2 changed files with 35 additions and 0 deletions

View File

@@ -143,6 +143,13 @@ func volumeGrowHandler(w http.ResponseWriter, r *http.Request) {
}
}
func volumeStatusHandler(w http.ResponseWriter, r *http.Request) {
m := make(map[string]interface{})
m["Version"] = VERSION
m["Volumes"] = topo.ToVolumeMap()
writeJson(w, r, m)
}
func runMaster(cmd *Command, args []string) bool {
if *mMaxCpu < 1 {
*mMaxCpu = runtime.NumCPU()
@@ -156,6 +163,7 @@ func runMaster(cmd *Command, args []string) bool {
http.HandleFunc("/dir/join", dirJoinHandler)
http.HandleFunc("/dir/status", dirStatusHandler)
http.HandleFunc("/vol/grow", volumeGrowHandler)
http.HandleFunc("/vol/status", volumeStatusHandler)
topo.StartRefreshWritableVolumes()