hardware

package
v0.0.26-beta-rc.4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: GPL-2.0 Imports: 11 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

Check all nodes for uptime

func SetPower

func SetPower(switchName string, powerOn bool) error

Main interface for interacting with the queuing system Usage: SetPower("s1", true) Waits until all jobs are completed, can return an error

func SetSwitchPowerAll

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

Sets the powerstate of a specific switch Checks if the switch exists Checks if the user has all required permissions

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