mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
@@ -39,7 +39,6 @@ func main() {
|
||||
| Service operations|LockInfo operations|Healing operations|
|
||||
|:---|:---|:---|
|
||||
|[`ServiceStatus`](#ServiceStatus)| | |
|
||||
|[`ServiceStop`](#ServiceStop)| | |
|
||||
|[`ServiceRestart`](#ServiceRestart)| | |
|
||||
|
||||
## 1. Constructor
|
||||
@@ -98,23 +97,6 @@ Fetch service status, replies disk space used, backend type and total disks offl
|
||||
|
||||
```
|
||||
|
||||
<a name="ServiceStop"></a>
|
||||
### ServiceStop() (error)
|
||||
If successful shuts down the running minio service, for distributed setup stops all remote minio servers.
|
||||
|
||||
__Example__
|
||||
|
||||
|
||||
```go
|
||||
|
||||
st, err := madmClnt.ServiceStop()
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
log.Printf("Succes")
|
||||
|
||||
```
|
||||
|
||||
<a name="ServiceRestart"></a>
|
||||
### ServiceRestart() (error)
|
||||
If successful restarts the running minio service, for distributed setup restarts all remote minio servers.
|
||||
|
||||
@@ -105,7 +105,6 @@ go run service-status.go
|
||||
### API Reference : Service Operations
|
||||
|
||||
* [`ServiceStatus`](./API.md#ServiceStatus)
|
||||
* [`ServiceStop`](./API.md#ServiceStop)
|
||||
* [`ServiceRestart`](./API.md#ServiceRestart)
|
||||
|
||||
## Full Examples
|
||||
@@ -113,7 +112,6 @@ go run service-status.go
|
||||
#### Full Examples : Service Operations
|
||||
|
||||
* [service-status.go](https://github.com/minio/minio/blob/master/pkg/madmin/examples/service-status.go)
|
||||
* [service-stop.go](https://github.com/minio/minio/blob/master/pkg/madmin/examples/service-stop.go)
|
||||
* [service-restart.go](https://github.com/minio/minio/blob/master/pkg/madmin/examples/service-restart.go)
|
||||
|
||||
## Contribute
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
// +build ignore
|
||||
|
||||
/*
|
||||
* Minio Cloud Storage, (C) 2016 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/minio/minio/pkg/madmin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
|
||||
// dummy values, please replace them with original values.
|
||||
|
||||
// API requests are secure (HTTPS) if secure=true and insecure (HTTPS) otherwise.
|
||||
// New returns an Minio Admin client object.
|
||||
madmClnt, err := madmin.New("your-minio.example.com:9000", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
err = madmClnt.ServiceStop()
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
log.Println("Success")
|
||||
}
|
||||
@@ -95,30 +95,6 @@ func (adm *AdminClient) ServiceStatus() (ServiceStatusMetadata, error) {
|
||||
return storageInfo, nil
|
||||
}
|
||||
|
||||
// ServiceStop - Call Service Stop Management API to stop a specified Minio server
|
||||
func (adm *AdminClient) ServiceStop() error {
|
||||
//
|
||||
reqData := requestData{}
|
||||
reqData.queryValues = make(url.Values)
|
||||
reqData.queryValues.Set("service", "")
|
||||
reqData.customHeaders = make(http.Header)
|
||||
reqData.customHeaders.Set(minioAdminOpHeader, "stop")
|
||||
|
||||
// Execute GET on bucket to list objects.
|
||||
resp, err := adm.executeMethod("POST", reqData)
|
||||
|
||||
defer closeResponse(resp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return errors.New("Got HTTP Status: " + resp.Status)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServiceRestart - Call Service Restart API to restart a specified Minio server
|
||||
func (adm *AdminClient) ServiceRestart() error {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user