Documentation ¶
Index ¶
- Constants
- type PredicateFunc
- type Stats
- type VolumeStats
- func (v *VolumeStats) Build() (*VolumeStats, error)
- func (v *VolumeStats) Execute() (*ZFSStats, error)
- func (v *VolumeStats) Validate() *VolumeStats
- func (v *VolumeStats) WithCheck(check ...PredicateFunc) *VolumeStats
- func (v *VolumeStats) WithCommand(Command string) *VolumeStats
- func (v *VolumeStats) WithDataset(Dataset string) *VolumeStats
- func (v *VolumeStats) WithExecutor(executor bin.Executor) *VolumeStats
- func (v *VolumeStats) WithProperty(key string) *VolumeStats
- type ZFSStats
Constants ¶
const (
// Operation defines type of zfs operation
Operation = "stats"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PredicateFunc ¶
type PredicateFunc func(*VolumeStats) bool
PredicateFunc defines data-type for validation function
func IsCommandSet ¶
func IsCommandSet() PredicateFunc
IsCommandSet method check if the Command field of VolumeStats object is set.
func IsDatasetSet ¶
func IsDatasetSet() PredicateFunc
IsDatasetSet method check if the Dataset field of VolumeStats object is set.
func IsExecutorSet ¶
func IsExecutorSet() PredicateFunc
IsExecutorSet method check if the Executor field of VolumeStats object is set.
func IsProplistSet ¶
func IsProplistSet() PredicateFunc
IsProplistSet method check if the Property field of VolumeStats object is set.
type Stats ¶
type Stats struct { // Name of the zfs volume. Usually naming convention // will be pool_name/volume_name Name string `json:"name"` // Status of the zfs volume like Healthy, Degraded, Offline, Error Status string `json:"status"` // RebuildStatus of the zfs volume dataset. Following are possible states /* // rebuilding can be initiated ZVOL_REBUILDING_INIT // zvol is rebuilding snapshots ZVOL_REBUILDING_SNAP // zvol is rebuilding active dataset ZVOL_REBUILDING_AFS // Rebuilding completed with success ZVOL_REBUILDING_DONE // errored during rebuilding, but not completed ZVOL_REBUILDING_ERRORED // Rebuilding completed with error ZVOL_REBUILDING_FAILED */ RebuildStatus string `json:"rebuildStatus"` IsIOAckSenderCreated int `json:"isIOAckSenderCreated"` IsIOReceiverCreated int `json:"isIOReceiverCreated"` RunningIONum int `json:"runningIONum"` CheckpointedIONum int `json:"checkpointedIONum"` DegradedCheckpointedIONum int `json:"degradedCheckpointedIONum"` CheckpointedTime int `json:"checkpointedTime"` RebuildBytes int `json:"rebuildBytes"` RebuildCnt int `json:"rebuildCnt"` RebuildDoneCnt int `json:"rebuildDoneCnt"` RebuildFailedCnt int `json:"rebuildFailedCnt"` Quorum int `json:"quorum"` }
Stats contain the zfs volume dataset related stats
type VolumeStats ¶
type VolumeStats struct { //list of property Proplist []string //name of dataset on which snapshot should be taken Dataset string // command string Command string // Executor is used to execute zfs commands Executor bin.Executor // contains filtered or unexported fields }
VolumeStats defines structure for volume 'Stats' operation
func NewVolumeStats ¶
func NewVolumeStats() *VolumeStats
NewVolumeStats returns new instance of object VolumeStats
func (*VolumeStats) Build ¶
func (v *VolumeStats) Build() (*VolumeStats, error)
Build returns the VolumeStats object generated by builder
func (*VolumeStats) Execute ¶
func (v *VolumeStats) Execute() (*ZFSStats, error)
Execute is to execute generated VolumeStats object
func (*VolumeStats) Validate ¶
func (v *VolumeStats) Validate() *VolumeStats
Validate is to validate generated VolumeStats object by builder
func (*VolumeStats) WithCheck ¶
func (v *VolumeStats) WithCheck(check ...PredicateFunc) *VolumeStats
WithCheck add given check to checks list
func (*VolumeStats) WithCommand ¶
func (v *VolumeStats) WithCommand(Command string) *VolumeStats
WithCommand method fills the Command field of VolumeStats object.
func (*VolumeStats) WithDataset ¶
func (v *VolumeStats) WithDataset(Dataset string) *VolumeStats
WithDataset method fills the Dataset field of VolumeStats object.
func (*VolumeStats) WithExecutor ¶
func (v *VolumeStats) WithExecutor(executor bin.Executor) *VolumeStats
WithExecutor method fills the Executor field of VolumeStats object.
func (*VolumeStats) WithProperty ¶
func (v *VolumeStats) WithProperty(key string) *VolumeStats
WithProperty method fills the Proplist field of VolumeStats object.