hardware

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJobsWithErrorInHandler

func GetJobsWithErrorInHandler() uint16

Returns the number of registered failed jobs of the last running daemon (can also be the current daemon)

func GetPendingJobCount

func GetPendingJobCount() int

Returns the number of currently pending jobs in the queue

func GetPowerState

func GetPowerState(switchId string) (bool, error)

Returns the power state of a given switch Checks if the switch exists beforehand

func Init

func Init()

func InitLogger

func InitLogger(logger *logrus.Logger)

func RunNodeCheck

func RunNodeCheck() error

Runs a health-check on all nodes of the system Used in system-level healthcheck

func SetPower

func SetPower(switchId string, powerOn bool) error

As setPower, just with additional logs

func SetSwitchPowerAll

func SetSwitchPowerAll(switchId string, powerOn bool, username string) error

Sets the power-state of a specific switch Checks if the switch exists Checks if the user has all required permissions Sends a power request to all available nodes

Types

type JobResult

type JobResult struct {
	Id    int64 `json:"id"`
	Error error `json:"error"`
}

func GetResults

func GetResults() []JobResult

Returns the current state of the results queue

type PowerJob

type PowerJob struct {
	Id     int64  `json:"id"`
	Switch string `json:"switch"`
	Power  bool   `json:"power"`
}

func GetPendingJobs

func GetPendingJobs() []PowerJob

Returns the current state of the job queue

type PowerRequest

type PowerRequest struct {
	Switch string `json:"switch"`
	Power  bool   `json:"power"`
}

Jump to

Keyboard shortcuts

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