mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-07-01 01:36:11 +08:00
fix(region): guestnetworksecgroup list add network info (#24393)
This commit is contained in:
@@ -361,6 +361,8 @@ type GuestnetworksecgroupDetails struct {
|
||||
Ifname string `json:"ifname"`
|
||||
IpAddr string `json:"ip_addr"`
|
||||
Ip6Addr string `json:"ip_6_addr"`
|
||||
NetworkId string `json:"network_id"`
|
||||
NetworkName string `json:"network_name"`
|
||||
|
||||
Admin bool `json:"admin"`
|
||||
}
|
||||
|
||||
@@ -214,6 +214,10 @@ func (manager *SGuestnetworksecgroupManager) FetchCustomizeColumns(
|
||||
rows[i].IpAddr = gn.IpAddr
|
||||
rows[i].Ip6Addr = gn.Ip6Addr
|
||||
rows[i].Ifname = gn.Ifname
|
||||
if network, _ := gn.GetNetwork(); network != nil {
|
||||
rows[i].NetworkId = gn.NetworkId
|
||||
rows[i].NetworkName = network.Name
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -463,9 +467,6 @@ func (self *SGuest) PerformSetNetworkSecgroup(
|
||||
if !utils.IsInStringArray(self.Status, []string{api.VM_READY, api.VM_RUNNING, api.VM_SUSPEND}) {
|
||||
return nil, httperrors.NewInputParameterError("Cannot set security rules in status %s", self.Status)
|
||||
}
|
||||
if len(input.SecgroupIds) == 0 {
|
||||
return nil, httperrors.NewMissingParameterError("secgroup_ids")
|
||||
}
|
||||
|
||||
driver, _ := self.GetDriver()
|
||||
maxCount := driver.GetMaxSecurityGroupCount()
|
||||
|
||||
Reference in New Issue
Block a user