mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(regoon): search rds by ip addr
This commit is contained in:
@@ -217,6 +217,9 @@ type DBInstanceListInput struct {
|
||||
EngineVersion string `json:"engine_version"`
|
||||
|
||||
InstanceType string `json:"instance_type"`
|
||||
|
||||
// 通过IP搜索RDS实例
|
||||
IpAddr string `json:"ip_addr"`
|
||||
}
|
||||
|
||||
type DBInstanceBackupListInput struct {
|
||||
|
||||
@@ -227,6 +227,11 @@ func (man *SDBInstanceManager) ListItemFilter(
|
||||
q = q.Equals("instance_type", query.InstanceType)
|
||||
}
|
||||
|
||||
if len(query.IpAddr) > 0 {
|
||||
dn := DBInstanceNetworkManager.Query("dbinstance_id").Contains("ip_addr", query.IpAddr)
|
||||
q = q.Filter(sqlchemy.In(q.Field("id"), dn.SubQuery()))
|
||||
}
|
||||
|
||||
return q, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ func (opts *DBInstanceCreateOptions) Params() (jsonutils.JSONObject, error) {
|
||||
type DBInstanceListOptions struct {
|
||||
options.BaseListOptions
|
||||
BillingType string `help:"billing type" choices:"postpaid|prepaid"`
|
||||
IpAddr string
|
||||
}
|
||||
|
||||
func (opts *DBInstanceListOptions) Params() (jsonutils.JSONObject, error) {
|
||||
|
||||
Reference in New Issue
Block a user