fix(region): vpc sync misc fix

This commit is contained in:
ioito
2021-12-15 16:41:01 +08:00
parent b7e8cbb87c
commit 7e128a8eba
4 changed files with 21 additions and 2 deletions
+3
View File
@@ -70,4 +70,7 @@ type RouteTableRouteSetListInput struct {
apis.StatusStandaloneResourceListInput
apis.ExternalizedResourceBaseListInput
RouteTableFilterList
Type string `json:"type"`
NextHopType string `json:"next_hop_type"`
NextHopId string `json:"next_hop_id"`
}
@@ -188,6 +188,15 @@ func (manager *SRouteTableRouteSetManager) ListItemFilter(
if err != nil {
return nil, errors.Wrap(err, "SRouteTableResourceBaseManager.ListItemFilter")
}
if len(query.Type) > 0 {
q = q.Equals("type", query.Type)
}
if len(query.NextHopType) > 0 {
q = q.Equals("next_hop_type", query.NextHopType)
}
if len(query.NextHopId) > 0 {
q = q.Equals("next_hop_id", query.NextHopId)
}
return q, nil
}
@@ -20,6 +20,9 @@ type RouteTableRouteSetListOptions struct {
BaseListOptions
RouteTableId string
VpcId string
Type string
NextHopType string
NextHopId string
}
func (opts *RouteTableRouteSetListOptions) Params() (jsonutils.JSONObject, error) {
+6 -2
View File
@@ -228,10 +228,14 @@ func (self *SVpc) GetSVpcPeeringConnections() ([]SVpcPC, error) {
if err != nil {
return nil, errors.Wrapf(err, "self.region.GetAllVpcPeeringConnections(%s)", self.GetId())
}
ret := []SVpcPC{}
for i := range svpcPCs {
svpcPCs[i].vpc = self
if svpcPCs[i].UnVpcID == self.VpcId {
svpcPCs[i].vpc = self
ret = append(ret, svpcPCs[i])
}
}
return svpcPCs, nil
return ret, nil
}
func (self *SVpc) GetAccepterSVpcPeeringConnections() ([]SVpcPC, error) {