Documentation ¶
Index ¶
- func AddLibvirtNet(xmlContent string) (libvirt.Network, error)
- type CreateVmOption
- type LibNetList
- type LibvirtXml
- type VirtNet
- func (v VirtNet) AddDhcpHost(mac, name, ip string) error
- func (v VirtNet) AddDhcpHostWithAutoIp(mac, name string) (ip string, err error)
- func (v VirtNet) AddDhcpHostWithAutoIpAndName(mac string) (ip, name string, err error)
- func (v VirtNet) DelDhcpHost(mac, name, ip string) error
- func (v VirtNet) DelDhcpHostByIp(ip string) error
- func (v VirtNet) DelDhcpHostByName(name string) error
- func (v VirtNet) GetDhcpHostIpList() (ip []string, err error)
- func (v VirtNet) GetDhcpHostListByIpKey() (k map[string][]string, err error)
- func (v VirtNet) GetDhcpHostListByMacKey() (k map[string][]string, err error)
- func (v VirtNet) GetDhcpHostListByNameKey() (k map[string][]string, err error)
- func (v VirtNet) GetDhcpInfo() (startIp, endIp string, err error)
- type Vm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateVmOption ¶
type CreateVmOption interface {
// contains filtered or unexported methods
}
func SetCpuNum ¶
func SetCpuNum(cpuNum string) CreateVmOption
func SetIp ¶
func SetIp(ip string) CreateVmOption
func SetMemorySize ¶
func SetMemorySize(memorySize string) CreateVmOption
func SetName ¶
func SetName(name string) CreateVmOption
func SetQcow2 ¶
func SetQcow2(qcow2 string) CreateVmOption
func SetXml ¶
func SetXml(xml string) CreateVmOption
type LibNetList ¶
type LibNetList struct {
// contains filtered or unexported fields
}
func NewLibNetList ¶
func NewLibNetList() LibNetList
func (*LibNetList) GetNetListByName ¶
func (l *LibNetList) GetNetListByName(name string) (libvirt.Network, error)
func (LibNetList) GetNetListName ¶
func (l LibNetList) GetNetListName() ([]string, error)
type LibvirtXml ¶
type LibvirtXml struct {
// contains filtered or unexported fields
}
func NewLibvirtXmlByPath ¶
func NewLibvirtXmlByPath(path string) LibvirtXml
func NewLibvirtXmlByString ¶
func NewLibvirtXmlByString(xml string) LibvirtXml
type VirtNet ¶
type VirtNet struct {
// contains filtered or unexported fields
}
func NewVirtNet ¶
func (VirtNet) AddDhcpHost ¶
AddDhcpHost 向dhcp中增加host
func (VirtNet) AddDhcpHostWithAutoIp ¶
func (VirtNet) AddDhcpHostWithAutoIpAndName ¶
func (VirtNet) DelDhcpHost ¶
DelDhcpHost 向dhcp删除host
func (VirtNet) DelDhcpHostByIp ¶
DelDhcpHostByIp 向dhcp删除host
func (VirtNet) DelDhcpHostByName ¶
DelDhcpHostByName 向dhcp删除host
func (VirtNet) GetDhcpHostIpList ¶
获取第一个dhcp绑定的host的ip列表
func (VirtNet) GetDhcpHostListByIpKey ¶
GetDhcpHostListByIpKey 获取第一个DHCP中的host列表,格式为
func (VirtNet) GetDhcpHostListByMacKey ¶
GetDhcpHostListByMacKey 获取第一个DHCP中的host列表,格式为
func (VirtNet) GetDhcpHostListByNameKey ¶
GetDhcpHostListByNameKey 获取第一个DHCP中的host列表,格式为
func (VirtNet) GetDhcpInfo ¶
获取第一个dhcp的信息
Click to show internal directories.
Click to hide internal directories.