@@ -204,44 +204,7 @@ func subnetPostReq(client xhttp.ClientI, reqURL string, payload interface{}, hea
204204}
205205
206206func GetClusterRegInfo (admInfo madmin.InfoMessage ) mc.ClusterRegistrationInfo {
207- noOfPools := 1
208- noOfDrives := 0
209- for _ , srvr := range admInfo .Servers {
210- if srvr .PoolNumber > noOfPools {
211- noOfPools = srvr .PoolNumber
212- }
213- noOfDrives += len (srvr .Disks )
214- }
215-
216- totalSpace , usedSpace := getDriveSpaceInfo (admInfo )
217-
218- return mc.ClusterRegistrationInfo {
219- DeploymentID : admInfo .DeploymentID ,
220- ClusterName : admInfo .DeploymentID ,
221- UsedCapacity : admInfo .Usage .Size ,
222- Info : mc.ClusterInfo {
223- MinioVersion : admInfo .Servers [0 ].Version ,
224- NoOfServerPools : noOfPools ,
225- NoOfServers : len (admInfo .Servers ),
226- NoOfDrives : noOfDrives ,
227- TotalDriveSpace : totalSpace ,
228- UsedDriveSpace : usedSpace ,
229- NoOfBuckets : admInfo .Buckets .Count ,
230- NoOfObjects : admInfo .Objects .Count ,
231- },
232- }
233- }
234-
235- func getDriveSpaceInfo (admInfo madmin.InfoMessage ) (uint64 , uint64 ) {
236- total := uint64 (0 )
237- used := uint64 (0 )
238- for _ , srvr := range admInfo .Servers {
239- for _ , d := range srvr .Disks {
240- total += d .TotalSpace
241- used += d .UsedSpace
242- }
243- }
244- return total , used
207+ return mc .GetClusterRegInfo (admInfo , admInfo .DeploymentID )
245208}
246209
247210func GetSubnetAPIKeyUsingLicense (lic string ) (string , error ) {
0 commit comments