Merge pull request #10032 from yousong/feature/yousong-wire-bw-filter

Feature/yousong wire bw filter
This commit is contained in:
Yousong Zhou
2021-01-27 18:53:59 +08:00
committed by GitHub
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -27,6 +27,8 @@ func init() {
type WireListOptions struct {
options.BaseListOptions
Bandwidth *int `help:"List wires by bandwidth"`
Region string `help:"List wires in region"`
Zone string `help:"list wires in zone" json:"-"`
Vpc string `help:"List wires in vpc"`
+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
}