admin: Heal format in heal command (#1980)

This commit is contained in:
Anis Elleuch
2017-01-24 15:05:32 -08:00
committed by Harshavardhana
parent 973dc13cc0
commit 38c3703d08
5 changed files with 29 additions and 29 deletions
+9 -2
View File
@@ -251,13 +251,20 @@ __Example__
```
<a name="HealFormat"></a>
### HealFormat() error
### HealFormat(isDryRun bool) error
Heal storage format on available disks. This is used when disks were replaced or were found with missing format. This is supported only for erasure-coded backend.
__Example__
``` go
err := madmClnt.HealFormat()
isDryRun := true
err := madmClnt.HealFormat(isDryRun)
if err != nil {
log.Fatalln(err)
}
isDryRun = false
err = madmClnt.HealFormat(isDryRun)
if err != nil {
log.Fatalln(err)
}
-8
View File
@@ -31,7 +31,6 @@ import (
"regexp"
"runtime"
"strings"
"time"
"github.com/minio/minio-go/pkg/s3signer"
"github.com/minio/minio-go/pkg/s3utils"
@@ -165,13 +164,6 @@ func (c *AdminClient) SetCustomTransport(customHTTPTransport http.RoundTripper)
}
}
// SetTimeout - set http client timeout.
func (c *AdminClient) SetTimeout(timeout time.Duration) {
if c.httpClient != nil {
c.httpClient.Timeout = timeout
}
}
// TraceOn - enable HTTP tracing.
func (c *AdminClient) TraceOn(outputStream io.Writer) {
// if outputStream is nil then default to os.Stdout.
+6 -3
View File
@@ -344,7 +344,7 @@ func (adm *AdminClient) HealBucket(bucket string, dryrun bool) error {
queryVal.Set("heal", "")
queryVal.Set(string(healBucket), bucket)
if dryrun {
queryVal.Set(string(healDryRun), "yes")
queryVal.Set(string(healDryRun), "")
}
hdrs := make(http.Header)
@@ -378,7 +378,7 @@ func (adm *AdminClient) HealObject(bucket, object string, dryrun bool) error {
queryVal.Set(string(healBucket), bucket)
queryVal.Set(string(healObject), object)
if dryrun {
queryVal.Set(string(healDryRun), "yes")
queryVal.Set(string(healDryRun), "")
}
hdrs := make(http.Header)
@@ -405,9 +405,12 @@ func (adm *AdminClient) HealObject(bucket, object string, dryrun bool) error {
}
// HealFormat - heal storage format on available disks.
func (adm *AdminClient) HealFormat() error {
func (adm *AdminClient) HealFormat(dryrun bool) error {
queryVal := url.Values{}
queryVal.Set("heal", "")
if dryrun {
queryVal.Set(string(healDryRun), "")
}
// Set x-minio-operation to format.
hdrs := make(http.Header)