Bucket,Object count & Usage removed if set to default (#8638)

master
Ashish Kumar Sinha 5 years ago committed by kannappanr
parent fa00a84709
commit e2c5d29017
  1. 6
      cmd/admin-handlers.go
  2. 68
      pkg/madmin/info-commands.go

@ -1382,9 +1382,9 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque
} }
domain := globalDomainNames domain := globalDomainNames
buckets := madmin.Buckets{Count: 20} buckets := madmin.Buckets{}
objects := madmin.Objects{Count: 200} objects := madmin.Objects{}
usage := madmin.Usage{Size: 1024} usage := madmin.Usage{}
services := madmin.Services{ services := madmin.Services{
Vault: vault, Vault: vault,
LDAP: ldap, LDAP: ldap,

@ -326,41 +326,41 @@ func (adm *AdminClient) NetPerfInfo(size int) (map[string][]NetPerfInfo, error)
// InfoMessage container to hold server admin related information. // InfoMessage container to hold server admin related information.
type InfoMessage struct { type InfoMessage struct {
Mode string `json:"mode"` Mode string `json:"mode,omitempty"`
Domain []string `json:"domain,omitempty"` Domain []string `json:"domain,omitempty"`
Region string `json:"region,omitempty"` Region string `json:"region,omitempty"`
SQSARN []string `json:"sqsARN,omitempty"` SQSARN []string `json:"sqsARN,omitempty"`
DeploymentID string `json:"deploymentID"` DeploymentID string `json:"deploymentID,omitempty"`
Buckets Buckets `json:"buckets"` Buckets Buckets `json:"buckets,omitempty"`
Objects Objects `json:"objects"` Objects Objects `json:"objects,omitempty"`
Usage Usage `json:"usage"` Usage Usage `json:"usage,omitempty"`
Services Services `json:"services"` Services Services `json:"services,omitempty"`
Backend interface{} `json:"backend"` Backend interface{} `json:"backend,omitempty"`
Servers []ServerProperties `json:"servers"` Servers []ServerProperties `json:"servers,omitempty"`
} }
// Services contains different services information // Services contains different services information
type Services struct { type Services struct {
Vault Vault `json:"vault"` Vault Vault `json:"vault,omitempty"`
LDAP LDAP `json:"ldap"` LDAP LDAP `json:"ldap,omitempty"`
Logger []Logger `json:"logger,omitempty"` Logger []Logger `json:"logger,omitempty"`
Audit []Audit `json:"audit,omitempty"` Audit []Audit `json:"audit,omitempty"`
Notifications []map[string][]TargetIDStatus `json:"notifications"` Notifications []map[string][]TargetIDStatus `json:"notifications,omitempty"`
} }
// Buckets contains the number of buckets // Buckets contains the number of buckets
type Buckets struct { type Buckets struct {
Count int `json:"count"` Count int `json:"count,omitempty"`
} }
// Objects contains the number of objects // Objects contains the number of objects
type Objects struct { type Objects struct {
Count int `json:"count"` Count int `json:"count,omitempty"`
} }
// Usage contains the tottal size used // Usage contains the tottal size used
type Usage struct { type Usage struct {
Size uint64 `json:"size"` Size uint64 `json:"size,omitempty"`
} }
// Vault - Fetches the Vault status // Vault - Fetches the Vault status
@ -378,7 +378,7 @@ type LDAP struct {
// Status of endpoint // Status of endpoint
type Status struct { type Status struct {
Status string `json:"status"` Status string `json:"status,omitempty"`
} }
// Audit contains audit logger status // Audit contains audit logger status
@ -402,43 +402,43 @@ const (
// FsBackend contains specific FS storage information // FsBackend contains specific FS storage information
type FsBackend struct { type FsBackend struct {
Type backendType `json:"backendType"` Type backendType `json:"backendType,omitempty"`
} }
// XlBackend contains specific erasure storage information // XlBackend contains specific erasure storage information
type XlBackend struct { type XlBackend struct {
Type backendType `json:"backendType"` Type backendType `json:"backendType,omitempty"`
OnlineDisks int `json:"onlineDisks"` OnlineDisks int `json:"onlineDisks,omitempty"`
OfflineDisks int `json:"offlineDisks"` OfflineDisks int `json:"offlineDisks,omitempty"`
// Data disks for currently configured Standard storage class. // Data disks for currently configured Standard storage class.
StandardSCData int `json:"standardSCData"` StandardSCData int `json:"standardSCData,omitempty"`
// Parity disks for currently configured Standard storage class. // Parity disks for currently configured Standard storage class.
StandardSCParity int `json:"standardSCParity"` StandardSCParity int `json:"standardSCParity,omitempty"`
// Data disks for currently configured Reduced Redundancy storage class. // Data disks for currently configured Reduced Redundancy storage class.
RRSCData int `json:"rrSCData"` RRSCData int `json:"rrSCData,omitempty"`
// Parity disks for currently configured Reduced Redundancy storage class. // Parity disks for currently configured Reduced Redundancy storage class.
RRSCParity int `json:"rrSCParity"` RRSCParity int `json:"rrSCParity,omitempty"`
} }
// ServerProperties holds server information // ServerProperties holds server information
type ServerProperties struct { type ServerProperties struct {
State string `json:"state"` State string `json:"state,omitempty"`
Endpoint string `json:"endpoint"` Endpoint string `json:"endpoint,omitempty"`
Uptime int64 `json:"uptime"` Uptime int64 `json:"uptime,omitempty"`
Version string `json:"version"` Version string `json:"version,omitempty"`
CommitID string `json:"commitID"` CommitID string `json:"commitID,omitempty"`
Network map[string]string `json:"network"` Network map[string]string `json:"network,omitempty"`
Disks []Disk `json:"disks"` Disks []Disk `json:"disks,omitempty"`
} }
// Disk holds Disk information // Disk holds Disk information
type Disk struct { type Disk struct {
DrivePath string `json:"path"` DrivePath string `json:"path,omitempty"`
State string `json:"state"` State string `json:"state,omitempty"`
UUID string `json:"uuid,omitempty"` UUID string `json:"uuid,omitempty"`
Model string `json:"model,omitempty"` Model string `json:"model,omitempty"`
TotalSpace uint64 `json:"totalspace"` TotalSpace uint64 `json:"totalspace,omitempty"`
UsedSpace uint64 `json:"usedspace"` UsedSpace uint64 `json:"usedspace,omitempty"`
ReadThroughput float64 `json:"readthroughput,omitempty"` ReadThroughput float64 `json:"readthroughput,omitempty"`
WriteThroughPut float64 `json:"writethroughput,omitempty"` WriteThroughPut float64 `json:"writethroughput,omitempty"`
ReadLatency float64 `json:"readlatency,omitempty"` ReadLatency float64 `json:"readlatency,omitempty"`

Loading…
Cancel
Save