Remove unusued params and functions (#8399)

This commit is contained in:
Harshavardhana
2019-10-15 18:35:41 -07:00
committed by GitHub
parent b7ee0bbbc9
commit d48fd6fde9
33 changed files with 64 additions and 164 deletions

View File

@@ -19,7 +19,6 @@ package madmin
import (
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"strconv"
@@ -29,14 +28,12 @@ import (
// ServiceRestart - restarts the MinIO cluster
func (adm *AdminClient) ServiceRestart() error {
_, err := adm.serviceCallAction(ServiceActionRestart)
return err
return adm.serviceCallAction(ServiceActionRestart)
}
// ServiceStop - stops the MinIO cluster
func (adm *AdminClient) ServiceStop() error {
_, err := adm.serviceCallAction(ServiceActionStop)
return err
return adm.serviceCallAction(ServiceActionStop)
}
// ServiceAction - type to restrict service-action values
@@ -50,7 +47,7 @@ const (
)
// serviceCallAction - call service restart/update/stop API.
func (adm *AdminClient) serviceCallAction(action ServiceAction) ([]byte, error) {
func (adm *AdminClient) serviceCallAction(action ServiceAction) error {
queryValues := url.Values{}
queryValues.Set("action", string(action))
@@ -61,14 +58,14 @@ func (adm *AdminClient) serviceCallAction(action ServiceAction) ([]byte, error)
})
defer closeResponse(resp)
if err != nil {
return nil, err
return err
}
if resp.StatusCode != http.StatusOK {
return nil, httpRespToErrorResponse(resp)
return httpRespToErrorResponse(resp)
}
return ioutil.ReadAll(resp.Body)
return nil
}
// ServiceTraceInfo holds http trace