aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/topology_info.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/topology/topology_info.go')
-rw-r--r--weed/topology/topology_info.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/weed/topology/topology_info.go b/weed/topology/topology_info.go
index 5fa439a0b..33a047b1e 100644
--- a/weed/topology/topology_info.go
+++ b/weed/topology/topology_info.go
@@ -13,6 +13,11 @@ type TopologyInfo struct {
Layouts []VolumeLayoutInfo `json:"Layouts"`
}
+type VolumeLayoutCollection struct {
+ Collection string
+ VolumeLayout *VolumeLayout
+}
+
func (t *Topology) ToInfo() (info TopologyInfo) {
info.Max = t.diskUsages.GetMaxVolumeCount()
info.Free = t.diskUsages.FreeSpace()
@@ -42,10 +47,12 @@ func (t *Topology) ToInfo() (info TopologyInfo) {
return
}
-func (t *Topology) ListVolumeLayouts() (volumeLayouts []*VolumeLayout) {
+func (t *Topology) ListVolumeLayoutCollections() (volumeLayouts []*VolumeLayoutCollection) {
for _, col := range t.collectionMap.Items() {
for _, volumeLayout := range col.(*Collection).storageType2VolumeLayout.Items() {
- volumeLayouts = append(volumeLayouts, volumeLayout.(*VolumeLayout))
+ volumeLayouts = append(volumeLayouts,
+ &VolumeLayoutCollection{col.(*Collection).Name, volumeLayout.(*VolumeLayout)},
+ )
}
}
return volumeLayouts