removing set volume location
display version number add default replication type
This commit is contained in:
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"math/rand"
|
||||
"mime"
|
||||
@@ -53,21 +52,6 @@ func assignVolumeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("volume =", r.FormValue("volume"), ", replicationType =", r.FormValue("replicationType"), ", error =", err)
|
||||
}
|
||||
}
|
||||
func setVolumeLocationsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if *IsDebug {
|
||||
log.Println("volumeLocationsList =", r.FormValue("volumeLocationsList"))
|
||||
}
|
||||
volumeLocationsList := new([]storage.VolumeLocations)
|
||||
err := json.Unmarshal([]byte(r.FormValue("volumeLocationsList")), volumeLocationsList)
|
||||
if err == nil {
|
||||
err = store.SetVolumeLocations(*volumeLocationsList)
|
||||
}
|
||||
if err == nil {
|
||||
writeJson(w, r, map[string]string{"error": ""})
|
||||
} else {
|
||||
writeJson(w, r, map[string]string{"error": err.Error()})
|
||||
}
|
||||
}
|
||||
func storeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case "GET":
|
||||
@@ -239,7 +223,6 @@ func runVolume(cmd *Command, args []string) bool {
|
||||
http.HandleFunc("/", storeHandler)
|
||||
http.HandleFunc("/status", statusHandler)
|
||||
http.HandleFunc("/admin/assign_volume", assignVolumeHandler)
|
||||
http.HandleFunc("/admin/set_volume_locations_list", setVolumeLocationsHandler)
|
||||
|
||||
go func() {
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user