Documentation
¶
Index ¶
- Constants
- Variables
- type AccountCreateData
- type AccountData
- type AccountPrivilegeMapOemHp
- type AccountPrivilegeMapOemHpe
- type AccountService
- type ActionInfoParameter
- type BaseRedfish
- type CSRData
- type ChassisData
- type Error
- type ErrorMessage
- type ErrorMessageExtendedInfo
- type FanData
- type HTTPResult
- type HTTPSCertActionsOemHp
- type HTTPSCertActionsOemHpe
- type HTTPSCertActionsOemHuawei
- type HTTPSCertDataOemHp
- type HTTPSCertDataOemHpe
- type HTTPSCertDataOemHuawei
- type LinkTargets
- type ManagerActionsData
- type ManagerActionsDataOemSupermicro
- type ManagerData
- type ManagerDataOemHp
- type ManagerDataOemHpFederationConfig
- type ManagerDataOemHpFirmware
- type ManagerDataOemHpFirmwareData
- type ManagerDataOemHpLicense
- type ManagerDataOemHpLinks
- type ManagerDataOemHpe
- type ManagerDataOemHpeFederationConfig
- type ManagerDataOemHpeFirmware
- type ManagerDataOemHpeFirmwareData
- type ManagerDataOemHpeLicense
- type ManagerDataOemHpeLinks
- type ManagerDataOemHuawei
- type ManagerDataOemHuaweiLoginRule
- type ManagerLicenseData
- type OData
- type PSUData
- type PowerControlData
- type PowerData
- type PowerLimitData
- type PowerMetricsData
- type Redfish
- func (r *Redfish) AddAccount(acd AccountCreateData) error
- func (r *Redfish) AddLicense(mgr *ManagerData, l []byte) error
- func (r *Redfish) ChangePassword(u string, p string) error
- func (r *Redfish) Clone() *Redfish
- func (r *Redfish) DeleteAccount(u string) error
- func (r *Redfish) FetchCSR() (string, error)
- func (r *Redfish) GenCSR(csr CSRData) error
- func (r *Redfish) GetAccountData(accountEndpoint string) (*AccountData, error)
- func (r *Redfish) GetAccounts() ([]string, error)
- func (r *Redfish) GetChassis() ([]string, error)
- func (r *Redfish) GetChassisData(chassisEndpoint string) (*ChassisData, error)
- func (r *Redfish) GetErrorMessage(rerr *Error) string
- func (r *Redfish) GetLicense(mgr *ManagerData) (*ManagerLicenseData, error)
- func (r *Redfish) GetManagerData(managerEndpoint string) (*ManagerData, error)
- func (r *Redfish) GetManagers() ([]string, error)
- func (r *Redfish) GetPowerData(powerEndpoint string) (*PowerData, error)
- func (r *Redfish) GetRoleData(roleEndpoint string) (*RoleData, error)
- func (r *Redfish) GetRoles() ([]string, error)
- func (r *Redfish) GetSystemData(systemEndpoint string) (*SystemData, error)
- func (r *Redfish) GetSystems() ([]string, error)
- func (r *Redfish) GetThermalData(thermalEndpoint string) (*ThermalData, error)
- func (r *Redfish) GetVendorFlavor() error
- func (r *Redfish) ImportCertificate(cert string) error
- func (r *Redfish) Initialise() error
- func (r *Redfish) IsInitialised() bool
- func (r *Redfish) IsInitialized() bool
- func (r *Redfish) Login() error
- func (r *Redfish) Logout() error
- func (r *Redfish) MapAccountsByID() (map[string]*AccountData, error)
- func (r *Redfish) MapAccountsByName() (map[string]*AccountData, error)
- func (r *Redfish) MapChassisByID() (map[string]*ChassisData, error)
- func (r *Redfish) MapManagersByID() (map[string]*ManagerData, error)
- func (r *Redfish) MapManagersByUUID() (map[string]*ManagerData, error)
- func (r *Redfish) MapRolesByID() (map[string]*RoleData, error)
- func (r *Redfish) MapRolesByName() (map[string]*RoleData, error)
- func (r *Redfish) MapSystemsByID() (map[string]*SystemData, error)
- func (r *Redfish) MapSystemsBySerialNumber() (map[string]*SystemData, error)
- func (r *Redfish) MapSystemsByUUID() (map[string]*SystemData, error)
- func (r *Redfish) ModifyAccount(u string, acd AccountCreateData) error
- func (r *Redfish) ModifyAccountByEndpoint(endpoint string, acd AccountCreateData) error
- func (r *Redfish) ProcessError(response HTTPResult) (*Error, error)
- func (r *Redfish) ResetSP() error
- func (r *Redfish) SetSystemPowerState(sd *SystemData, state string) error
- type RoleData
- type SecurityServiceDataOemHp
- type SecurityServiceDataOemHpLinks
- type SecurityServiceDataOemHpe
- type SecurityServiceDataOemHpeLinks
- type SecurityServiceDataOemHuawei
- type SecurityServiceDataOemHuaweiLinks
- type Status
- type SystemActionInfo
- type SystemActions
- type SystemActionsComputerReset
- type SystemData
- type SystemMemorySummary
- type SystemProcessorSummary
- type TemperatureData
- type ThermalData
- type VoltageData
- type X509CertInfo
Constants ¶
const ( RedfishFlavorNotInitialized uint = iota RedfishGeneral RedfishHP RedfishHPE RedfishHuawei RedfishInspur RedfishLenovo RedfishSuperMicro RedfishDell )
Redfish vendor flavors
const ( HasAccountService uint = 1 << iota // has AccountService endpoint HasSecurityService HasAccountRoles HasChassis HasLicense )
service processor capabilities
const ( HpePrivilegeNone = 0 HpePrivilegeLogin uint = 1 << iota HpePrivilegeRemoteConsole HpePrivilegeUserConfig HpePrivilegeVirtualMedia HpePrivilegeVirtualPowerAndReset HpePrivilegeIloConfig )
Bitset for privileges
const DELLEmptyAccountSlot = `{ "UserName": "", "Password": null }`
DELLEmptyAccountSlot - Payload for setting an account slot to an empty value
const GoRedfishVersion string = "1.2.1-20201102"
GoRedfishVersion - Library version Note: Be consistent with "Semantic Versioning 2.0.0" - see https://semver.org/
Variables ¶
var HPEPrivilegeMap = map[string]uint{ "login": HpePrivilegeLogin, "remoteconsole": HpePrivilegeRemoteConsole, "userconfig": HpePrivilegeUserConfig, "virtualmedia": HpePrivilegeVirtualMedia, "virtualpowerandreset": HpePrivilegeVirtualPowerAndReset, "iloconfig": HpePrivilegeIloConfig, }
HPEPrivilegeMap - map privilege names to flags
var HPEVirtualRoles = map[string]uint{ "none": 0, "readonly": HpePrivilegeLogin, "operator": HpePrivilegeLogin | HpePrivilegeRemoteConsole | HpePrivilegeVirtualMedia | HpePrivilegeVirtualPowerAndReset, "administrator": HpePrivilegeLogin | HpePrivilegeRemoteConsole | HpePrivilegeUserConfig | HpePrivilegeVirtualMedia | HpePrivilegeVirtualPowerAndReset | HpePrivilegeIloConfig, }
HPEVirtualRoles - "Virtual" roles with predefined privilege map set
var VendorCapabilities = map[string]uint{ "hp": HasAccountService | HasSecurityService | HasChassis | HasLicense, "hpe": HasAccountService | HasSecurityService | HasChassis | HasLicense, "huawei": HasAccountService | HasSecurityService | HasAccountRoles | HasChassis, "inspur": 0, "supermicro": HasAccountService | HasAccountRoles | HasChassis, "dell": HasAccountService | HasAccountRoles | HasChassis, "lenovo": HasChassis, "vanilla": HasAccountService | HasSecurityService | HasAccountRoles | HasChassis, "": HasAccountService | HasSecurityService | HasAccountRoles | HasChassis, }
VendorCapabilities - map capabilities by vendor
Functions ¶
This section is empty.
Types ¶
type AccountCreateData ¶
type AccountCreateData struct {
UserName string `json:",omitempty"`
Password string `json:",omitempty"`
// for service processors supporting roles
Role string `json:"RoleId,omitempty"`
Enabled *bool `json:",omitempty"`
Locked *bool `json:",omitempty"`
// for HP(E) iLO which supports Oem specific
// Note: OemHpPrivilegeMap is an _internal_ struct but must be exported for json.Marshal !
// Don't use this structm use HPEPrivileges instead
OemHpPrivilegeMap *AccountPrivilegeMapOemHp `json:",omitempty"`
HPEPrivileges uint
}
AccountCreateData - data for account creation
type AccountData ¶
type AccountData struct {
ID *string `json:"Id"`
Name *string `json:"Name"`
UserName *string `json:"UserName"`
Password *string `json:"Password"`
RoleID *string `json:"RoleId"`
Enabled *bool `json:"Enabled"`
Locked *bool `json:"Locked"`
SelfEndpoint *string
}
AccountData - individual accounts
type AccountPrivilegeMapOemHp ¶
type AccountPrivilegeMapOemHp struct {
Login bool `json:"LoginPriv"`
RemoteConsole bool `json:"RemoteConsolePriv"`
UserConfig bool `json:"UserConfigPriv"`
VirtualMedia bool `json:"VirtualMediaPriv"`
VirtualPowerAndReset bool `json:"VirtualPowerAndResetPriv"`
ILOConfig bool `json:"iLOConfigPriv"`
}
AccountPrivilegeMapOemHp - HP(E) uses it's own privilege map instead of roles
type AccountPrivilegeMapOemHpe ¶
type AccountPrivilegeMapOemHpe struct {
Login bool `json:"LoginPriv"`
RemoteConsole bool `json:"RemoteConsolePriv"`
UserConfig bool `json:"UserConfigPriv"`
VirtualMedia bool `json:"VirtualMediaPriv"`
VirtualPowerAndReset bool `json:"VirtualPowerAndResetPriv"`
ILOConfig bool `json:"iLOConfigPriv"`
}
AccountPrivilegeMapOemHpe - HP(E) uses it's own privilege map instead of roles
type AccountService ¶
type AccountService struct {
AccountsEndpoint *OData `json:"Accounts"`
RolesEndpoint *OData `json:"Roles"`
}
AccountService - Account handling
type ActionInfoParameter ¶
type ActionInfoParameter struct {
Name string `json:"Name"`
Required bool `json:"Required"`
DataType string `json:"DataType"`
AllowableValues []string `json:"AllowableValues"`
}
ActionInfoParameter - informations about allowed actions
type BaseRedfish ¶
type BaseRedfish interface {
Initialize() error
Login() error
Logout() error
GetSystems() ([]string, error)
GetSystemData(string) (*SystemData, error)
MapSystensByID() (map[string]*SystemData, error)
MapSystemsByUUID() (map[string]*SystemData, error)
MapSystemsBySerialNumber() (map[string]*SystemData, error)
GetAccounts() ([]string, error)
GetAccountData(string) (*AccountData, error)
MapAccountsByName() (map[string]*AccountData, error)
MapAccountsByID() (map[string]*AccountData, error)
GetRoles() ([]string, error)
GetRoleData(string) (*AccountData, error)
MapRolesByName() (map[string]*RoleData, error)
MapRolesByID() (map[string]*RoleData, error)
GenCSR(CSRData) error
FetchCSR() (string, error)
ImportCertificate(string) error
ResetSP() error
GetVendorFlavor() error
AddAccount(AccountCreateData) error
ModifyAccount(string, AccountCreateData) error
DeleteAccount(string) error
ChangePassword(string, string) error
SetSystemPowerState(*SystemData, string) error
ProcessError(HTTPResult) (*Error, error)
GetLicense(*ManagerData) (*ManagerLicenseData, error)
GetErrorMessage(*Error) string
IsInitialised() bool
Clone() *Redfish
GetManagers() ([]string, error)
GetManagerData(string) (*ManagerData, error)
MapManagersByID() (map[string]*ManagerData, error)
MapManagersByUUID() (map[string]*ManagerData, error)
// contains filtered or unexported methods
}
BaseRedfish - interface definition
type CSRData ¶
type CSRData struct {
C string // Country
S string // State or province
L string // Locality or city
O string // Organisation
OU string // Organisational unit
CN string // Common name
}
CSRData - data for CSR subject
type ChassisData ¶
type ChassisData struct {
ID *string `json:"Id"`
Name *string `json:"Name"`
ChassisType *string `json:"ChassisType"`
Manufacturer *string `json:"Manufacturer"`
Model *string `json:"Model"`
SerialNumber *string `json:"SerialNumber"`
PartNumber *string `json:"PartNumber"`
AssetTag *string `json:"AssetTag"`
IndicatorLED *string `json:"IndicatorLED"`
Status Status `json:"Status"`
Oem json.RawMessage `json:"Oem"`
Thermal *OData `json:"Thermal"`
Power *OData `json:"Power"`
SelfEndpoint *string
}
ChassisData - Chassis information
type Error ¶
type Error struct {
Error ErrorMessage `json:"error"`
}
Error - Redfish error as defined by the standard
type ErrorMessage ¶
type ErrorMessage struct {
Code *string `json:"code"`
Message *string `json:"Message"`
MessageExtendedInfo []ErrorMessageExtendedInfo `json:"@Message.ExtendedInfo"`
}
ErrorMessage - structure of each individual error messages
type ErrorMessageExtendedInfo ¶
type ErrorMessageExtendedInfo struct {
MessageID *string `json:"MessageId"`
Severity *string `json:"Severity"`
Resolution *string `json:"Resolution"`
Message *string `json:"Message"`
MessageArgs []string `json:"MessageArgs"`
RelatedProperties []string `json:"RelatedProperties"`
}
ErrorMessageExtendedInfo - each individual error entry
type FanData ¶
type FanData struct {
ODataID *string `json:"@odata.id"`
MemberID *string `json:"MemberId"`
SensorNumber *int `json:"SensorNumber"`
FanName *string `json:"FanName"`
Name *string `json:"Name"`
Reading *int `json:"Reading"`
LowerThresholdNonCritical *int `json:"LowerThresholdNonCritical"`
LowerThresholdCritical *int `json:"LowerThresholdCritical"`
LowerThresholdFatal *int `json:"LowerThresholdFatal"`
UpperThresholdNonCritical *int `json:"UpperThresholdNonCritical"`
UpperThresholdCritical *int `json:"UpperThresholdCritical"`
UpperThresholdFatal *int `json:"UpperThresholdFatal"`
MinReadingRange *int `json:"MinReadingRange"`
MaxReadingRange *int `json:"MaxReadingRange"`
Status Status `json:"Status"`
ReadingUnits *string `json:"ReadingUnits"`
PartNumber *string `json:"PartNumber"`
PhysicalContext *string `json:"PhysicalContext"`
Oem json.RawMessage `json:"Oem"`
}
FanData - fan readings
type HTTPResult ¶
type HTTPResult struct {
URL string
StatusCode int
Status string
Header http.Header
Content []byte
}
HTTPResult - result of the http_request calls
type HTTPSCertActionsOemHp ¶
type HTTPSCertActionsOemHp struct {
GenerateCSR LinkTargets `json:"#HpHttpsCert.GenerateCSR"`
ImportCertificate LinkTargets `json:"#HpHttpsCert.ImportCertificate"`
X509CertificateInformation X509CertInfo `json:"X509CertificateInformation"`
}
HTTPSCertActionsOemHp - same as HTTPSCertActionsOemHpe
type HTTPSCertActionsOemHpe ¶
type HTTPSCertActionsOemHpe struct {
GenerateCSR LinkTargets `json:"#HpeHttpsCert.GenerateCSR"`
ImportCertificate LinkTargets `json:"#HpeHttpsCert.ImportCertificate"`
X509CertificateInformation X509CertInfo `json:"X509CertificateInformation"`
}
HTTPSCertActionsOemHpe - OEM extension for certificate management
type HTTPSCertActionsOemHuawei ¶
type HTTPSCertActionsOemHuawei struct {
GenerateCSR LinkTargets `json:"#HttpsCert.GenerateCSR"`
ImportCertificate LinkTargets `json:"#HttpsCert.ImportServerCertificate"`
X509CertificateInformation X509CertInfo `json:"X509CertificateInformation"`
}
HTTPSCertActionsOemHuawei - Huawei: Oem data for Manager endpoint and SecurityService endpoint
type HTTPSCertDataOemHp ¶
type HTTPSCertDataOemHp struct {
CSR *string `json:"CertificateSigningRequest"`
ID *string `json:"Id"`
Actions HTTPSCertActionsOemHp `json:"Actions"`
}
HTTPSCertDataOemHp - same as HTTPSCertDataOemHpe
type HTTPSCertDataOemHpe ¶
type HTTPSCertDataOemHpe struct {
CSR *string `json:"CertificateSigningRequest"`
ID *string `json:"Id"`
Actions HTTPSCertActionsOemHpe `json:"Actions"`
}
HTTPSCertDataOemHpe - HPE OEM extension
type HTTPSCertDataOemHuawei ¶
type HTTPSCertDataOemHuawei struct {
CSR *string `json:"CertificateSigningRequest"`
ID *string `json:"Id"`
Actions HTTPSCertActionsOemHuawei `json:"Actions"`
}
HTTPSCertDataOemHuawei - OEM specific extension
type LinkTargets ¶
type LinkTargets struct {
Target *string `json:"target"`
ActionInfo *string `json:"@Redfish.ActionInfo"`
}
LinkTargets - available link targets
type ManagerActionsData ¶
type ManagerActionsData struct {
ManagerReset LinkTargets `json:"#Manager.Reset"`
}
ManagerActionsData - list of allowed actions of the management processor
type ManagerActionsDataOemSupermicro ¶
type ManagerActionsDataOemSupermicro struct {
Oem _managerActionsDataOemSupermicro `json:"Oem"`
}
ManagerActionsDataOemSupermicro - ManagerActionsDataOemSupermicro - Supermicro: Oem data for Manager.Actions endpoint
type ManagerData ¶
type ManagerData struct {
ID *string `json:"Id"`
Name *string `json:"Name"`
ManagerType *string `json:"ManagerType"`
UUID *string `json:"UUID"`
Status Status `json:"Status"`
FirmwareVersion *string `json:"FirmwareVersion"`
Oem json.RawMessage `json:"Oem"`
Actions json.RawMessage `json:"Actions"` // may contain vendor specific data and endpoints
SelfEndpoint *string
}
ManagerData - information about the management processor
type ManagerDataOemHp ¶
type ManagerDataOemHp struct {
Hp *_managerDataOemHp `json:"Hp"`
}
ManagerDataOemHp - same as ManagerDataOemHpe
type ManagerDataOemHpFederationConfig ¶
type ManagerDataOemHpFederationConfig struct {
IPv6MulticastScope *string `json:"IPv6MulticastScope"`
MulticastAnnouncementInterval *int64 `json:"MulticastAnnouncementInterval"`
MulticastDiscovery *string `json:"MulticastDiscovery"`
MulticastTimeToLive *int64 `json:"MulticastTimeToLive"`
ILOFederationManagement *string `json:"iLOFederationManagement"`
}
ManagerDataOemHpFederationConfig - same as ManagerDataOemHpeFederationConfig
type ManagerDataOemHpFirmware ¶
type ManagerDataOemHpFirmware struct {
Current ManagerDataOemHpFirmwareData `json:"Current"`
}
ManagerDataOemHpFirmware - same as ManagerDataOemHpeFirmware
type ManagerDataOemHpFirmwareData ¶
type ManagerDataOemHpFirmwareData struct {
Date *string `json:"Date"`
DebugBuild *bool `json:"DebugBuild"`
MajorVersion *uint64 `json:"MajorVersion"`
MinorVersion *uint64 `json:"MinorVersion"`
Time *string `json:"Time"`
Version *string `json:"Version"`
}
ManagerDataOemHpFirmwareData - same as ManagerDataOemHpeFirmwareData
type ManagerDataOemHpLicense ¶
type ManagerDataOemHpLicense struct {
Key *string `json:"LicenseKey"`
String *string `json:"LicenseString"`
Type *string `json:"LicenseType"`
Expire *string `json:"LicenseExpire"`
}
ManagerDataOemHpLicense - HP/HPE: Oem data for Manager endpoint and SecurityService endpoint
type ManagerDataOemHpLinks ¶
type ManagerDataOemHpLinks struct {
ActiveHealthSystem OData `json:"ActiveHealthSystem"`
DateTimeService OData `json:"DateTimeService"`
EmbeddedMediaService OData `json:"EmbeddedMediaService"`
FederationDispatch OData `json:"FederationDispatch"`
FederationGroups OData `json:"FederationGroups"`
FederationPeers OData `json:"FederationPeers"`
LicenseService OData `json:"LicenseService"`
SecurityService OData `json:"SecurityService"`
UpdateService OData `json:"UpdateService"`
VSPLogLocation OData `json:"VSPLogLocation"`
}
ManagerDataOemHpLinks - same as ManagerDataOemHpeLinks NOTE: The result for HP/HPE are different depending if the HTTP header OData-Version is set or not. If OData-Version is _NOT_ set data are returned in .Oem.Hp.links with endpoints in "href". If OData-Version is set data are returned in .Oem.Hp.Links (note different case!) and endpoints are defined as @odata.id. We always set "OData-Version: 4.0"
type ManagerDataOemHpe ¶
type ManagerDataOemHpe struct {
Hpe *_managerDataOemHpe `json:"Hpe"`
}
ManagerDataOemHpe - OEM data for HPE systems
type ManagerDataOemHpeFederationConfig ¶
type ManagerDataOemHpeFederationConfig struct {
IPv6MulticastScope *string `json:"IPv6MulticastScope"`
MulticastAnnouncementInterval *int64 `json:"MulticastAnnouncementInterval"`
MulticastDiscovery *string `json:"MulticastDiscovery"`
MulticastTimeToLive *int64 `json:"MulticastTimeToLive"`
ILOFederationManagement *string `json:"iLOFederationManagement"`
}
ManagerDataOemHpeFederationConfig - HP/HPE federatin information
type ManagerDataOemHpeFirmware ¶
type ManagerDataOemHpeFirmware struct {
Current ManagerDataOemHpeFirmwareData `json:"Current"`
}
ManagerDataOemHpeFirmware - current firmware of the management processor
type ManagerDataOemHpeFirmwareData ¶
type ManagerDataOemHpeFirmwareData struct {
Date *string `json:"Date"`
DebugBuild *bool `json:"DebugBuild"`
MajorVersion *uint64 `json:"MajorVersion"`
MinorVersion *uint64 `json:"MinorVersion"`
Time *string `json:"Time"`
Version *string `json:"Version"`
}
ManagerDataOemHpeFirmwareData - HP/HPE firmware data
type ManagerDataOemHpeLicense ¶
type ManagerDataOemHpeLicense struct {
Key *string `json:"LicenseKey"`
String *string `json:"LicenseString"`
Type *string `json:"LicenseType"`
Expire *string `json:"LicenseExpire"`
}
ManagerDataOemHpeLicense - HP/HPE: Oem data for Manager endpoint and SecurityService endpoint
type ManagerDataOemHpeLinks ¶
type ManagerDataOemHpeLinks struct {
ActiveHealthSystem OData `json:"ActiveHealthSystem"`
DateTimeService OData `json:"DateTimeService"`
EmbeddedMediaService OData `json:"EmbeddedMediaService"`
FederationDispatch OData `json:"FederationDispatch"`
FederationGroups OData `json:"FederationGroups"`
FederationPeers OData `json:"FederationPeers"`
LicenseService OData `json:"LicenseService"`
SecurityService OData `json:"SecurityService"`
UpdateService OData `json:"UpdateService"`
VSPLogLocation OData `json:"VSPLogLocation"`
}
ManagerDataOemHpeLinks - link targets for HPE vendor specific extensions NOTE: The result for HP/HPE are different depending if the HTTP header OData-Version is set or not. If OData-Version is _NOT_ set data are returned in .Oem.Hp.links with endpoints in "href". If OData-Version is set data are returned in .Oem.Hp.Links (note different case!) and endpoints are defined as @odata.id. We always set "OData-Version: 4.0"
type ManagerDataOemHuawei ¶
type ManagerDataOemHuawei struct {
Huawei _managerDataOemHuawei `json:"Huawei"`
}
ManagerDataOemHuawei - OEM specific extension
type ManagerDataOemHuaweiLoginRule ¶
type ManagerDataOemHuaweiLoginRule struct {
MemberID *string `json:"MemberId"`
RuleEnabled bool `json:"RuleEnabled"`
StartTime *string `json:"StartTime"`
EndTime *string `json:"EndTime"`
IP *string `json:"IP"`
Mac *string `json:"Mac"`
}
ManagerDataOemHuaweiLoginRule - Huawei specific login rules
type ManagerLicenseData ¶
ManagerLicenseData - license data for management board
type OData ¶
type OData struct {
ID *string `json:"@odata.id"`
Type *string `json:"@odata.type"`
Context *string `json:"@odata.context"`
Members []OData `json:"Members"`
MembersCount int `json:"[email protected]"`
}
OData - Open Data procol struct
type PSUData ¶
type PSUData struct {
ODataID *string `json:"@odata.id"`
MemberID *string `json:"MemberId"`
Name *string `json:"Name"`
Status Status `json:"Status"`
PowerSupplyType *string `json:"PowerSupplyType"`
LineInputVoltage *int `json:"LineInputVoltage"`
LineInputVoltageType *string `json:"LineInputVoltageType"`
LastPowerOutputWatts *int `json:"LastPowerOutputWatts"`
PowerCapacityWatts *int `json:"PowerCapacityWatts"`
Model *string `json:"Model"`
FirmwareVersion *string `json:"FirmwareVersion"`
SerialNumber *string `json:"SerialNumber"`
Manufacturer *string `json:"Manufacturer"`
PartNumber *string `json:"PartNumber"`
Oem json.RawMessage `json:"Oem"`
Redundancy []OData `json:"Redundancy"`
}
PSUData - power supply information
type PowerControlData ¶
type PowerControlData struct {
ID *string `json:"@odata.id"`
MemberID *string `json:"MemberId"`
Name *string `json:"Name"`
PowerConsumedWatts *int
PowerMetrics PowerMetricsData `json:"PowerMetrics"`
PowerLimit PowerLimitData `json:"PowerLimit"`
Status Status `json:"Status"`
Oem json.RawMessage `json:"Oem"`
}
PowerControlData - power control information
type PowerData ¶
type PowerData struct {
OdataID *string `json:"@odata.id"`
Context *string `json:"@odata.context"`
ID *string `json:"Id"`
PowerControl []PowerControlData `json:"PowerControl"`
Voltages []VoltageData `json:"Voltages"`
PowerSupplies []PSUData `json:"PowerSupplies"`
SelfEndpoint *string
}
PowerData - power data
type PowerLimitData ¶
type PowerLimitData struct {
LimitInWatts *int `json:"LimitInWatts"`
LimitException *string `json:"LimitException"`
}
PowerLimitData - defined power limits
type PowerMetricsData ¶
type PowerMetricsData struct {
MinConsumedWatts *int `json:"MinConsumedWatts"`
MaxConsumedWatts *int `json:"MaxConsumedWatts"`
AverageConsumedWatts *int `json:"AverageConsumedWatts"`
IntervalInMin *int `json:"IntervalInMin"`
}
PowerMetricsData - current power data/metrics
type Redfish ¶
type Redfish struct {
Hostname string
Port int
Username string
Password string
AuthToken *string
SessionLocation *string
Timeout time.Duration
InsecureSSL bool
Debug bool
Verbose bool
RawBaseContent string
// endpoints
AccountService string
Chassis string
Managers string
SessionService string
Sessions string
Systems string
// Vendor "flavor"
Flavor uint
FlavorString string
// contains filtered or unexported fields
}
Redfish - object to access Redfish API
func (*Redfish) AddAccount ¶
func (r *Redfish) AddAccount(acd AccountCreateData) error
AddAccount - Add account
func (*Redfish) AddLicense ¶
func (r *Redfish) AddLicense(mgr *ManagerData, l []byte) error
AddLicense - add license to management board
func (*Redfish) ChangePassword ¶
ChangePassword - change account password
func (*Redfish) DeleteAccount ¶
DeleteAccount - delete an account
func (*Redfish) GetAccountData ¶
func (r *Redfish) GetAccountData(accountEndpoint string) (*AccountData, error)
GetAccountData - get account data for a particular account
func (*Redfish) GetAccounts ¶
GetAccounts - get array of accounts and their endpoints
func (*Redfish) GetChassis ¶
GetChassis - get array of chassis and their endpoints
func (*Redfish) GetChassisData ¶
func (r *Redfish) GetChassisData(chassisEndpoint string) (*ChassisData, error)
GetChassisData - get chassis data for a particular chassis
func (*Redfish) GetErrorMessage ¶
GetErrorMessage - get error messages from error structure
func (*Redfish) GetLicense ¶
func (r *Redfish) GetLicense(mgr *ManagerData) (*ManagerLicenseData, error)
GetLicense - get licenses of management board
func (*Redfish) GetManagerData ¶
func (r *Redfish) GetManagerData(managerEndpoint string) (*ManagerData, error)
GetManagerData - get manager data for an particular account
func (*Redfish) GetManagers ¶
GetManagers - get array of managers and their endpoints
func (*Redfish) GetPowerData ¶
GetPowerData - get power data from endpoint
func (*Redfish) GetRoleData ¶
GetRoleData - get role data for a particular role
func (*Redfish) GetRoles ¶
GetRoles - get array of roles and their endpoints
func (*Redfish) GetSystemData ¶
func (r *Redfish) GetSystemData(systemEndpoint string) (*SystemData, error)
GetSystemData - get system data for a particular system
func (*Redfish) GetSystems ¶
GetSystems - get array of systems and their endpoints
func (*Redfish) GetThermalData ¶
func (r *Redfish) GetThermalData(thermalEndpoint string) (*ThermalData, error)
GetThermalData - get thermal data from endpoint
func (*Redfish) GetVendorFlavor ¶
GetVendorFlavor - get vendor specific "flavor"
func (*Redfish) ImportCertificate ¶
ImportCertificate - import certificate
func (*Redfish) IsInitialised ¶
IsInitialised - check if structure has been initialised
func (*Redfish) IsInitialized ¶
IsInitialized - check if structure has been initialised
func (*Redfish) Login ¶
Login - Login to SessionEndpoint and get authentication token for this session
func (*Redfish) Logout ¶
Logout - Logout from SessionEndpoint and delete authentication token for this session
func (*Redfish) MapAccountsByID ¶
func (r *Redfish) MapAccountsByID() (map[string]*AccountData, error)
MapAccountsByID - map ID -> user data
func (*Redfish) MapAccountsByName ¶
func (r *Redfish) MapAccountsByName() (map[string]*AccountData, error)
MapAccountsByName - map username -> user data
func (*Redfish) MapChassisByID ¶
func (r *Redfish) MapChassisByID() (map[string]*ChassisData, error)
MapChassisByID - Map chassis by ID
func (*Redfish) MapManagersByID ¶
func (r *Redfish) MapManagersByID() (map[string]*ManagerData, error)
MapManagersByID - map ID -> manager data
func (*Redfish) MapManagersByUUID ¶
func (r *Redfish) MapManagersByUUID() (map[string]*ManagerData, error)
MapManagersByUUID - map UUID -> manager data
func (*Redfish) MapRolesByID ¶
MapRolesByID - map roles by ID
func (*Redfish) MapRolesByName ¶
MapRolesByName - map roles by name
func (*Redfish) MapSystemsByID ¶
func (r *Redfish) MapSystemsByID() (map[string]*SystemData, error)
MapSystemsByID - map systems by ID
func (*Redfish) MapSystemsBySerialNumber ¶
func (r *Redfish) MapSystemsBySerialNumber() (map[string]*SystemData, error)
MapSystemsBySerialNumber - map systems by serial number
func (*Redfish) MapSystemsByUUID ¶
func (r *Redfish) MapSystemsByUUID() (map[string]*SystemData, error)
MapSystemsByUUID - map systems by UUID
func (*Redfish) ModifyAccount ¶
func (r *Redfish) ModifyAccount(u string, acd AccountCreateData) error
ModifyAccount - modify an account
func (*Redfish) ModifyAccountByEndpoint ¶
func (r *Redfish) ModifyAccountByEndpoint(endpoint string, acd AccountCreateData) error
ModifyAccountByEndpoint - modify account by it's endpoint
func (*Redfish) ProcessError ¶
func (r *Redfish) ProcessError(response HTTPResult) (*Error, error)
ProcessError - processess error response from API
func (*Redfish) SetSystemPowerState ¶
func (r *Redfish) SetSystemPowerState(sd *SystemData, state string) error
SetSystemPowerState - set power state of the server system
type RoleData ¶
type RoleData struct {
ID *string `json:"Id"`
Name *string `json:"Name"`
IsPredefined *bool `json:"IsPredefined"`
Description *string `json:"Description"`
AssignedPrivileges []string `json:"AssignedPrivileges"`
// OemPrivileges []string `json:"OemPrivileges"`
SelfEndpoint *string
}
RoleData - individual roles
type SecurityServiceDataOemHp ¶
type SecurityServiceDataOemHp struct {
ID *string `json:"Id"`
Type *string `json:"Type"`
Links SecurityServiceDataOemHpLinks `json:"Links"`
}
SecurityServiceDataOemHp - same as SecurityServiceDataOemHpe
type SecurityServiceDataOemHpLinks ¶
type SecurityServiceDataOemHpLinks struct {
ESKM OData `json:"ESKM"`
HTTPSCert OData `json:"HttpsCert"`
SSO OData `json:"SSO"`
}
SecurityServiceDataOemHpLinks - same as SecurityServiceDataOemHpeLinks
type SecurityServiceDataOemHpe ¶
type SecurityServiceDataOemHpe struct {
ID *string `json:"Id"`
Type *string `json:"Type"`
Links SecurityServiceDataOemHpeLinks `json:"Links"`
}
SecurityServiceDataOemHpe - HPE extension
type SecurityServiceDataOemHpeLinks ¶
type SecurityServiceDataOemHpeLinks struct {
ESKM OData `json:"ESKM"`
HTTPSCert OData `json:"HttpsCert"`
SSO OData `json:"SSO"`
}
SecurityServiceDataOemHpeLinks - HPE extension
type SecurityServiceDataOemHuawei ¶
type SecurityServiceDataOemHuawei struct {
ID *string `json:"Id"`
Name *string `json:"Name"`
Links SecurityServiceDataOemHuaweiLinks `json:"Links"`
}
SecurityServiceDataOemHuawei - OEM specific extension
type SecurityServiceDataOemHuaweiLinks ¶
type SecurityServiceDataOemHuaweiLinks struct {
HTTPSCert OData `json:"HttpsCert"`
}
SecurityServiceDataOemHuaweiLinks - OEM specific extension
type Status ¶
type Status struct {
State *string `json:"State"`
Health *string `json:"Health"`
HealthRollUp *string `json:"HealthRollUp"`
}
Status - Health status
type SystemActionInfo ¶
type SystemActionInfo struct {
ODataContext string `json:"@odata.context"`
ODataID string `json:"@odata.id"`
ODataType string `json:"@odata.type"`
Parameters []ActionInfoParameter `json:"Parameters"`
}
SystemActionInfo - information about allowed actions
type SystemActions ¶
type SystemActions struct {
ComputerReset *SystemActionsComputerReset `json:"#ComputerSystem.Reset"`
}
SystemActions - supported actions for computer reset
type SystemActionsComputerReset ¶
type SystemActionsComputerReset struct {
Target string `json:"target"`
ResetTypeValues []string `json:"[email protected]"`
ActionInfo string `json:"@Redfish.ActionInfo"`
}
SystemActionsComputerReset - allowed action for computer reset
type SystemData ¶
type SystemData struct {
UUID *string `json:"UUID"`
Status Status `json:"Status"`
SerialNumber *string `json:"SerialNumber"`
ProcessorSummary *SystemProcessorSummary `json:"ProcessorSummary"`
Processors *OData `json:"Processors"`
PowerState *string `json:"Powerstate"`
Name *string `json:"Name"`
Model *string `json:"Model"`
MemorySummary *SystemMemorySummary `json:"MemorySummary"`
Memory *OData `json:"Memory"`
Manufacturer *string `json:"Manufacturer"`
LogServices *OData `json:"LogServices"`
ID *string `json:"Id"`
EthernetInterfaces *OData `json:"EthernetInterfaces"`
BIOSVersion *string `json:"BiosVersion"`
BIOS *OData `json:"Bios"`
Actions *SystemActions `json:"Actions"`
Oem json.RawMessage `json:"Oem"`
SelfEndpoint *string
// contains filtered or unexported fields
}
SystemData - System information
type SystemMemorySummary ¶
type SystemMemorySummary struct {
TotalSystemMemoryGiB float64 `json:"TotalSystemMemoryGiB"`
Status Status `json:"Status"`
}
SystemMemorySummary - summary of system - memory
type SystemProcessorSummary ¶
type SystemProcessorSummary struct {
Count int `json:"Count"`
Status Status `json:"Status"`
Model *string `json:"Model"`
}
SystemProcessorSummary - summary of system - CPU
type TemperatureData ¶
type TemperatureData struct {
ODataID *string `json:"@odata.id"`
MemberID *string `json:"MemberId"`
SensorNumber *int `json:"SensorNumber"`
Name *string `json:"Name"`
ReadingCelsius *int `json:"ReadingCelsius"`
LowerThresholdNonCritical *int `json:"LowerThresholdNonCritical"`
LowerThresholdCritical *int `json:"LowerThresholdCritical"`
LowerThresholdFatal *int `json:"LowerThresholdFatal"`
UpperThresholdNonCritical *int `json:"UpperThresholdNonCritical"`
UpperThresholdCritical *int `json:"UpperThresholdCritical"`
UpperThresholdFatal *int `json:"UpperThresholdFatal"`
MinReadingRangeTemp *int `json:"MinReadingRangeTemp"`
MaxReadingRangeTemp *int `json:"MaxReadingRangeTemp"`
Status Status `json:"Status"`
}
TemperatureData - temperature readings
type ThermalData ¶
type ThermalData struct {
ODataID *string `json:"@odata.id"`
ID *string `json:"Id"`
Status Status `json:"Status"`
Temperatures []TemperatureData `json:"Temperatures"`
Fans []FanData `json:"Fans"`
SelfEndpoint *string
}
ThermalData - thermal data
type VoltageData ¶
type VoltageData struct {
ODataID *string `json:"@odata.id"`
MemberID *string `json:"MemberId"`
Name *string `json:"Name"`
SensorNumber *int `json:"SensorNumber"`
Status Status `json:"Status"`
ReadingVolts *float64 `json:"ReadingVolts"`
UpperThresholdNonCritical *float64 `json:"UpperThresholdNonCritical"`
UpperThresholdCritical *float64 `json:"UpperThresholdCritical"`
UpperThresholdFatal *float64 `json:"UpperThresholdFatal"`
LowerThresholdNonCritical *float64 `json:"LowerThresholdNonCritical"`
LowerThresholdCritical *float64 `json:"LowerThresholdCritical"`
LowerThresholdFatal *float64 `json:"LowerThresholdFatal"`
MinReadingRange *float64 `json:"MinReadingRange"`
MaxReadingRange *float64 `json:"MaxReadingRange"`
PhysicalContext *string `json:"PhysicalContext"`
}
VoltageData - voltage information
Source Files
¶
- accounts.go
- cert.go
- chassis.go
- clone.go
- csr.go
- data.go
- data_dell.go
- data_hp.go
- data_hpe.go
- data_huawei.go
- data_supermicro.go
- error.go
- http_request.go
- init.go
- is_initialised.go
- license.go
- login.go
- logout.go
- managers.go
- reset_sp.go
- roles.go
- systems.go