diff --git a/pkg/apis/compute/host.go b/pkg/apis/compute/host.go index a1d27435d5..48e019e27d 100644 --- a/pkg/apis/compute/host.go +++ b/pkg/apis/compute/host.go @@ -96,6 +96,8 @@ type HostListInput struct { AccessMac []string `json:"access_mac"` // 管理口Ip地址 AccessIp []string `json:"access_ip"` + // 公网IP地址 + PublicIp []string `json:"public_ip"` // 物理机序列号信息 SN []string `json:"sn"` // CPU大小 diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 177ef3bc93..7d884a1ec8 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -451,6 +451,7 @@ func (manager *SHostManager) ListItemFilter( "sn": query.SN, "storage_type": query.StorageType, "ipmi_ip": query.IpmiIp, + "public_ip": query.PublicIp, "host_status": query.HostStatus, "host_type": query.HostType, "version": query.Version, diff --git a/pkg/mcclient/options/compute/host.go b/pkg/mcclient/options/compute/host.go index e3d9825ba4..78e597fb17 100644 --- a/pkg/mcclient/options/compute/host.go +++ b/pkg/mcclient/options/compute/host.go @@ -74,6 +74,10 @@ type HostListOptions struct { HideCpuTopoInfo *bool `help:"Host list will remove cpu_info and topology info from sysinfo and metadata"` + AccessIp []string `help:"Access ip address"` + IpmiIp []string `help:"Ipmi ip address"` + PublicIp []string `help:"Public ip address"` + options.BaseListOptions }