|
|
@ -241,17 +241,12 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
if objectAPI == nil { |
|
|
|
if objectAPI == nil { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
hostName, err := getHostName(r) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
serverInfo := globalNotificationSys.ServerInfo(ctx) |
|
|
|
serverInfo := globalNotificationSys.ServerInfo(ctx) |
|
|
|
// Once we have received all the ServerInfo from peers
|
|
|
|
// Once we have received all the ServerInfo from peers
|
|
|
|
// add the local peer server info as well.
|
|
|
|
// add the local peer server info as well.
|
|
|
|
serverInfo = append(serverInfo, ServerInfo{ |
|
|
|
serverInfo = append(serverInfo, ServerInfo{ |
|
|
|
Addr: hostName, |
|
|
|
Addr: getHostName(r), |
|
|
|
Data: &ServerInfoData{ |
|
|
|
Data: &ServerInfoData{ |
|
|
|
StorageInfo: objectAPI.StorageInfo(ctx), |
|
|
|
StorageInfo: objectAPI.StorageInfo(ctx), |
|
|
|
ConnStats: globalConnStats.toServerConnStats(), |
|
|
|
ConnStats: globalConnStats.toServerConnStats(), |
|
|
@ -442,18 +437,13 @@ func (a adminAPIHandlers) TopLocksHandler(w http.ResponseWriter, r *http.Request |
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL) |
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
hostName, err := getHostName(r) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
peerLocks := globalNotificationSys.GetLocks(ctx) |
|
|
|
peerLocks := globalNotificationSys.GetLocks(ctx) |
|
|
|
// Once we have received all the locks currently used from peers
|
|
|
|
// Once we have received all the locks currently used from peers
|
|
|
|
// add the local peer locks list as well.
|
|
|
|
// add the local peer locks list as well.
|
|
|
|
localLocks := globalLockServer.ll.DupLockMap() |
|
|
|
localLocks := globalLockServer.ll.DupLockMap() |
|
|
|
peerLocks = append(peerLocks, &PeerLocks{ |
|
|
|
peerLocks = append(peerLocks, &PeerLocks{ |
|
|
|
Addr: hostName, |
|
|
|
Addr: getHostName(r), |
|
|
|
Locks: localLocks, |
|
|
|
Locks: localLocks, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|