hpilo4

package
v0.0.0-...-ff15c93 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	ServerAddr string
	// contains filtered or unexported fields
}

func NewApi

func NewApi(serverAddr string, insecureSsl bool) (*Api, error)

func (*Api) Do

func (api *Api) Do(req *http.Request) (*http.Response, error)

func (*Api) Get

func (api *Api) Get(path string) (*http.Response, error)

func (*Api) GetJson

func (api *Api) GetJson(path string, obj interface{}) error

func (*Api) GetMetrics

func (api *Api) GetMetrics() (string, error)

func (*Api) GetSensors

func (api *Api) GetSensors() (*model.ServerSensorReadings, error)

func (*Api) GetSensorsRaw

func (api *Api) GetSensorsRaw() (interface{}, error)

func (*Api) Login

func (api *Api) Login(username, password string) error

func (*Api) Logout

func (api *Api) Logout() error

func (*Api) Name

func (api *Api) Name() string

func (*Api) NewRequest

func (api *Api) NewRequest(method, path string, body io.Reader) (*http.Request, error)

func (*Api) PowerCommand

func (api *Api) PowerCommand(command int) error

type PowerSuppliesResponse

type PowerSuppliesResponse struct {
	PresentPowerReading int                   `json:"present_power_reading"`
	Supplies            []PowerSupplyResponse `json:"supplies"`
}

type PowerSupplyResponse

type PowerSupplyResponse struct {
	Unhealthy        int    `json:"unhealthy"`
	Enabled          int    `json:"enabled"`
	Mismatch         int    `json:"mismatch"`
	PsBay            int    `json:"ps_bay"`
	PsPresent        string `json:"ps_present"`
	PsCondition      string `json:"ps_condition"`
	PsErrorCode      string `json:"ps_error_code"`
	PsIpduCapable    string `json:"ps_ipdu_capable"`
	PsHotplugCapable string `json:"ps_hotplug_capable"`
	PsModel          string `json:"ps_model"`
	PsSpare          string `json:"ps_spare"`
	PsSerialNum      string `json:"ps_serial_num"`
	PsMaxCapWatts    int    `json:"ps_max_cap_watts"`
	PsFwVer          string `json:"ps_fw_ver"`
	PsInputVolts     int    `json:"ps_input_volts"`
	PsOutputWatts    int    `json:"ps_output_watts"`
	Average          int    `json:"avg"`
	Max              int    `json:"max"`
	Supply           bool   `json:"supply"`
	Bbu              bool   `json:"bbu"`
	Charge           int    `json:"charge"`
	Age              int    `json:"age"`
	BatteryHealth    int    `json:"battery_health"`
}

type TemperatureSensorResponse

type TemperatureSensorResponse struct {
	Label          string `json:"label"`
	XPosition      int    `json:"xposition"`
	YPosition      int    `json:"yposition"`
	Location       string `json:"location"`
	Status         string `json:"status"`
	CurrentReading int    `json:"currentreading"`
	Caution        int    `json:"caution"`
	Critical       int    `json:"critical"`
	TempUnit       string `json:"temp_unit"`
}

type TemperatureSensorsResponse

type TemperatureSensorsResponse struct {
	HostPowerState string                      `json:"hostpwr_state"`
	Temperatures   []TemperatureSensorResponse `json:"temperature"`
}

Jump to

Keyboard shortcuts

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