aboutsummaryrefslogtreecommitdiff
path: root/go/topology/allocate_volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/topology/allocate_volume.go')
-rw-r--r--go/topology/allocate_volume.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/go/topology/allocate_volume.go b/go/topology/allocate_volume.go
deleted file mode 100644
index f014c3527..000000000
--- a/go/topology/allocate_volume.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package topology
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "net/url"
-
- "github.com/chrislusf/seaweedfs/go/storage"
- "github.com/chrislusf/seaweedfs/go/util"
-)
-
-type AllocateVolumeResult struct {
- Error string
-}
-
-func AllocateVolume(dn *DataNode, vid storage.VolumeId, option *VolumeGrowOption) error {
- values := make(url.Values)
- values.Add("volume", vid.String())
- values.Add("collection", option.Collection)
- values.Add("replication", option.ReplicaPlacement.String())
- values.Add("ttl", option.Ttl.String())
- jsonBlob, err := util.Post("http://"+dn.Url()+"/admin/assign_volume", values)
- if err != nil {
- return err
- }
- var ret AllocateVolumeResult
- if err := json.Unmarshal(jsonBlob, &ret); err != nil {
- return fmt.Errorf("Invalid JSON result for %s: %s", "/admin/assign_volum", string(jsonBlob))
- }
- if ret.Error != "" {
- return errors.New(ret.Error)
- }
- return nil
-}