redfish

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParamsInit

func ParamsInit(host, device_model string) (urlprefix, tokenurl string, isBasicAuth bool, params map[string]map[string]string)

func RedFishCollect

func RedFishCollect(host, username, password, device_model string) (ok bool, err error)

采集设备所有数据并入库

Types

type JsonRedFish

type JsonRedFish struct {
	Memory map[string]interface{}
}

type NetworkData

type NetworkData struct {
	InterfaceName string
	MacAddress    []string
}

type Redfish

type Redfish struct {
	Username  string
	Password  string
	URLPrefix string
	Mode      string
	Token     string

	Tokenurl  string
	Json      map[string]interface{}
	Host      string
	Cpu       int8
	Mem       int8
	Pcie      int8
	Disk      int8
	BasicAuth string

	Params map[string]map[string]string
	Log    *log.Logger
	// contains filtered or unexported fields
}

func NewRedFish

func NewRedFish() *Redfish

func (*Redfish) DeleteSession

func (redf *Redfish) DeleteSession() (err error)

func (*Redfish) GetBMCIp

func (redf *Redfish) GetBMCIp() (ok bool, err error)

获取BMC

func (*Redfish) GetBaseInfo

func (redf *Redfish) GetBaseInfo() (err error)

func (*Redfish) GetChassisEmbedded

func (redf *Redfish) GetChassisEmbedded() (r *req.Resp)

func (*Redfish) GetCpuInfo

func (redf *Redfish) GetCpuInfo() (ok bool, err error)

获取cpu详细信息

func (*Redfish) GetCpuSummary

func (redf *Redfish) GetCpuSummary() (processor_summary interface{})

获取cpu简略信息

func (*Redfish) GetInfo

func (redf *Redfish) GetInfo(URL_suffix string) (r *req.Resp)

func (*Redfish) GetManagersEmbedded

func (redf *Redfish) GetManagersEmbedded() (r *req.Resp)

func (*Redfish) GetMemoryInfo

func (redf *Redfish) GetMemoryInfo() (ok bool, err error)

func (*Redfish) GetMemorySummary

func (redf *Redfish) GetMemorySummary() (totalSystemMemory interface{})

func (*Redfish) GetNetWork

func (redf *Redfish) GetNetWork() (ok bool, err error)

func (*Redfish) GetNetWorkInfo

func (redf *Redfish) GetNetWorkInfo() (ok bool, err error)

func (*Redfish) GetNetworkInterfaces

func (redf *Redfish) GetNetworkInterfaces() (ok bool, err error)

获取网卡信息

func (*Redfish) GetPCIe

func (redf *Redfish) GetPCIe() (ok bool, err error)

获取电源信息

func (*Redfish) GetPhysicalDisk

func (redf *Redfish) GetPhysicalDisk() (ok bool, err error)

获取硬盘详细信息

func (*Redfish) GetPowerControl

func (redf *Redfish) GetPowerControl() (ok bool, err error)

func (*Redfish) GetPowerSupply

func (redf *Redfish) GetPowerSupply() (ok bool, err error)

获取电源信息

func (*Redfish) GetRedfishVersion

func (redf *Redfish) GetRedfishVersion() (err error)

func (*Redfish) GetSerial

func (redf *Redfish) GetSerial() (err error)

func (*Redfish) GetSysEmbedded

func (redf *Redfish) GetSysEmbedded() (r *req.Resp)

func (*Redfish) GetV1

func (redf *Redfish) GetV1() (r *req.Resp)

func (*Redfish) HeadGet

func (redf *Redfish) HeadGet(device_model string) (header map[string]string)

func (*Redfish) RedFishToJson

func (redf *Redfish) RedFishToJson() (ok bool, err error)

保存json数据

func (*Redfish) RedfishCollect

func (redf *Redfish) RedfishCollect(host, username, password, device_model string) (ok bool, err error)

type ResultRedFish

type ResultRedFish struct {
	Json map[string]interface{}
	Host string
	Mode string
}

func NewResultRedFish

func NewResultRedFish() *ResultRedFish

func (*ResultRedFish) GetBMC

func (res *ResultRedFish) GetBMC() (info []map[string]interface{})

获取BMC

func (*ResultRedFish) GetBMCVersion

func (res *ResultRedFish) GetBMCVersion() (bmcVersion string)

获取BMCVersion

func (*ResultRedFish) GetBasicServer

func (res *ResultRedFish) GetBasicServer() (result *basicServer)

获取基础信息

func (*ResultRedFish) GetBiosVersion

func (res *ResultRedFish) GetBiosVersion() (biosVersion string)

获取BiosVersion

func (*ResultRedFish) GetCpu

func (res *ResultRedFish) GetCpu() (info []map[string]interface{})

获取Cpu

func (*ResultRedFish) GetDeviceType

func (res *ResultRedFish) GetDeviceType() (deviceType string)

获取设备类型

func (*ResultRedFish) GetHostname

func (res *ResultRedFish) GetHostname() (hostName string)

获取主机名

func (*ResultRedFish) GetManufacturer

func (res *ResultRedFish) GetManufacturer() (manufacturer string)

获取厂商

func (*ResultRedFish) GetMem

func (res *ResultRedFish) GetMem() (info []map[string]interface{})

获取Mem

func (*ResultRedFish) GetModel

func (res *ResultRedFish) GetModel() (model string)

获取model

func (*ResultRedFish) GetNetwork

func (res *ResultRedFish) GetNetwork() (info []map[string]interface{})

获取网卡信息

func (*ResultRedFish) GetPCi

func (res *ResultRedFish) GetPCi() (info []map[string]interface{})

获取电源

func (*ResultRedFish) GetPartNumber

func (res *ResultRedFish) GetPartNumber() (partNumber string)

获取SerialNumber

func (*ResultRedFish) GetPower

func (res *ResultRedFish) GetPower() (info []map[string]interface{})

获取电源

func (*ResultRedFish) GetSerialNumber

func (res *ResultRedFish) GetSerialNumber() (serialNumber string)

获取SerialNumber

func (*ResultRedFish) GetStorage

func (res *ResultRedFish) GetStorage() (info []map[string]interface{})

获取硬盘数据

func (*ResultRedFish) GetWatts

func (res *ResultRedFish) GetWatts() (watts string)

获取Watts

func (*ResultRedFish) RedFishToMap

func (res *ResultRedFish) RedFishToMap(host, mode string)

----------------------------解析数据------------------------------ 去redis数据并专为json

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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