kvm

package
v0.448.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVMHypervisor

type KVMHypervisor struct {
	// contains filtered or unexported fields
}

func GetKvmHypervisorByHost

func GetKvmHypervisorByHost(host hosts.Host) (kvmHypervisor *KVMHypervisor, err error)

func GetKvmHypervisorOnLocalhost

func GetKvmHypervisorOnLocalhost() (kvmHypervisor *KVMHypervisor, err error)

func MustGetKvmHypervisorByHost

func MustGetKvmHypervisorByHost(host hosts.Host) (kvmHypervisor *KVMHypervisor)

func MustGetKvmHypervisorOnLocalhost

func MustGetKvmHypervisorOnLocalhost() (kvmHypervisor *KVMHypervisor)

func NewKVMHypervisor

func NewKVMHypervisor() (kvmHypervisor *KVMHypervisor)

func (*KVMHypervisor) CreateVm

func (k *KVMHypervisor) CreateVm(createOptions *KvmCreateVmOptions) (createdVm *KvmVm, err error)

func (*KVMHypervisor) GetHost

func (k *KVMHypervisor) GetHost() (host hosts.Host, err error)

func (*KVMHypervisor) GetHostName

func (k *KVMHypervisor) GetHostName() (hostname string, err error)

func (*KVMHypervisor) GetStoragePoolNames

func (k *KVMHypervisor) GetStoragePoolNames(verbose bool) (storagePoolNames []string, err error)

func (*KVMHypervisor) GetStoragePools

func (k *KVMHypervisor) GetStoragePools(verbose bool) (storagePools []*KvmStoragePool, err error)

func (*KVMHypervisor) GetUseLocalhost

func (k *KVMHypervisor) GetUseLocalhost() (useLocalhost bool, err error)

func (*KVMHypervisor) GetVmById

func (k *KVMHypervisor) GetVmById(vmId int) (vm *KvmVm, err error)

func (*KVMHypervisor) GetVmByName

func (k *KVMHypervisor) GetVmByName(vmName string, verbose bool) (vm *KvmVm, err error)

func (*KVMHypervisor) GetVmInfoList

func (k *KVMHypervisor) GetVmInfoList(verbose bool) (vmInfos []*KvmVmInfo, err error)

func (*KVMHypervisor) GetVmList

func (k *KVMHypervisor) GetVmList(verbose bool) (vms []*KvmVm, err error)

func (*KVMHypervisor) GetVmNames

func (k *KVMHypervisor) GetVmNames(verbose bool) (vmNames []string, err error)

func (*KVMHypervisor) GetVolumeByName

func (k *KVMHypervisor) GetVolumeByName(volumeName string) (volume *KvmVolume, err error)

func (*KVMHypervisor) GetVolumeNames

func (k *KVMHypervisor) GetVolumeNames(verbose bool) (volumeNames []string, err error)

func (*KVMHypervisor) GetVolumes

func (k *KVMHypervisor) GetVolumes(verbose bool) (volumes []*KvmVolume, err error)

func (*KVMHypervisor) MustCreateVm

func (k *KVMHypervisor) MustCreateVm(createOptions *KvmCreateVmOptions) (createdVm *KvmVm)

func (*KVMHypervisor) MustGetHost

func (k *KVMHypervisor) MustGetHost() (host hosts.Host)

func (*KVMHypervisor) MustGetHostName

func (k *KVMHypervisor) MustGetHostName() (hostname string)

func (*KVMHypervisor) MustGetStoragePoolNames

func (k *KVMHypervisor) MustGetStoragePoolNames(verbose bool) (storagePoolNames []string)

func (*KVMHypervisor) MustGetStoragePools

func (k *KVMHypervisor) MustGetStoragePools(verbose bool) (storagePools []*KvmStoragePool)

func (*KVMHypervisor) MustGetUseLocalhost

func (k *KVMHypervisor) MustGetUseLocalhost() (useLocalhost bool)

func (*KVMHypervisor) MustGetVmById

func (k *KVMHypervisor) MustGetVmById(vmId int) (vm *KvmVm)

func (*KVMHypervisor) MustGetVmByName

func (k *KVMHypervisor) MustGetVmByName(vmName string, verbose bool) (vm *KvmVm)

func (*KVMHypervisor) MustGetVmInfoList

func (k *KVMHypervisor) MustGetVmInfoList(verbose bool) (vmInfos []*KvmVmInfo)

func (*KVMHypervisor) MustGetVmList

func (k *KVMHypervisor) MustGetVmList(verbose bool) (vms []*KvmVm)

func (*KVMHypervisor) MustGetVmNames

func (k *KVMHypervisor) MustGetVmNames(verbose bool) (vmNames []string)

func (*KVMHypervisor) MustGetVolumeByName

func (k *KVMHypervisor) MustGetVolumeByName(volumeName string) (volume *KvmVolume)

func (*KVMHypervisor) MustGetVolumeNames

func (k *KVMHypervisor) MustGetVolumeNames(verbose bool) (volumeNames []string)

func (*KVMHypervisor) MustGetVolumes

func (k *KVMHypervisor) MustGetVolumes(verbose bool) (volumes []*KvmVolume)

func (*KVMHypervisor) MustRemoveVm

func (k *KVMHypervisor) MustRemoveVm(removeOptions *KvmRemoveVmOptions)

func (*KVMHypervisor) MustRemoveVolumeByName

func (k *KVMHypervisor) MustRemoveVolumeByName(volumeName string, verbose bool)

func (*KVMHypervisor) MustRunKvmCommand

func (k *KVMHypervisor) MustRunKvmCommand(kvmCommand []string, verbose bool) (commandOutput *commandoutput.CommandOutput)

func (*KVMHypervisor) MustRunKvmCommandAndGetStdout

func (k *KVMHypervisor) MustRunKvmCommandAndGetStdout(kvmCommand []string, verbose bool) (stdout string)

func (*KVMHypervisor) MustSetHost

func (k *KVMHypervisor) MustSetHost(host hosts.Host)

func (*KVMHypervisor) MustSetUseLocalhost

func (k *KVMHypervisor) MustSetUseLocalhost(useLocalhost bool)

func (*KVMHypervisor) MustVmByNameExists

func (k *KVMHypervisor) MustVmByNameExists(vmName string) (vmExists bool)

func (*KVMHypervisor) MustVolumeByNameExists

func (k *KVMHypervisor) MustVolumeByNameExists(volumeName string) (volumeExists bool)

func (*KVMHypervisor) RemoveVm

func (k *KVMHypervisor) RemoveVm(removeOptions *KvmRemoveVmOptions) (err error)

func (*KVMHypervisor) RemoveVolumeByName

func (k *KVMHypervisor) RemoveVolumeByName(volumeName string, verbose bool) (err error)

func (*KVMHypervisor) RunKvmCommand

func (k *KVMHypervisor) RunKvmCommand(kvmCommand []string, verbose bool) (commandOutput *commandoutput.CommandOutput, err error)

func (*KVMHypervisor) RunKvmCommandAndGetStdout

func (k *KVMHypervisor) RunKvmCommandAndGetStdout(kvmCommand []string, verbose bool) (stdout string, err error)

func (*KVMHypervisor) SetHost

func (k *KVMHypervisor) SetHost(host hosts.Host) (err error)

func (*KVMHypervisor) SetUseLocalhost

func (k *KVMHypervisor) SetUseLocalhost(useLocalhost bool) (err error)

func (*KVMHypervisor) VmByNameExists

func (k *KVMHypervisor) VmByNameExists(vmName string) (vmExists bool, err error)

func (*KVMHypervisor) VolumeByNameExists

func (k *KVMHypervisor) VolumeByNameExists(volumeName string) (volumeExists bool, err error)

type KvmCreateVmOptions

type KvmCreateVmOptions struct {
	VmName     string
	DiskImage  filesinterfaces.File
	Verbose    bool
	MacAddress string
}

func NewKvmCreateVmOptions

func NewKvmCreateVmOptions() (k *KvmCreateVmOptions)

func (*KvmCreateVmOptions) GetDiskImage

func (k *KvmCreateVmOptions) GetDiskImage() (diskImage filesinterfaces.File, err error)

func (*KvmCreateVmOptions) GetDiskImagePath

func (k *KvmCreateVmOptions) GetDiskImagePath() (diskImagePath string, err error)

func (*KvmCreateVmOptions) GetMacAddress

func (k *KvmCreateVmOptions) GetMacAddress() (macAddress string, err error)

func (*KvmCreateVmOptions) GetVerbose

func (k *KvmCreateVmOptions) GetVerbose() (verbose bool, err error)

func (*KvmCreateVmOptions) GetVmName

func (k *KvmCreateVmOptions) GetVmName() (vmName string, err error)

func (*KvmCreateVmOptions) MustGetDiskImage

func (k *KvmCreateVmOptions) MustGetDiskImage() (diskImage filesinterfaces.File)

func (*KvmCreateVmOptions) MustGetDiskImagePath

func (k *KvmCreateVmOptions) MustGetDiskImagePath() (diskImagePath string)

func (*KvmCreateVmOptions) MustGetMacAddress

func (k *KvmCreateVmOptions) MustGetMacAddress() (macAddress string)

func (*KvmCreateVmOptions) MustGetVerbose

func (k *KvmCreateVmOptions) MustGetVerbose() (verbose bool)

func (*KvmCreateVmOptions) MustGetVmName

func (k *KvmCreateVmOptions) MustGetVmName() (vmName string)

func (*KvmCreateVmOptions) MustSetDiskImage

func (k *KvmCreateVmOptions) MustSetDiskImage(diskImage filesinterfaces.File)

func (*KvmCreateVmOptions) MustSetMacAddress

func (k *KvmCreateVmOptions) MustSetMacAddress(macAddress string)

func (*KvmCreateVmOptions) MustSetVerbose

func (k *KvmCreateVmOptions) MustSetVerbose(verbose bool)

func (*KvmCreateVmOptions) MustSetVmName

func (k *KvmCreateVmOptions) MustSetVmName(vmName string)

func (*KvmCreateVmOptions) SetDiskImage

func (k *KvmCreateVmOptions) SetDiskImage(diskImage filesinterfaces.File) (err error)

func (*KvmCreateVmOptions) SetMacAddress

func (k *KvmCreateVmOptions) SetMacAddress(macAddress string) (err error)

func (*KvmCreateVmOptions) SetVerbose

func (k *KvmCreateVmOptions) SetVerbose(verbose bool) (err error)

func (*KvmCreateVmOptions) SetVmName

func (k *KvmCreateVmOptions) SetVmName(vmName string) (err error)

type KvmRemoveVmOptions

type KvmRemoveVmOptions struct {
	VmName              string
	RemoveVolumes       bool
	Verbose             bool
	VolumeNamesToRemove []string
}

func NewKvmRemoveVmOptions

func NewKvmRemoveVmOptions() (k *KvmRemoveVmOptions)

func (*KvmRemoveVmOptions) GetRemoveVolumes

func (k *KvmRemoveVmOptions) GetRemoveVolumes() (removeVolumes bool, err error)

func (*KvmRemoveVmOptions) GetVerbose

func (k *KvmRemoveVmOptions) GetVerbose() (verbose bool, err error)

func (*KvmRemoveVmOptions) GetVmName

func (k *KvmRemoveVmOptions) GetVmName() (vmName string, err error)

func (*KvmRemoveVmOptions) GetVolumeNamesToRemove

func (k *KvmRemoveVmOptions) GetVolumeNamesToRemove() (volumeNamesToRemove []string, err error)

func (*KvmRemoveVmOptions) MustGetRemoveVolumes

func (k *KvmRemoveVmOptions) MustGetRemoveVolumes() (removeVolumes bool)

func (*KvmRemoveVmOptions) MustGetVerbose

func (k *KvmRemoveVmOptions) MustGetVerbose() (verbose bool)

func (*KvmRemoveVmOptions) MustGetVmName

func (k *KvmRemoveVmOptions) MustGetVmName() (vmName string)

func (*KvmRemoveVmOptions) MustGetVolumeNamesToRemove

func (k *KvmRemoveVmOptions) MustGetVolumeNamesToRemove() (volumeNamesToRemove []string)

func (*KvmRemoveVmOptions) MustSetRemoveVolumes

func (k *KvmRemoveVmOptions) MustSetRemoveVolumes(removeVolumes bool)

func (*KvmRemoveVmOptions) MustSetVerbose

func (k *KvmRemoveVmOptions) MustSetVerbose(verbose bool)

func (*KvmRemoveVmOptions) MustSetVmName

func (k *KvmRemoveVmOptions) MustSetVmName(vmName string)

func (*KvmRemoveVmOptions) MustSetVolumeNamesToRemove

func (k *KvmRemoveVmOptions) MustSetVolumeNamesToRemove(volumeNamesToRemove []string)

func (*KvmRemoveVmOptions) SetRemoveVolumes

func (k *KvmRemoveVmOptions) SetRemoveVolumes(removeVolumes bool) (err error)

func (*KvmRemoveVmOptions) SetVerbose

func (k *KvmRemoveVmOptions) SetVerbose(verbose bool) (err error)

func (*KvmRemoveVmOptions) SetVmName

func (k *KvmRemoveVmOptions) SetVmName(vmName string) (err error)

func (*KvmRemoveVmOptions) SetVolumeNamesToRemove

func (k *KvmRemoveVmOptions) SetVolumeNamesToRemove(volumeNamesToRemove []string) (err error)

type KvmStoragePool

type KvmStoragePool struct {
	// contains filtered or unexported fields
}

func NewKvmStoragePool

func NewKvmStoragePool() (kvmStoragePool *KvmStoragePool)

func (*KvmStoragePool) GetHostName

func (k *KvmStoragePool) GetHostName() (hostname string, err error)

func (*KvmStoragePool) GetHypervisor

func (k *KvmStoragePool) GetHypervisor() (hypervisor *KVMHypervisor, err error)

func (*KvmStoragePool) GetName

func (k *KvmStoragePool) GetName() (name string, err error)

func (*KvmStoragePool) GetVolumes

func (k *KvmStoragePool) GetVolumes(verbose bool) (volumes []*KvmVolume, err error)

func (*KvmStoragePool) MustGetHostName

func (k *KvmStoragePool) MustGetHostName() (hostname string)

func (*KvmStoragePool) MustGetHypervisor

func (k *KvmStoragePool) MustGetHypervisor() (hypervisor *KVMHypervisor)

func (*KvmStoragePool) MustGetName

func (k *KvmStoragePool) MustGetName() (name string)

func (*KvmStoragePool) MustGetVolumes

func (k *KvmStoragePool) MustGetVolumes(verbose bool) (volumes []*KvmVolume)

func (*KvmStoragePool) MustSetHypervisor

func (k *KvmStoragePool) MustSetHypervisor(hypervisor *KVMHypervisor)

func (*KvmStoragePool) MustSetName

func (k *KvmStoragePool) MustSetName(name string)

func (*KvmStoragePool) SetHypervisor

func (k *KvmStoragePool) SetHypervisor(hypervisor *KVMHypervisor) (err error)

func (*KvmStoragePool) SetName

func (k *KvmStoragePool) SetName(name string) (err error)

type KvmVm

type KvmVm struct {
	// contains filtered or unexported fields
}

func NewKvmVm

func NewKvmVm() (kvmVm *KvmVm)

func (*KvmVm) GetCachedName

func (k *KvmVm) GetCachedName() (cachedName string, err error)

func (*KvmVm) GetDomainXmlAsString

func (k *KvmVm) GetDomainXmlAsString(verbose bool) (domainXml string, err error)

func (*KvmVm) GetHypervisor

func (k *KvmVm) GetHypervisor() (hypervisor *KVMHypervisor, err error)

func (*KvmVm) GetId

func (k *KvmVm) GetId() (id int, err error)

func (*KvmVm) GetInfo

func (k *KvmVm) GetInfo(verbose bool) (vmInfo *KvmVmInfo, err error)

func (*KvmVm) GetMacAddress

func (k *KvmVm) GetMacAddress(verbose bool) (macAddress string, err error)

func (*KvmVm) GetName

func (k *KvmVm) GetName() (name string, err error)

func (*KvmVm) GetVmId

func (k *KvmVm) GetVmId() (vmId *int, err error)

func (*KvmVm) MustGetCachedName

func (k *KvmVm) MustGetCachedName() (cachedName string)

func (*KvmVm) MustGetDomainXmlAsString

func (k *KvmVm) MustGetDomainXmlAsString(verbose bool) (domainXml string)

func (*KvmVm) MustGetHypervisor

func (k *KvmVm) MustGetHypervisor() (hypervisor *KVMHypervisor)

func (*KvmVm) MustGetId

func (k *KvmVm) MustGetId() (id int)

func (*KvmVm) MustGetInfo

func (k *KvmVm) MustGetInfo(verbose bool) (vmInfo *KvmVmInfo)

func (*KvmVm) MustGetMacAddress

func (k *KvmVm) MustGetMacAddress(verbose bool) (macAddress string)

func (*KvmVm) MustGetName

func (k *KvmVm) MustGetName() (name string)

func (*KvmVm) MustGetVmId

func (k *KvmVm) MustGetVmId() (vmId *int)

func (*KvmVm) MustSetCachedName

func (k *KvmVm) MustSetCachedName(cachedName string)

func (*KvmVm) MustSetHypervisor

func (k *KvmVm) MustSetHypervisor(hypervisor *KVMHypervisor)

func (*KvmVm) MustSetId

func (k *KvmVm) MustSetId(id int)

func (*KvmVm) MustSetVmId

func (k *KvmVm) MustSetVmId(vmId *int)

func (*KvmVm) SetCachedName

func (k *KvmVm) SetCachedName(cachedName string) (err error)

func (*KvmVm) SetHypervisor

func (k *KvmVm) SetHypervisor(hypervisor *KVMHypervisor) (err error)

func (*KvmVm) SetId

func (k *KvmVm) SetId(id int) (err error)

func (*KvmVm) SetVmId

func (k *KvmVm) SetVmId(vmId *int) (err error)

type KvmVmInfo

type KvmVmInfo struct {
	Name       string `json:"name"`
	MacAddress string `json:"mac_address"`
}

func NewKvmVmInfo

func NewKvmVmInfo() (k *KvmVmInfo)

func (*KvmVmInfo) GetMacAddress

func (k *KvmVmInfo) GetMacAddress() (macAddress string, err error)

func (*KvmVmInfo) GetName

func (k *KvmVmInfo) GetName() (name string, err error)

func (*KvmVmInfo) GetNameAndMacAddress

func (k *KvmVmInfo) GetNameAndMacAddress() (name string, macAddress string, err error)

func (*KvmVmInfo) MustGetMacAddress

func (k *KvmVmInfo) MustGetMacAddress() (macAddress string)

func (*KvmVmInfo) MustGetName

func (k *KvmVmInfo) MustGetName() (name string)

func (*KvmVmInfo) MustGetNameAndMacAddress

func (k *KvmVmInfo) MustGetNameAndMacAddress() (name string, macAddress string)

func (*KvmVmInfo) MustSetMacAddress

func (k *KvmVmInfo) MustSetMacAddress(macAddress string)

func (*KvmVmInfo) MustSetName

func (k *KvmVmInfo) MustSetName(name string)

func (*KvmVmInfo) SetMacAddress

func (k *KvmVmInfo) SetMacAddress(macAddress string) (err error)

func (*KvmVmInfo) SetName

func (k *KvmVmInfo) SetName(name string) (err error)

type KvmVolume

type KvmVolume struct {
	// contains filtered or unexported fields
}

func NewKvmVolume

func NewKvmVolume() (kvmVolume *KvmVolume)

func (*KvmVolume) GetHostName

func (v *KvmVolume) GetHostName() (hostname string, err error)

func (*KvmVolume) GetHypervisor

func (v *KvmVolume) GetHypervisor() (hypervisor *KVMHypervisor, err error)

func (*KvmVolume) GetName

func (v *KvmVolume) GetName() (name string, err error)

func (*KvmVolume) GetStoragePool

func (v *KvmVolume) GetStoragePool() (storagePool *KvmStoragePool, err error)

func (*KvmVolume) GetStoragePoolName

func (v *KvmVolume) GetStoragePoolName() (storagePoolName string, err error)

func (*KvmVolume) MustGetHostName

func (k *KvmVolume) MustGetHostName() (hostname string)

func (*KvmVolume) MustGetHypervisor

func (k *KvmVolume) MustGetHypervisor() (hypervisor *KVMHypervisor)

func (*KvmVolume) MustGetName

func (k *KvmVolume) MustGetName() (name string)

func (*KvmVolume) MustGetStoragePool

func (k *KvmVolume) MustGetStoragePool() (storagePool *KvmStoragePool)

func (*KvmVolume) MustGetStoragePoolName

func (k *KvmVolume) MustGetStoragePoolName() (storagePoolName string)

func (*KvmVolume) MustRemove

func (k *KvmVolume) MustRemove(verbose bool)

func (*KvmVolume) MustSetName

func (k *KvmVolume) MustSetName(name string)

func (*KvmVolume) MustSetStoragePool

func (k *KvmVolume) MustSetStoragePool(storagePool *KvmStoragePool)

func (*KvmVolume) Remove

func (v *KvmVolume) Remove(verbose bool) (err error)

func (*KvmVolume) SetName

func (v *KvmVolume) SetName(name string) (err error)

func (*KvmVolume) SetStoragePool

func (v *KvmVolume) SetStoragePool(storagePool *KvmStoragePool) (err error)

type LibvirtXmlsService

type LibvirtXmlsService struct{}

func LibvirtXmls

func LibvirtXmls() (libvirtXmls *LibvirtXmlsService)

func NewLibvirtXmlsService

func NewLibvirtXmlsService() (libvirtXmls *LibvirtXmlsService)

func (*LibvirtXmlsService) CreateXmlForVmOnLatopAsString

func (l *LibvirtXmlsService) CreateXmlForVmOnLatopAsString(createOptions *KvmCreateVmOptions) (libvirtXml string, err error)

func (*LibvirtXmlsService) GetMacAddressFromXmlString

func (l *LibvirtXmlsService) GetMacAddressFromXmlString(libvirtXml string) (macAddress string, err error)

func (*LibvirtXmlsService) MustCreateXmlForVmOnLatopAsString

func (l *LibvirtXmlsService) MustCreateXmlForVmOnLatopAsString(createOptions *KvmCreateVmOptions) (libvirtXml string)

func (*LibvirtXmlsService) MustGetMacAddressFromXmlString

func (l *LibvirtXmlsService) MustGetMacAddressFromXmlString(libvirtXml string) (macAddress string)

func (*LibvirtXmlsService) MustWriteXmlForVmOnLatopToFile

func (l *LibvirtXmlsService) MustWriteXmlForVmOnLatopToFile(createOptions *KvmCreateVmOptions, outputFile filesinterfaces.File)

func (*LibvirtXmlsService) WriteXmlForVmOnLatopToFile

func (l *LibvirtXmlsService) WriteXmlForVmOnLatopToFile(createOptions *KvmCreateVmOptions, outputFile filesinterfaces.File) (err error)

Jump to

Keyboard shortcuts

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