mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #10032 from yousong/feature/yousong-wire-bw-filter
Feature/yousong wire bw filter
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -87,4 +87,6 @@ type WireListInput struct {
|
||||
ZonalFilterListBase
|
||||
|
||||
HostResourceInput
|
||||
|
||||
Bandwidth *int `json:"bandwidth"`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user