ilo

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BmcType defines the bmc model that is supported by this package
	BmcType = "ilo"

	// Ilo2 is the constant for iLO2
	Ilo2 = "ilo2"
	// Ilo3 is the constant for iLO3
	Ilo3 = "ilo3"
	// Ilo4 is the constant for iLO4
	Ilo4 = "ilo4"
	// Ilo5 is the constant for iLO5
	Ilo5 = "ilo5"
)

Variables

View Source
var Timezones = map[string]int{
	"CET":           368,
	"CST6CDT":       371,
	"EET":           373,
	"EST":           376,
	"EST5EDT":       377,
	"Etc/GMT":       378,
	"Etc/GMT+0":     379,
	"Etc/GMT+1":     380,
	"Etc/GMT+10":    381,
	"Etc/GMT+11":    382,
	"Etc/GMT+12":    383,
	"Etc/GMT+2":     384,
	"Etc/GMT+3":     385,
	"Etc/GMT+4":     386,
	"Etc/GMT+5":     387,
	"Etc/GMT+6":     388,
	"Etc/GMT+7":     389,
	"Etc/GMT+8":     390,
	"Etc/GMT+9":     391,
	"Etc/GMT-0":     392,
	"Etc/GMT-1":     393,
	"Etc/GMT-10":    394,
	"Etc/GMT-11":    395,
	"Etc/GMT-12":    396,
	"Etc/GMT-13":    397,
	"Etc/GMT-14":    398,
	"Etc/GMT-2":     399,
	"Etc/GMT-3":     400,
	"Etc/GMT-4":     401,
	"Etc/GMT-5":     402,
	"Etc/GMT-6":     403,
	"Etc/GMT-7":     404,
	"Etc/GMT-8":     405,
	"Etc/GMT-9":     406,
	"Etc/GMT0":      407,
	"Etc/Greenwich": 408,
	"Etc/UCT":       409,
	"Etc/Universal": 410,
	"Etc/UTC":       411,
	"GMT":           464,
	"GMT+0":         465,
	"GMT-0":         466,
	"GMT0":          467,
	"Greenwich":     468,
	"HST":           470,
	"MET":           488,
	"MST":           492,
	"MST7MDT":       493,
	"PST8PDT":       543,
	"UCT":           548,
	"Universal":     549,
	"UTC":           562,
	"WET":           564,
}

Important timezone ints taken from https://10.193.251.48/html/network_sntp.html?intf=0

Functions

This section is empty.

Types

type Directory

type Directory struct {
	ServerAddress         string   `json:"server_address"`
	ServerPort            int      `json:"server_port"`
	UserContexts          []string `json:"user_contexts"`
	AuthenticationEnabled int      `json:"authentication_enabled"`
	LocalUserAcct         int      `json:"local_user_acct"` //enable local user accounts
	EnableGroupAccount    int      `json:"enable_group_acct"`
	EnableKerberos        int      `json:"enable_kerberos"`
	KerberosKdcAddress    string   `json:"kerberos_kdc_address,omitempty"`
	KerberosRealm         string   `json:"kerberos_realm,omitempty"`
	EnableGenericLdap     int      `json:"enable_generic_ldap"`
	Method                string   `json:"method"`
	SessionKey            string   `json:"session_key"`
}

/json/directory {"server_address":"ldap.example.com","method":"mod_dir_config","session_key":"51b01f402d65eb2f42342f6d67832989","server_port":637,"user_contexts":["ou=People,dc=example,dc=con"],"authentication_enabled":1,"enable_group_acct":1,"enable_kerberos":0,"local_user_acct":1,"enable_generic_ldap":1}

type DirectoryGroupAccts

type DirectoryGroupAccts struct {
	Groups []DirectoryGroups `json:"group_accts"`
}

type DirectoryGroups

type DirectoryGroups struct {
	Dn               string `json:"dn"`
	NewDn            string `json:"new_dn,omitempty"` //same as Dn, unless being modified
	Sid              string `json:"sid,omitempty"`
	LoginPriv        int    `json:"login_priv,omitempty"`
	RemoteConsPriv   int    `json:"remote_cons_priv,omitempty"`
	VirtualMediaPriv int    `json:"virtual_media_priv,omitempty"`
	ResetPriv        int    `json:"reset_priv,omitempty"`
	ConfigPriv       int    `json:"config_priv,omitempty"`
	UserPriv         int    `json:"user_priv,omitempty"`
	Method           string `json:"method"` //add_group, mod_group, del_group
	SessionKey       string `json:"session_key"`
}

/json/directory_groups {"dn":"cn=hp,cn=bmcUsers","new_dn":"cn=hp,cn=bmcUsers","sid":"","login_priv":1,"remote_cons_priv":1,"virtual_media_priv":1,"reset_priv":1,"config_priv":0,"user_priv":0,"method":"mod_group","session_key":"bc2dae77e36a45fbeffce0bddd2ccabe"}

type Ilo

type Ilo struct {
	// contains filtered or unexported fields
}

Ilo holds the status and properties of a connection to an iLO device

func New

func New(ip string, username string, password string) (ilo *Ilo, err error)

New returns a new Ilo ready to be used

func (*Ilo) ApplyCfg

func (i *Ilo) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)

func (*Ilo) BiosVersion

func (i *Ilo) BiosVersion() (version string, err error)

BiosVersion returns the current version of the bios

func (*Ilo) BmcType

func (i *Ilo) BmcType() (bmcType string)

BmcType returns the type of bmc we are talking to

func (*Ilo) BmcVersion

func (i *Ilo) BmcVersion() (bmcVersion string, err error)

BmcVersion returns the version of the bmc we are running

func (*Ilo) CPU

func (i *Ilo) CPU() (cpu string, cpuCount int, coreCount int, hyperthreadCount int, err error)

CPU returns the cpu, cores and hyperthreads of the server

func (*Ilo) CheckCredentials added in v0.1.6

func (i *Ilo) CheckCredentials() (err error)

CheckCredentials verify whether the credentials are valid or not

func (*Ilo) Close added in v0.1.6

func (i *Ilo) Close() (err error)

Close closes the connection properly

func (*Ilo) Disks

func (i *Ilo) Disks() (disks []*devices.Disk, err error)

Disks returns a list of disks installed on the device

func (*Ilo) IsBlade

func (i *Ilo) IsBlade() (isBlade bool, err error)

IsBlade returns if the current hardware is a blade or not

func (*Ilo) IsOn added in v0.1.6

func (i *Ilo) IsOn() (status bool, err error)

IsOn tells if a machine is currently powered on

func (*Ilo) License

func (i *Ilo) License() (name string, licType string, err error)

License returns the iLO's license information

func (*Ilo) Memory

func (i *Ilo) Memory() (mem int, err error)

Memory returns the total amount of memory of the server

func (*Ilo) Model

func (i *Ilo) Model() (model string, err error)

Model returns the device model

func (*Ilo) Name

func (i *Ilo) Name() (name string, err error)

Name returns the name of this server from the iLO point of view

func (*Ilo) Nics

func (i *Ilo) Nics() (nics []*devices.Nic, err error)

Nics returns all found Nics in the device

func (*Ilo) PowerCycle added in v0.1.6

func (i *Ilo) PowerCycle() (status bool, err error)

PowerCycle reboots the machine via bmc

func (*Ilo) PowerCycleBmc added in v0.1.6

func (i *Ilo) PowerCycleBmc() (status bool, err error)

PowerCycleBmc reboots the bmc we are connected to

func (*Ilo) PowerKw

func (i *Ilo) PowerKw() (power float64, err error)

PowerKw returns the current power usage in Kw

func (*Ilo) PowerOff added in v0.1.6

func (i *Ilo) PowerOff() (status bool, err error)

PowerOff power off the machine via bmc

func (*Ilo) PowerOn added in v0.1.6

func (i *Ilo) PowerOn() (status bool, err error)

PowerOn power on the machine via bmc

func (*Ilo) PowerState

func (i *Ilo) PowerState() (state string, err error)

PowerState returns the current power state of the machine

func (*Ilo) Psus

func (i *Ilo) Psus() (psus []*devices.Psu, err error)

Psus returns a list of psus installed on the device

func (*Ilo) PxeOnce added in v0.1.6

func (i *Ilo) PxeOnce() (status bool, err error)

PxeOnce makes the machine to boot via pxe once

func (*Ilo) Screenshot added in v0.2.2

func (i *Ilo) Screenshot() (response []byte, extension string, err error)

Screenshot returns a thumbnail of video display from the bmc.

func (*Ilo) Serial

func (i *Ilo) Serial() (serial string, err error)

Serial returns the device serial

func (*Ilo) ServerSnapshot

func (i *Ilo) ServerSnapshot() (server interface{}, err error)

ServerSnapshot do best effort to populate the server data and returns a blade or discrete

func (*Ilo) Status

func (i *Ilo) Status() (health string, err error)

Status returns health string status from the bmc

func (*Ilo) TempC

func (i *Ilo) TempC() (temp int, err error)

TempC returns the current temperature of the machine

func (*Ilo) UpdateCredentials

func (i *Ilo) UpdateCredentials(username string, password string)

UpdateCredentials updates login credentials

func (*Ilo) Vendor

func (i *Ilo) Vendor() (vendor string)

Vendor returns bmc's vendor

type LicenseInfo added in v0.2.2

type LicenseInfo struct {
	Key        string `json:"key,omitempty"`
	Method     string `json:"method,omitempty"`
	SessionKey string `json:"session_key,omitempty"`
}

POST https://10.183.244.173/json/license_info

type NetworkSntp

type NetworkSntp struct {
	Interface                   int    `json:"interface"`
	PendingChange               int    `json:"pending_change"`
	NicWcount                   int    `json:"nic_wcount"`
	TzWcount                    int    `json:"tz_wcount"`
	Ipv4Disabled                int    `json:"ipv4_disabled"`
	Ipv6Disabled                int    `json:"ipv6_disabled"`
	DhcpEnabled                 int    `json:"dhcp_enabled"`
	Dhcp6Enabled                int    `json:"dhcp6_enabled"`
	UseDhcpSuppliedTimeServers  int    `json:"use_dhcp_supplied_time_servers"`
	UseDhcp6SuppliedTimeServers int    `json:"use_dhcp6_supplied_time_servers"`
	Sdn1WCount                  int    `json:"sdn1_wcount"`
	Sdn2WCount                  int    `json:"sdn2_wcount"`
	SntpServer1                 string `json:"sntp_server1"`
	SntpServer2                 string `json:"sntp_server2"`
	TimePropagate               int    `json:"time_propagate"` //propagate time from OA to blade
	OurZone                     int    `json:"our_zone"`       //368 - see Timezones
	Method                      string `json:"method"`         //set_sntp
	SessionKey                  string `json:"session_key,omitempty"`
}

/json/network_sntp

type RemoteSyslog

type RemoteSyslog struct {
	SyslogEnable int    `json:"syslog_enable"`
	SyslogPort   int    `json:"syslog_port"`
	Method       string `json:"method"` //syslog_save,
	SyslogServer string `json:"syslog_server"`
	SessionKey   string `json:"session_key,omitempty"`
}

Set syslog params POST https://10.193.251.48/json/remote_syslog

type UserInfo

type UserInfo struct {
	Id               int    `json:"id,int,omitempty"`
	LoginName        string `json:"login_name,omitempty"`
	UserName         string `json:"user_name,omitempty"`
	Password         string `json:"password,omitempty"`
	RemoteConsPriv   int    `json:"remote_cons_priv,omitempty"`
	VirtualMediaPriv int    `json:"virtual_media_priv,omitempty"`
	ResetPriv        int    `json:"reset_priv,omitempty"`
	ConfigPriv       int    `json:"config_priv,omitempty"`
	UserPriv         int    `json:"user_priv,omitempty"`
	LoginPriv        int    `json:"login_priv,omitempty"`
	Method           string `json:"method"` //mod_user, add_user, del_user
	UserId           int    `json:"user_id,int,omitempty"`
	SessionKey       string `json:"session_key,omitempty"`
}

Add/Modify/Delete a user account POST https://10.193.251.48/json/user_info

type Users

type Users struct {
	UsersInfo []UserInfo `json:"users"`
}

Jump to

Keyboard shortcuts

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