megarac

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: 15 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) Delete

func (api *Api) Delete(path string) (*http.Response, 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) Post

func (api *Api) Post(path string, data interface{}) (*http.Response, error)

func (*Api) PowerCommand

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

func (*Api) SessionId

func (api *Api) SessionId() string

type SensorResult

type SensorResult struct {
	Id            int     `json:"id"`
	SensorNumber  int     `json:"sensor_number"`
	Name          string  `json:"name"`
	OwnerId       int     `json:"owner_id"`
	OwnerLun      int     `json:"owner_lun"`
	RawReading    float64 `json:"raw_reading"`
	Reading       float64 `json:"reading"`
	Type          string  `json:"type"`
	TypeNumber    int     `json:"type_number"`
	SensorState   int     `json:"sensor_state"`
	DiscreteState int     `json:"discrete_state"`
	Accessible    int     `json:"accessible"`
	SettableFlag  int     `json:"settable_flag"`
	//LowerNonRecoverableThreshold  string  `json:"lower_non_recoverable_threshold"`
	//LowerCriticalThreshold        float64 `json:"lower_critical_threshold"`
	//LowerNonCriticalThreshold     float64 `json:"lower_non_critical_threshold"`
	//HigherNonCriticalThreshold    float64 `json:"higher_non_critical_threshold"`
	//HigherCriticalThreshold       float64 `json:"higher_critical_threshold"`
	//HigherNonRecoverableThreshold string  `json:"higher_non_recoverable_threshold"`
	Unit string `json:"unit"`
}

type SensorsResult

type SensorsResult []SensorResult

type Session

type Session struct {
	SessionId string
	CsrfToken string
}

Jump to

Keyboard shortcuts

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