aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorsparklxb <sparklxb@163.com>2017-01-09 23:34:07 +0800
committersparklxb <sparklxb@163.com>2017-01-09 23:34:47 +0800
commit66e7013dfe1f14f6436c07a0ccf5aaa19ea599f7 (patch)
tree0e25010198857b9ef164a6c538acb5063b74a38f /weed/command
parent53cf1b4900630883ef38a95324cda29f50e75b8d (diff)
downloadseaweedfs-66e7013dfe1f14f6436c07a0ccf5aaa19ea599f7.tar.xz
seaweedfs-66e7013dfe1f14f6436c07a0ccf5aaa19ea599f7.zip
suport uploading files to specific dataCenter
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/filer_copy.go2
-rw-r--r--weed/command/upload.go6
2 files changed, 5 insertions, 3 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index 2aa994f6f..da7fb43bb 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -126,7 +126,7 @@ func doEachCopy(fileOrDir string, host string, path string) bool {
}
results, err := operation.SubmitFiles(*copy.master, parts,
- *copy.replication, *copy.collection,
+ *copy.replication, *copy.collection, "",
*copy.ttl, *copy.maxMB, copy.secret)
if err != nil {
fmt.Printf("Failed to submit file %s: %v", fileOrDir, err)
diff --git a/weed/command/upload.go b/weed/command/upload.go
index d7a468610..72ef0af73 100644
--- a/weed/command/upload.go
+++ b/weed/command/upload.go
@@ -20,6 +20,7 @@ type UploadOptions struct {
include *string
replication *string
collection *string
+ dataCenter *string
ttl *string
maxMB *int
secretKey *string
@@ -33,6 +34,7 @@ func init() {
upload.include = cmdUpload.Flag.String("include", "", "pattens of files to upload, e.g., *.pdf, *.html, ab?d.txt, works together with -dir")
upload.replication = cmdUpload.Flag.String("replication", "", "replication type")
upload.collection = cmdUpload.Flag.String("collection", "", "optional collection name")
+ upload.dataCenter = cmdUpload.Flag.String("dataCenter", "", "optional data center name")
upload.ttl = cmdUpload.Flag.String("ttl", "", "time to live, e.g.: 1m, 1h, 1d, 1M, 1y")
upload.maxMB = cmdUpload.Flag.Int("maxMB", 0, "split files larger than the limit")
upload.secretKey = cmdUpload.Flag.String("secure.secret", "", "secret to encrypt Json Web Token(JWT)")
@@ -80,7 +82,7 @@ func runUpload(cmd *Command, args []string) bool {
return e
}
results, e := operation.SubmitFiles(*upload.master, parts,
- *upload.replication, *upload.collection,
+ *upload.replication, *upload.collection, *upload.dataCenter,
*upload.ttl, *upload.maxMB, secret)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
@@ -99,7 +101,7 @@ func runUpload(cmd *Command, args []string) bool {
fmt.Println(e.Error())
}
results, _ := operation.SubmitFiles(*upload.master, parts,
- *upload.replication, *upload.collection,
+ *upload.replication, *upload.collection, *upload.dataCenter,
*upload.ttl, *upload.maxMB, secret)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))