nvmecli

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NVMCliCmdImpl is a base CMD for nvme_cli
	NVMCliCmdImpl = "nvme"
	// NVMeDeviceCmdImpl is a CMD for listing all nvme devices in JSON format
	NVMeDeviceCmdImpl = NVMCliCmdImpl + " list --output-format=json"
	// NVMeHealthCmdImpl is a CMD to get SMART information about NVMe device in JSON format
	NVMeHealthCmdImpl = NVMCliCmdImpl + " smart-log %s --output-format=json"
	// NVMeVendorCmdImpl is a CMD to get SMART information about NVMe device in JSON format
	NVMeVendorCmdImpl = NVMCliCmdImpl + " id-ctrl %s --output-format=json"
	// DevicesKey is the key to find NVMe devices in nvme json output
	DevicesKey = "Devices"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NVMDevice

type NVMDevice struct {
	DevicePath   string `json:"DevicePath,omitempty"`
	Firmware     string `json:"Firmware,omitempty"`
	ModelNumber  string `json:"ModelNumber,omitempty"`
	SerialNumber string `json:"SerialNumber,omitempty"`
	PhysicalSize int64  `json:"PhysicalSize,omitempty"`
	// Can VID be string for nvme?
	Vendor int `json:"vid,omitempty"`
	Health string
}

NVMDevice represents devices from nvme list output

type NVMECLI

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

NVMECLI is a wrap for system nvem_cli util

func NewNVMECLI

func NewNVMECLI(e command.CmdExecutor, logger *logrus.Logger) *NVMECLI

NewNVMECLI is a constructor for NVMECLI

func (*NVMECLI) GetNVMDevices

func (na *NVMECLI) GetNVMDevices() ([]NVMDevice, error)

GetNVMDevices gets information about NVMDevice using nvme_cli util

type SMARTLog

type SMARTLog struct {
	CriticalWarning int `json:"critical_warning,omitempty"`
}

SMARTLog represents SMART information for NVMe devices

type WrapNvmecli

type WrapNvmecli interface {
	GetNVMDevices() ([]NVMDevice, error)
}

WrapNvmecli is an interface that encapsulates operation with system nvme util

Jump to

Keyboard shortcuts

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