aboutsummaryrefslogtreecommitdiff
path: root/go/operation/allocate_volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/operation/allocate_volume.go')
-rw-r--r--go/operation/allocate_volume.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/go/operation/allocate_volume.go b/go/operation/allocate_volume.go
deleted file mode 100644
index 3f96583e5..000000000
--- a/go/operation/allocate_volume.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package operation
-
-import (
- "code.google.com/p/weed-fs/go/storage"
- "code.google.com/p/weed-fs/go/topology"
- "code.google.com/p/weed-fs/go/util"
- "encoding/json"
- "errors"
- "net/url"
-)
-
-type AllocateVolumeResult struct {
- Error string
-}
-
-func AllocateVolume(dn *topology.DataNode, vid storage.VolumeId, collection string, repType storage.ReplicationType) error {
- values := make(url.Values)
- values.Add("volume", vid.String())
- values.Add("collection", collection)
- values.Add("replication", repType.String())
- jsonBlob, err := util.Post("http://"+dn.PublicUrl+"/admin/assign_volume", values)
- if err != nil {
- return err
- }
- var ret AllocateVolumeResult
- if err := json.Unmarshal(jsonBlob, &ret); err != nil {
- return err
- }
- if ret.Error != "" {
- return errors.New(ret.Error)
- }
- return nil
-}