instances

package
v0.0.0-...-7ca99a0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	Name       string `json:",omitempty"`
	UUID       string `json:",omitempty"`
	BaseImage  string `json:",omitempty"`
	Autostart  bool   `json:",omitempty"`
	Active     bool   `json:",omitempty"`
	DomainID   uint   `json:",omitempty"`
	MemoryGB   uint   `json:",omitempty"`
	Cores      int    `json:",omitempty"`
	DiskSizeGB uint64 `json:",omitempty"`
	// contains filtered or unexported fields
}

Instance is a VM and it's affiliated resources

func FromDomain

func FromDomain(dom *libvirt.Domain) (i Instance, err error)

func FromDomainID

func FromDomainID(domainID uint32) (Instance, error)

func FromDomainIDWithConnect

func FromDomainIDWithConnect(conn *libvirt.Connect, domainID uint32) (Instance, error)

func FromDomainUUID

func FromDomainUUID(domainUUID string) (Instance, error)

func GetAll

func GetAll() (instances []Instance, err error)

func GetDefaultInstance

func GetDefaultInstance() Instance

GetDefaultInstance is the defaults for new instances

func (*Instance) CreateAsJob

func (i *Instance) CreateAsJob(j *jobs.Job) error

func (*Instance) GetVolumeXML

func (i *Instance) GetVolumeXML() (string, error)

GetVolumeXML generates libvirt XML that describes the instance volume

func (*Instance) GetXML

func (i *Instance) GetXML() (string, error)

GetXML returns the libvirt XML of the underlying domain

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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