mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 07:07:25 +08:00
weed shell: list volumes
This commit is contained in:
@@ -74,3 +74,18 @@ func (t *Topology) ToVolumeLocations() (volumeLocations []*master_pb.VolumeLocat
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (t *Topology) ToTopologyInfo() *master_pb.TopologyInfo {
|
||||
m := &master_pb.TopologyInfo{
|
||||
Id: string(t.Id()),
|
||||
VolumeCount: uint64(t.GetVolumeCount()),
|
||||
MaxVolumeCount: uint64(t.GetMaxVolumeCount()),
|
||||
FreeVolumeCount: uint64(t.FreeSpace()),
|
||||
ActiveVolumeCount: uint64(t.GetActiveVolumeCount()),
|
||||
}
|
||||
for _, c := range t.Children() {
|
||||
dc := c.(*DataCenter)
|
||||
m.DataCenterInfos = append(m.DataCenterInfos, dc.ToDataCenterInfo())
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
Reference in New Issue
Block a user