govirsh

package module
v0.0.0-...-9af7efa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

README

govirsh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLibvirtNet

func AddLibvirtNet(xmlContent string) (libvirt.Network, error)

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 NewVirtNet(l libvirt.Network) VirtNet

func (VirtNet) AddDhcpHost

func (v VirtNet) AddDhcpHost(mac, name, ip string) error

AddDhcpHost 向dhcp中增加host

func (VirtNet) AddDhcpHostWithAutoIp

func (v VirtNet) AddDhcpHostWithAutoIp(mac, name string) (ip string, err error)

func (VirtNet) AddDhcpHostWithAutoIpAndName

func (v VirtNet) AddDhcpHostWithAutoIpAndName(mac string) (ip, name string, err error)

func (VirtNet) DelDhcpHost

func (v VirtNet) DelDhcpHost(mac, name, ip string) error

DelDhcpHost 向dhcp删除host

func (VirtNet) DelDhcpHostByIp

func (v VirtNet) DelDhcpHostByIp(ip string) error

DelDhcpHostByIp 向dhcp删除host

func (VirtNet) DelDhcpHostByName

func (v VirtNet) DelDhcpHostByName(name string) error

DelDhcpHostByName 向dhcp删除host

func (VirtNet) GetDhcpHostIpList

func (v VirtNet) GetDhcpHostIpList() (ip []string, err error)

获取第一个dhcp绑定的host的ip列表

func (VirtNet) GetDhcpHostListByIpKey

func (v VirtNet) GetDhcpHostListByIpKey() (k map[string][]string, err error)

GetDhcpHostListByIpKey 获取第一个DHCP中的host列表,格式为

func (VirtNet) GetDhcpHostListByMacKey

func (v VirtNet) GetDhcpHostListByMacKey() (k map[string][]string, err error)

GetDhcpHostListByMacKey 获取第一个DHCP中的host列表,格式为

func (VirtNet) GetDhcpHostListByNameKey

func (v VirtNet) GetDhcpHostListByNameKey() (k map[string][]string, err error)

GetDhcpHostListByNameKey 获取第一个DHCP中的host列表,格式为

func (VirtNet) GetDhcpInfo

func (v VirtNet) GetDhcpInfo() (startIp, endIp string, err error)

获取第一个dhcp的信息

type Vm

type Vm struct {
	Domain *libvirt.Domain
	// contains filtered or unexported fields
}

func NewVm

func NewVm(name, uuid, mac, baseQcow, emulato, baseXml, qcow string, cpu, memory uint) (Vm, error)

func (*Vm) CheckIp

func (v *Vm) CheckIp() (string, error)

func (*Vm) DestroyVm

func (v *Vm) DestroyVm() error

func (Vm) GetIp

func (v Vm) GetIp() string

func (Vm) GetMac

func (v Vm) GetMac() string

func (Vm) GetName

func (v Vm) GetName() string

func (Vm) GetUuid

func (v Vm) GetUuid() string

func (*Vm) RemoveQcow

func (v *Vm) RemoveQcow() error

func (*Vm) SetIp

func (v *Vm) SetIp(ip string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL