redfish

package
v0.3.10-0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 20 Imported by: 11

Documentation

Index

Constants

View Source
const (
	EVENT_TYPE_SYSTEM  = "system"
	EVENT_TYPE_MANAGER = "manager"
)

Variables

This section is empty.

Functions

func Int2str

func Int2str(i int) string

func MountVirtualCdrom

func MountVirtualCdrom(ctx context.Context, api IRedfishDriver, cdromUrl string, boot bool) error

func RegisterApiFactory

func RegisterApiFactory(f IRedfishDriverFactory)

func RegisterDefaultApiFactory

func RegisterDefaultApiFactory(f IRedfishDriverFactory)

func SortEvents

func SortEvents(el []SEvent)

func UmountVirtualCdrom

func UmountVirtualCdrom(ctx context.Context, api IRedfishDriver) error

Types

type IRedfishDriver

type IRedfishDriver interface {
	Login(ctx context.Context) error
	Logout(ctx context.Context) error

	Probe(ctx context.Context) error

	BasePath() string
	VersionKey() string
	LinkKey() string
	MemberKey() string
	LogItemsKey() string

	ParseRoot(root jsonutils.JSONObject) error

	GetParent(parent jsonutils.JSONObject) jsonutils.JSONObject

	GetResource(ctx context.Context, resname ...string) (string, jsonutils.JSONObject, error)
	GetResourceCount(ctx context.Context, resname ...string) (int, error)

	GetVirtualCdromInfo(ctx context.Context) (string, SCdromInfo, error)
	MountVirtualCdrom(ctx context.Context, path string, cdromUrl string, boot bool) error
	UmountVirtualCdrom(ctx context.Context, path string) error

	GetLanConfigs(ctx context.Context) ([]types.SIPMILanConfig, error)

	GetSystemInfo(ctx context.Context) (string, SSystemInfo, error)
	SetNextBootDev(ctx context.Context, dev string) error

	Reset(ctx context.Context, action string) error

	GetSystemLogsPath() string
	GetManagerLogsPath() string
	GetClearSystemLogsPath() string
	GetClearManagerLogsPath() string
	ReadSystemLogs(ctx context.Context, since time.Time) ([]SEvent, error)
	ReadManagerLogs(ctx context.Context, since time.Time) ([]SEvent, error)
	ClearSystemLogs(ctx context.Context) error
	ClearManagerLogs(ctx context.Context) error

	BmcReset(ctx context.Context) error

	GetBiosInfo(ctx context.Context) (SBiosInfo, error)

	GetIndicatorLED(ctx context.Context) (bool, error)
	SetIndicatorLED(ctx context.Context, on bool) error

	GetPowerPath() string
	GetThermalPath() string
	GetPower(ctx context.Context) ([]SPower, error)
	GetThermal(ctx context.Context) ([]STemperature, error)

	GetNTPConf(ctx context.Context) (SNTPConf, error)
	SetNTPConf(ctx context.Context, conf SNTPConf) error

	GetConsoleJNLP(ctx context.Context) (string, error)
}

func NewRedfishDriver

func NewRedfishDriver(ctx context.Context, endpoint string, username, password string, debug bool) IRedfishDriver

type IRedfishDriverFactory

type IRedfishDriverFactory interface {
	Name() string
	NewApi(endpoint, username, password string, debug bool) IRedfishDriver
}

type SBaseRedfishClient

type SBaseRedfishClient struct {
	object.SObject

	SessionToken string

	Version    string
	Registries map[string]string

	IsDebug bool
	// contains filtered or unexported fields
}

func NewBaseRedfishClient

func NewBaseRedfishClient(endpoint string, username, password string, debug bool) SBaseRedfishClient

func (*SBaseRedfishClient) BmcReset

func (r *SBaseRedfishClient) BmcReset(ctx context.Context) error

func (*SBaseRedfishClient) ClearLogs

func (r *SBaseRedfishClient) ClearLogs(ctx context.Context, urlPath string, subsys string, index int) error

func (*SBaseRedfishClient) ClearManagerLogs

func (r *SBaseRedfishClient) ClearManagerLogs(ctx context.Context) error

func (*SBaseRedfishClient) ClearSystemLogs

func (r *SBaseRedfishClient) ClearSystemLogs(ctx context.Context) error

func (*SBaseRedfishClient) Delete

func (*SBaseRedfishClient) Get

func (*SBaseRedfishClient) GetBiosInfo

func (r *SBaseRedfishClient) GetBiosInfo(ctx context.Context) (SBiosInfo, error)

func (*SBaseRedfishClient) GetClearManagerLogsPath

func (r *SBaseRedfishClient) GetClearManagerLogsPath() string

func (*SBaseRedfishClient) GetClearSystemLogsPath

func (r *SBaseRedfishClient) GetClearSystemLogsPath() string

func (*SBaseRedfishClient) GetConsoleJNLP

func (r *SBaseRedfishClient) GetConsoleJNLP(ctx context.Context) (string, error)

func (*SBaseRedfishClient) GetEndpoint

func (r *SBaseRedfishClient) GetEndpoint() string

func (*SBaseRedfishClient) GetHost

func (r *SBaseRedfishClient) GetHost() string

func (*SBaseRedfishClient) GetIndicatorLED

func (r *SBaseRedfishClient) GetIndicatorLED(ctx context.Context) (bool, error)

func (*SBaseRedfishClient) GetIndicatorLEDInternal

func (r *SBaseRedfishClient) GetIndicatorLEDInternal(ctx context.Context, subsys string) (string, string, error)

func (*SBaseRedfishClient) GetLanConfigs

func (r *SBaseRedfishClient) GetLanConfigs(ctx context.Context) ([]types.SIPMILanConfig, error)

func (*SBaseRedfishClient) GetManagerLogsPath

func (r *SBaseRedfishClient) GetManagerLogsPath() string

func (*SBaseRedfishClient) GetNTPConf

func (r *SBaseRedfishClient) GetNTPConf(ctx context.Context) (SNTPConf, error)

func (*SBaseRedfishClient) GetPassword

func (r *SBaseRedfishClient) GetPassword() string

func (*SBaseRedfishClient) GetPower

func (r *SBaseRedfishClient) GetPower(ctx context.Context) ([]SPower, error)

func (*SBaseRedfishClient) GetPowerPath

func (r *SBaseRedfishClient) GetPowerPath() string

func (*SBaseRedfishClient) GetResource

func (r *SBaseRedfishClient) GetResource(ctx context.Context, resname ...string) (string, jsonutils.JSONObject, error)

func (*SBaseRedfishClient) GetResourceCount

func (r *SBaseRedfishClient) GetResourceCount(ctx context.Context, resname ...string) (int, error)

func (*SBaseRedfishClient) GetSystemInfo

func (r *SBaseRedfishClient) GetSystemInfo(ctx context.Context) (string, SSystemInfo, error)

func (*SBaseRedfishClient) GetSystemLogsPath

func (r *SBaseRedfishClient) GetSystemLogsPath() string

func (*SBaseRedfishClient) GetThermal

func (r *SBaseRedfishClient) GetThermal(ctx context.Context) ([]STemperature, error)

func (*SBaseRedfishClient) GetThermalPath

func (r *SBaseRedfishClient) GetThermalPath() string

func (*SBaseRedfishClient) GetUsername

func (r *SBaseRedfishClient) GetUsername() string

func (*SBaseRedfishClient) GetVirtualCdromInfo

func (r *SBaseRedfishClient) GetVirtualCdromInfo(ctx context.Context) (string, SCdromInfo, error)

func (*SBaseRedfishClient) GetVirtualCdromJSON

func (r *SBaseRedfishClient) GetVirtualCdromJSON(ctx context.Context) (string, jsonutils.JSONObject, error)

func (*SBaseRedfishClient) IRedfishDriver

func (r *SBaseRedfishClient) IRedfishDriver() IRedfishDriver

func (*SBaseRedfishClient) Login

func (r *SBaseRedfishClient) Login(ctx context.Context) error

func (*SBaseRedfishClient) Logout

func (r *SBaseRedfishClient) Logout(ctx context.Context) error

func (*SBaseRedfishClient) MountVirtualCdrom

func (r *SBaseRedfishClient) MountVirtualCdrom(ctx context.Context, path string, cdromUrl string, boot bool) error

func (*SBaseRedfishClient) ParseRoot

func (r *SBaseRedfishClient) ParseRoot(root jsonutils.JSONObject) error

func (*SBaseRedfishClient) Patch

func (*SBaseRedfishClient) Post

func (*SBaseRedfishClient) Probe

func (r *SBaseRedfishClient) Probe(ctx context.Context) error

func (*SBaseRedfishClient) ReadManagerLogs

func (r *SBaseRedfishClient) ReadManagerLogs(ctx context.Context, since time.Time) ([]SEvent, error)

func (*SBaseRedfishClient) ReadSystemLogs

func (r *SBaseRedfishClient) ReadSystemLogs(ctx context.Context, since time.Time) ([]SEvent, error)

func (*SBaseRedfishClient) Reset

func (r *SBaseRedfishClient) Reset(ctx context.Context, action string) error

func (*SBaseRedfishClient) SetIndicatorLED

func (r *SBaseRedfishClient) SetIndicatorLED(ctx context.Context, on bool) error

func (*SBaseRedfishClient) SetIndicatorLEDInternal

func (r *SBaseRedfishClient) SetIndicatorLEDInternal(ctx context.Context, subsys string, val string) error

possible IndicatorLED values are: "Lit" or "Blinking" or "Off"

func (*SBaseRedfishClient) SetNTPConf

func (r *SBaseRedfishClient) SetNTPConf(ctx context.Context, conf SNTPConf) error

func (*SBaseRedfishClient) SetNextBootDev

func (r *SBaseRedfishClient) SetNextBootDev(ctx context.Context, dev string) error

func (*SBaseRedfishClient) SetNextBootVirtualCdrom

func (r *SBaseRedfishClient) SetNextBootVirtualCdrom(ctx context.Context) error

func (*SBaseRedfishClient) UmountVirtualCdrom

func (r *SBaseRedfishClient) UmountVirtualCdrom(ctx context.Context, path string) error

type SBiosInfo

type SBiosInfo struct {
}

type SCdromInfo

type SCdromInfo struct {
	Image         string `json:"Image"`
	SupportAction bool   `json:"SupportAction"`
}

type SEvent

type SEvent struct {
	Created  time.Time `json:"Created"`
	EventId  string    `json:"Id"`
	Message  string    `json:"Message"`
	Severity string    `json:"Severity"`
	Type     string    `json:"type"`
}

type SEventList

type SEventList []SEvent

func (SEventList) Len

func (el SEventList) Len() int

func (SEventList) Less

func (el SEventList) Less(i, j int) bool

func (SEventList) Swap

func (el SEventList) Swap(i, j int)

type SNTPConf

type SNTPConf struct {
	NTPServers      []string `json:"NTPServers,allowempty"`
	ProtocolEnabled bool     `json:"ProtocolEnabled,allowfalse"`
	TimeZone        string   `json:"TimeZone"`
}

type SPower

type SPower struct {
	PowerCapacityWatts int `json:"PowerCapacityWatts"`
	PowerConsumedWatts int `json:"PowerConsumedWatts"`
	PowerMetrics       struct {
		AverageConsumedWatts int `json:"AverageConsumedWatts"`
		IntervalInMin        int `json:"IntervalInMin"`
		MaxConsumedWatts     int `json:"MaxConsumedWatts"`
		MinConsumedWatts     int `json:"MinConsumedWatts"`
	} `json:"PowerMetrics"`
}

func (SPower) ToMetrics

func (p SPower) ToMetrics() []influxdb.SKeyValue

type SSystemInfo

type SSystemInfo struct {
	Manufacturer string   `json:"Manufacturer"`
	Model        string   `json:"Model"`
	SKU          string   `json:"SKU"`
	SerialNumber string   `json:"SerialNumber"`
	UUID         string   `json:"UUID"`
	EthernetNICs []string `json:"EthernetNICs"`
	MemoryGB     int      `json:"MemoryGB"`
	NodeCount    int      `json:"NodeCount"`
	CpuDesc      string   `json:"CpuDesc"`
	PowerState   string   `json:"PowerState"`
	NextBootDev  string   `json:"NextBootDev"`

	NextBootDevSupported []string `json:"NextBootDevSupported"`
	ResetTypeSupported   []string `json:"ResetTypeSupported"`
}

type STemperature

type STemperature struct {
	Name            string `json:"Name"`
	PhysicalContext string `json:"PhysicalContext"`
	ReadingCelsius  int    `json:"ReadingCelsius"`
}

func (STemperature) ToMetric

func (t STemperature) ToMetric() influxdb.SKeyValue

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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