feat(region): wire: allow filter by bandwidth

This commit is contained in:
Yousong Zhou
2021-01-27 10:31:20 +08:00
parent ed33cd4464
commit 2fe912f51a
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -87,4 +87,6 @@ type WireListInput struct {
ZonalFilterListBase
HostResourceInput
Bandwidth *int `json:"bandwidth"`
}
+4
View File
@@ -1012,6 +1012,10 @@ func (manager *SWireManager) ListItemFilter(
q = q.Filter(sqlchemy.In(q.Field("id"), sq.SubQuery()))
}
if query.Bandwidth != nil {
q = q.Equals("bandwidth", *query.Bandwidth)
}
return q, nil
}