Documentation
¶
Index ¶
- Variables
- func DMDevPath(vg, lv string) string
- func DMName(vg, lv string) string
- func IsCapable() bool
- func PVScan(log *plog.Logger) error
- func WithLogger(log *plog.Logger) funcopt.O
- type LV
- func (t *LV) Activate(ctx context.Context) error
- func (t *LV) Attrs(ctx context.Context) (LVAttrs, error)
- func (t *LV) Create(ctx context.Context, size string, args []string) error
- func (t *LV) Deactivate(ctx context.Context) error
- func (t LV) DevPath() string
- func (t *LV) Devices(ctx context.Context) (device.L, error)
- func (t LV) DriverName() string
- func (t *LV) Exists(ctx context.Context) (bool, error)
- func (t LV) FQN() string
- func (t *LV) IsActive(ctx context.Context) (bool, error)
- func (t *LV) Log() *plog.Logger
- func (t *LV) Remove(ctx context.Context, args []string) error
- func (t *LV) SetLog(log *plog.Logger)
- func (t *LV) Show(ctx context.Context) (*LVInfo, error)
- func (t *LV) Wipe(ctx context.Context) error
- type LVAttr
- type LVAttrIndex
- type LVAttrs
- type LVInfo
- type LVReport
- type ShowData
- type VG
- func (t *VG) Activate(ctx context.Context) error
- func (t *VG) ActiveLVs() (device.L, error)
- func (t *VG) AddNodeTag(ctx context.Context) error
- func (t *VG) AddTag(ctx context.Context, s string) error
- func (t *VG) Attrs(ctx context.Context) (VGAttrs, error)
- func (t *VG) CachedDevicesShow(ctx context.Context) (*VGInfo, error)
- func (t *VG) CachedNormalShow(ctx context.Context) (l []VGInfo, err error)
- func (t *VG) Create(ctx context.Context, size string, pvs []string, options []string) error
- func (t *VG) Deactivate(ctx context.Context) error
- func (t *VG) DelNodeTag(ctx context.Context) error
- func (t *VG) DelTag(ctx context.Context, s string) error
- func (t *VG) Devices(ctx context.Context) (device.L, error)
- func (t VG) DriverName() string
- func (t *VG) Exists(ctx context.Context) (bool, error)
- func (t VG) FQN() string
- func (t *VG) HasNodeTag(ctx context.Context) (bool, error)
- func (t *VG) HasTag(ctx context.Context, s string) (bool, error)
- func (t *VG) ImportDevices(ctx context.Context) error
- func (t *VG) IsActive(ctx context.Context) (bool, error)
- func (t *VG) Log() *plog.Logger
- func (t *VG) PVs(ctx context.Context) (device.L, error)
- func (t *VG) Remove(ctx context.Context, args []string) error
- func (t *VG) SetLog(log *plog.Logger)
- func (t *VG) Show(ctx context.Context, fields string) (*VGInfo, error)
- func (t *VG) Tags(ctx context.Context) ([]string, error)
- func (t *VG) Wipe() error
- type VGAttr
- type VGAttrIndex
- type VGAttrs
- type VGInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrExist = errors.New("does not exist")
)
Functions ¶
Types ¶
type LV ¶
func (LV) DriverName ¶
func (t LV) DriverName() string
type LVAttr ¶
type LVAttr rune
const ( LVAttrStateActive LVAttr = 'a' LVAttrStateHistorical LVAttr = 'h' LVAttrStateSuspended LVAttr = 's' LVAttrStateInvalidSnapshot LVAttr = 'I' LVAttrStateSuspendedSnapshot LVAttr = 'S' LVAttrStateSnapshotMergeFailed LVAttr = 'm' LVAttrStateSuspendedSnapshotMergeFailed LVAttr = 'M' LVAttrStateMappedDevicePresentWithoutTable LVAttr = 'd' LVAttrStateMappedDevicePresentWithInactiveTable LVAttr = 'i' LVAttrStateThinPoolCheckNeeded LVAttr = 'c' LVAttrStateSuspendedThinPoolCheckNeeded LVAttr = 'C' LVAttrStateUnknown LVAttr = 'X' )
type LVAttrIndex ¶
type LVAttrIndex uint8
const ( LVAttrIndexType LVAttrIndex = 0 LVAttrIndexPermissions LVAttrIndex = iota LVAttrIndexAllocationPolicy LVAttrIndexAllocationFixedMinor LVAttrIndexState LVAttrIndexDeviceOpen LVAttrIndexTargetType LVAttrIndexZeroDataBlocks LVAttrIndexVolumeHealth LVAttrIndexSkipActivation )
type LVAttrs ¶
type LVAttrs string
func (LVAttrs) Attr ¶
func (t LVAttrs) Attr(index LVAttrIndex) LVAttr
type LVInfo ¶
type LVInfo struct {
LVName string `json:"lv_name"`
VGName string `json:"vg_name"`
LVAttr string `json:"lv_attr"`
LVSize string `json:"lv_size"`
Origin string `json:"origin"`
DataPercent string `json:"data_percent"`
CopyPercent string `json:"copy_percent"`
MetadataPercent string `json:"metadata_percent"`
MetadataDevices string `json:"metadata_devices"`
MovePV string `json:"move_pv"`
ConvertPV string `json:"convert_pv"`
MirrorLog string `json:"mirror_log"`
Devices string `json:"devices"`
}
type VG ¶
type VG struct {
VGName string
// contains filtered or unexported fields
}
func (*VG) CachedNormalShow ¶
CachedNormalShow retrieves cached volume group information, unmarshals the output data, and filters by the specified VGName.
It uses the command: vgs --reportformat json -o "+tags,pv_name". => The following cmd output will return 2 entries when t.VGName == "data"
{
"report": [
{"vg": [
{"vg_name": "data", "pv_count": "1", "lv_count": "0", "snap_count": "0", "vg_attr": "wz--n-","vg_size": "<5.00g", "vg_free": "<5.00g", "vg_tags": "local", "pv_name": "/dev/vdb"},
{"vg_name": "data", "pv_count": "1", "lv_count": "0", "snap_count": "0", "vg_attr": "wz--n-","vg_size": "<5.00g", "vg_free": "<5.00g", "vg_tags": "local", "pv_name": "/dev/vdc"},
{"vg_name": "root", "pv_count": "1", "lv_count": "2", "snap_count": "0", "vg_attr": "wz--n-","vg_size": "<38.75g", "vg_free": "0 ", "vg_tags": "local", "pv_name": "/dev/vda3"}
]}
]
}
func (VG) DriverName ¶
func (t VG) DriverName() string
type VGAttr ¶
type VGAttr rune
const ( VGAttrStateWriteable VGAttr = 'w' VGAttrStateReadOnly VGAttr = 'r' VGAttrStateResizeable VGAttr = 'z' VGAttrStateExported VGAttr = 'x' VGAttrStatePartial VGAttr = 'p' VGAttrStateAllocContiguous VGAttr = 'c' VGAttrStateAllocCling VGAttr = 'l' VGAttrStateAllocNormal VGAttr = 'n' VGAttrStateAllocAnywhere VGAttr = 'a' VGAttrStateClustered VGAttr = 'c' )
type VGAttrIndex ¶
type VGAttrIndex uint8
const ( VGAttrIndexPermissions VGAttrIndex = 0 VGAttrIndexResizeable VGAttrIndex = iota VGAttrIndexExported VGAttrIndexPartial VGAttrIndexAllocationPolicy )
type VGAttrs ¶
type VGAttrs string
func (VGAttrs) Attr ¶
func (t VGAttrs) Attr(index VGAttrIndex) VGAttr
type VGInfo ¶
type VGInfo struct {
VGName string `json:"vg_name"`
VGAttr string `json:"vg_attr"`
VGSize string `json:"vg_size"`
VGFree string `json:"vg_free"`
VGTags string `json:"vg_tags"`
SnapCount string `json:"snap_count"`
PVCount string `json:"pv_count"`
LVCount string `json:"lv_count"`
PVName string `json:"pv_name"`
LVName string `json:"lv_name"`
Devices string `json:"devices"`
}
Click to show internal directories.
Click to hide internal directories.