admin: ServerInfo() returns info for each node (#4150)

ServerInfo() will gather information from all nodes before returning
it back to the client.
This commit is contained in:
Anis Elleuch
2017-04-21 15:15:53 +01:00
committed by Harshavardhana
parent df346753e1
commit 83abad0b37
8 changed files with 197 additions and 110 deletions

View File

@@ -122,7 +122,30 @@ If successful restarts the running minio service, for distributed setup restarts
```
## 3. Lock operations
## 3. Info operations
<a name="ServerInfo"></a>
### ServerInfo() ([]ServerInfo, error)
Fetch all information for all cluster nodes, such as uptime, region, network statistics, etc..
__Example__
```go
serversInfo, err := madmClnt.ServerInfo()
if err != nil {
log.Fatalln(err)
}
for _, peerInfo := range serversInfo {
log.Printf("Node: %s, Info: %v\n", peerInfo.Addr, peerInfo.Data)
}
```
## 4. Lock operations
<a name="ListLocks"></a>
### ListLocks(bucket, prefix string, duration time.Duration) ([]VolumeLockInfo, error)
@@ -154,7 +177,7 @@ __Example__
```
## 4. Heal operations
## 5. Heal operations
<a name="ListObjectsHeal"></a>
### ListObjectsHeal(bucket, prefix string, recursive bool, doneCh <-chan struct{}) (<-chan ObjectInfo, error)
@@ -360,7 +383,7 @@ If upload is successfully healed returns nil, otherwise returns error indicating
log.Println("Heal-upload result: ", healResult)
```
## 5. Config operations
## 6. Config operations
<a name="GetConfig"></a>
### GetConfig() ([]byte, error)
@@ -384,23 +407,6 @@ __Example__
log.Println("config received successfully: ", string(buf.Bytes()))
```
## 6. Misc operations
<a name="SetCredentials"></a>
### SetCredentials() error
Set new credentials of a Minio setup.
__Example__
``` go
err = madmClnt.SetCredentials("YOUR-NEW-ACCESSKEY", "YOUR-NEW-SECRETKEY")
if err != nil {
log.Fatalln(err)
}
log.Println("New credentials successfully set.")
```
<a name="SetConfig"></a>
### SetConfig(config io.Reader) (SetConfigResult, error)
@@ -435,3 +441,22 @@ __Example__
}
log.Println("SetConfig: ", string(buf.Bytes()))
```
## 7. Misc operations
<a name="SetCredentials"></a>
### SetCredentials() error
Set new credentials of a Minio setup.
__Example__
``` go
err = madmClnt.SetCredentials("YOUR-NEW-ACCESSKEY", "YOUR-NEW-SECRETKEY")
if err != nil {
log.Fatalln(err)
}
log.Println("New credentials successfully set.")
```