pool

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const StoragePoolTypeDir = StoragePoolType("dir")
View Source
const StoragePoolTypeLVM = StoragePoolType("lvm")

Variables

This section is empty.

Functions

This section is empty.

Types

type DirPool

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

DirPool is a StoragePool of type "dir"

func NewDirPool

func NewDirPool(pool *libvirt.StoragePool) (DirPool, error)

NewDirPool creates a storage pool of type dir

func (DirPool) CreateVolume

func (p DirPool) CreateVolume(name string, sizeGB uint64) (*libvirt.StorageVol, error)

func (DirPool) DeleteVolume

func (p DirPool) DeleteVolume(name string) error

func (DirPool) GetDomainDiskXML

func (p DirPool) GetDomainDiskXML(name string) libvirtxml.DomainDisk

func (DirPool) GetVolumeName

func (p DirPool) GetVolumeName(name string) string

func (DirPool) LookupVolume

func (p DirPool) LookupVolume(name string) (*libvirt.StorageVol, error)

func (DirPool) ResizeVolume

func (p DirPool) ResizeVolume(name string, newDiskSizeGB uint64) error

func (DirPool) Type

func (p DirPool) Type() StoragePoolType

type LogicalPool

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

LogicalPool is a StoragePool of type "dir"

func NewLogicalPool

func NewLogicalPool(pool *libvirt.StoragePool) (LogicalPool, error)

NewLogicalPool creates a storage pool of type dir

func (LogicalPool) CreateVolume

func (p LogicalPool) CreateVolume(name string, sizeGB uint64) (*libvirt.StorageVol, error)

func (LogicalPool) DeleteVolume

func (p LogicalPool) DeleteVolume(name string) error

func (LogicalPool) GetDomainDiskXML

func (p LogicalPool) GetDomainDiskXML(name string) libvirtxml.DomainDisk

func (LogicalPool) GetVolumeName

func (p LogicalPool) GetVolumeName(name string) string

func (LogicalPool) LookupVolume

func (p LogicalPool) LookupVolume(name string) (*libvirt.StorageVol, error)

func (LogicalPool) ResizeVolume

func (p LogicalPool) ResizeVolume(name string, newDiskSizeGB uint64) error

func (LogicalPool) Type

func (p LogicalPool) Type() StoragePoolType

type PoolType

type PoolType interface {
	CreateVolume(string, uint64) (*libvirt.StorageVol, error)
	DeleteVolume(string) error
	GetVolumeName(string) string
	ResizeVolume(string, uint64) error
	GetDomainDiskXML(string) libvirtxml.DomainDisk
	LookupVolume(string) (*libvirt.StorageVol, error)
	Type() StoragePoolType
}

PoolType is an interface for the functionality around a type of StoragePool

func GetPool

func GetPool(conn *libvirt.Connect) (PoolType, error)

GetPool retrieves the configured Storage Pool from libvirt

type StoragePoolType

type StoragePoolType string

Jump to

Keyboard shortcuts

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