diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index fb827c335..d84ec80a1 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -1307,12 +1307,20 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque return } - infoMsg := madmin.InfoMessage{} - vault := madmin.Vault{} - if GlobalKMS != nil { - vault = fetchVaultStatus(cfg) + buckets := madmin.Buckets{} + objects := madmin.Objects{} + usage := madmin.Usage{} + + dataUsageInfo, err := loadDataUsageFromBackend(ctx, objectAPI) + if err == nil { + buckets = madmin.Buckets{Count: dataUsageInfo.BucketsCount} + objects = madmin.Objects{Count: dataUsageInfo.ObjectsCount} + usage = madmin.Usage{Size: dataUsageInfo.ObjectsTotalSize} } + infoMsg := madmin.InfoMessage{} + vault := fetchVaultStatus(cfg) + ldap := madmin.LDAP{} if globalLDAPConfig.Enabled { ldapConn, err := globalLDAPConfig.Connect() @@ -1407,9 +1415,6 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque } domain := globalDomainNames - buckets := madmin.Buckets{} - objects := madmin.Objects{} - usage := madmin.Usage{} services := madmin.Services{ Vault: vault, LDAP: ldap, @@ -1446,7 +1451,7 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque func fetchLambdaInfo(cfg config.Config) []map[string][]madmin.TargetIDStatus { lambdaMap := make(map[string][]madmin.TargetIDStatus) - targetList, _ := notify.GetNotificationTargets(cfg, GlobalServiceDoneCh, globalRootCAs) + targetList, _ := notify.GetNotificationTargets(cfg, GlobalServiceDoneCh, NewCustomHTTPTransport()) for targetID, target := range targetList.TargetMap() { targetIDStatus := make(map[string]madmin.Status) diff --git a/pkg/madmin/info-commands.go b/pkg/madmin/info-commands.go index 1c66d5e1d..6b5c5c011 100644 --- a/pkg/madmin/info-commands.go +++ b/pkg/madmin/info-commands.go @@ -408,12 +408,12 @@ type Services struct { // Buckets contains the number of buckets type Buckets struct { - Count int `json:"count,omitempty"` + Count uint64 `json:"count,omitempty"` } // Objects contains the number of objects type Objects struct { - Count int `json:"count,omitempty"` + Count uint64 `json:"count,omitempty"` } // Usage contains the tottal size used