v1alpha1

package
v1.11.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Binary represent zpool binary
	Binary = "zpool"
	// Offline ...
	Offline ZpoolStatus = "OFFLINE"
	// Online ...
	Online ZpoolStatus = "ONLINE"
	// Degraded ...
	Degraded ZpoolStatus = "DEGRADED"
	// Faulted ...
	Faulted ZpoolStatus = "FAULTED"
	// Removed ...
	Removed ZpoolStatus = "REMOVED"
	// Unavail ...
	Unavail ZpoolStatus = "UNAVAIL"
	// NoPoolAvailable ...
	NoPoolAvailable ZpoolStatus = "no pools available"
	// InitializeLibuzfsClientErr ...
	InitializeLibuzfsClientErr ZpoolStatus = "failed to initialize libuzfs client"
	// InCompleteStdoutErr is err msg when recieved output id incomplete
	InCompleteStdoutErr = "Couldn't receive complete output"

	// ZpoolLastSyncCommandErrorOrUnknownUnset is for setting value as 0 for zpool last sync metrics
	ZpoolLastSyncCommandErrorOrUnknownUnset = 0

	// ZpoolLastSyncCommandErrorOrUnknownSet is for setting value as 1 for zpool last sync metrics
	ZpoolLastSyncCommandErrorOrUnknownSet = 1
)

Variables

View Source
var (
	// Status is map of zpool status with values
	Status = map[ZpoolStatus]float64{
		Offline:         0,
		Online:          1,
		Degraded:        2,
		Faulted:         3,
		Removed:         4,
		Unavail:         5,
		NoPoolAvailable: 6,
	}
)

Functions

func IsNotAvailable

func IsNotAvailable(str string) bool

IsNotAvailable checks whether any pool is availble or not.

func IsNotInitialized

func IsNotInitialized(str string) bool

IsNotInitialized checks whether libuzfs client initialized or not.

func Run

func Run(runner exec.Runner) ([]byte, error)

Run is wrapper over RunCommandWithTimeoutContext for running zpool commands

Types

type Stats

type Stats struct {
	Status              ZpoolStatus // Status represents status of a Pool
	Name                string
	Used                string // Used size of Pools
	Free                string // Free size of Pools
	Size                string // Size of pool
	UsedCapacityPercent string // Used size of pools in precent
}

Stats is used to store the values of parsed stats of zpool list -Hp command

func ListParser

func ListParser(output []byte) (Stats, error)

ListParser parses output of zpool list -Hp Command: zpool list -Hp Output: cstor-5ce4639a-2dc1-11e9-bbe3-42010a80017a 10670309376 716288 10669593088 - 0 0 1.00 ONLINE -

type ZpoolStatus

type ZpoolStatus string

ZpoolStatus is pool's status

func (ZpoolStatus) String

func (z ZpoolStatus) String() string

String returns string

Jump to

Keyboard shortcuts

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