m1000e

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BMCType defines the bmc model that is supported by this package
	BMCType = "m1000e"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DatetimeParams

type DatetimeParams struct {
	SessionToken          string `url:"ST2"`                      //ST2=ba9a6bbf88764c829ca4f49146fd4817
	NtpEnable             bool   `url:"NTP_enable,int"`           //NTP_enable=1
	NtpServer1            string `url:"NTP_server1"`              //NTP_server1=ntp0.example.com
	NtpServer2            string `url:"NTP_server2"`              //NTP_server2=ntp2.example.com
	NtpServer3            string `url:"NTP_server3"`              //NTP_server3=ntp3.example.com
	DateTimeChanged       bool   `url:"datetimeChanged,int"`      //datetimeChanged=0
	CmcTimeTimezoneString string `url:"CMC_TIME_timezone_string"` //CMC_TIME_timezone_string=CET
	TzChanged             bool   `url:"tzChanged,int"`            //tzChanged=1
}

cgi-bin/webcgi/datetime

type DirectoryServicesParams

type DirectoryServicesParams struct {
	SessionToken                 string `url:"ST2"`
	SeviceSelected               string `url:"service_selected"`                     //service_selected=ldap
	CertType                     int    `url:"certType"`                             //certType=5
	Action                       int    `url:"action"`                               //action=1
	Choose                       int    `url:"choose"`                               //choose=2
	GenLdapEnableCk              bool   `url:"GENLDAP_enable_ck,int"`                //GENLDAP_enable_ck=1
	GenLdapEnable                bool   `url:"GENLDAP_enable,int"`                   //GENLDAP_enable=1
	GenLdapGroupAttributeIsDnCk  bool   `url:"GENLDAP_group_attribute_is_dn_ck,int"` //GENLDAP_group_attribute_is_dn_ck=1
	GenLdapGroupAttributeIsDn    bool   `url:"GENLDAP_group_attribute_is_dn,int"`    //GENLDAP_group_attribute_is_dn=1
	GenLdapCertValidateEnableCk  bool   `url:"GENLDAP_cert_validate_enable_ck,int"`  //GENLDAP_cert_validate_enable_ck=1
	GenLdapCertValidateEnable    bool   `url:"GENLDAP_cert_validate_enable,int"`     //GENLDAP_cert_validate_enable=1
	GenLdapBindDn                string `url:"GENLDAP_bind_dn"`                      //GENLDAP_bind_dn=
	GenLdapBindPasswd            string `url:"GENLDAP_bind_passwd"`                  //GENLDAP_bind_passwd=PASSWORD
	GenLdapBindPasswdChanged     bool   `url:"GENLDAP_bind_passwd_changed,int"`      //GENLDAP_bind_passwd_changed=0
	GenLdapBaseDn                string `url:"GENLDAP_base_dn"`                      //GENLDAP_base_dn=ou=People,dc=foo,dc=com
	GenLdapUserAttribute         string `url:"GENLDAP_user_attribute"`               //GENLDAP_user_attribute=uid
	GenLdapGroupAttribute        string `url:"GENLDAP_group_attribute"`              //GENLDAP_group_attribute=memberUid
	GenLdapSearchFilter          string `url:"GENLDAP_search_filter"`                //GENLDAP_search_filter=
	GenLdapConnectTimeoutSeconds int    `url:"GENLDAP_connect_timeout_seconds"`      //GENLDAP_connect_timeout_seconds=30
	GenLdapSearchTimeoutSeconds  int    `url:"GENLDAP_search_timeout_seconds"`       //GENLDAP_search_timeout_seconds=120
	LdapServers                  int    `url:"ldapservers"`                          //ldapservers=1
	GenLdapServerAddr            string `url:"GENLDAP_server_addr"`                  //GENLDAP_server_addr=ldaps.prod.foo.com
	GenLdapServerPort            int    `url:"GENLDAP_server_port"`                  //GENLDAP_server_port=636
	GenLdapSrvLookupEnable       bool   `url:"GENLDAP_srvlookup_enable,int"`         //GENLDAP_srvlookup_enable=0
	AdEnable                     bool   `url:"AD_enable,int"`                        //AD_enable=0
	AdTfaSsoEnableBitmask1       int    `url:"AD_tfa_sso_enable_bitmask.1"`          //AD_tfa_sso_enable_bitmask.1=0
	AdTfaSsoEnableBitmask2       int    `url:"AD_tfa_sso_enable_bitmask.2"`          //AD_tfa_sso_enable_bitmask.2=0
	AdCertValidateEnableCk       bool   `url:"AD_cert_validate_enable_ck,int"`       //AD_cert_validate_enable_ck=1
	AdCertValidateEnable         bool   `url:"AD_cert_validate_enable,int"`          //AD_cert_validate_enable=1
	AdRootDomain                 string `url:"AD_root_domain"`                       //AD_root_domain=
	AdTimeout                    int    `url:"AD_timeout"`                           //AD_timeout=120
	AdFilterEnable               bool   `url:"AD_filter_enable,int"`                 //AD_filter_enable=0
	AdDcFilter                   string `url:"AD_dc_filter"`                         //AD_dc_filter=
	AdGcFilter                   string `url:"AD_gc_filter"`                         //AD_gc_filter=
	AdSchemaExt                  int    `url:"AD_schema_ext"`                        //AD_schema_ext=1
	RoleGroupFlag                int    `url:"RoleGroupFlag"`                        //RoleGroupFlag=0
	RoleGroupIndex               string `url:"RoleGroupIndex"`                       //RoleGroupIndex=
	AdCmcName                    string `url:"AD_cmc_name"`                          //AD_cmc_name=
	AdCmcdomain                  string `url:"AD_cmc_domain"`                        //AD_cmc_domain=
}

type InterfaceParams

type InterfaceParams struct {
	SessionToken                     string `url:"ST2"`                                      //ST2=2754be61766abf5808085b3f2dd7bd94
	SerialEnable                     bool   `url:"SERIAL_enable,int"`                        //SERIAL_enable=1
	SerialRedirect                   bool   `url:"SERIAL_redirect_enable,int"`               //SERIAL_redirect_enable=1
	SerialTimeout                    int    `url:"SERIAL_timeout"`                           //SERIAL_timeout=1800
	SerialBaudrate                   int    `url:"SERIAL_baudrate"`                          //SERIAL_baudrate=115200
	SerialConsoleNoAuth              bool   `url:"SERIAL_console_no_auth,int"`               //SERIAL_console_no_auth=0
	SerialQuitKey                    string `url:"SERIAL_quit_key"`                          //SERIAL_quit_key=^\
	SerialHistoryBufSize             int    `url:"SERIAL_history_buf_size"`                  //SERIAL_history_buf_size=8192
	SerialLoginCommand               string `url:"SERIAL_login_command"`                     //SERIAL_login_command=
	WebserverEnable                  bool   `url:"WEBSERVER_enable,int"`                     //WEBSERVER_enable=1
	WebserverMaxSessions             int    `url:"WEBSERVER_maxsessions"`                    //WEBSERVER_maxsessions=4
	WebserverTimeout                 int    `url:"WEBSERVER_timeout"`                        //WEBSERVER_timeout=1800
	WebserverHttpPort                int    `url:"WEBSERVER_http_port"`                      //WEBSERVER_http_port=80
	WebserverHttpsPort               int    `url:"WEBSERVER_https_port"`                     //WEBSERVER_https_port=443
	SshEnable                        bool   `url:"SSH_enable,int"`                           //SSH_enable=1
	SshMaxSessions                   int    `url:"SSH_maxsessions"`                          //SSH_maxsessions=4
	SshTimeout                       int    `url:"SSH_timeout`                               //SSH_timeout=1800
	SshPort                          int    `url:"SSH_port"`                                 //SSH_port=22
	TelnetEnable                     bool   `url:"TELNET_enable,int"`                        //TELNET_enable=1
	TelnetMaxSessions                int    `url:"TELNET_maxsessions"`                       //TELNET_maxsessions=4
	TelnetTimeout                    int    `url:"TELNET_timeout"`                           //TELNET_timeout=1800
	TelnetPort                       int    `url:"TELNET_port"`                              //TELNET_port=23
	RacadmEnable                     bool   `url:"RACADM_enable,int"`                        //RACADM_enable=1
	RacadmMaxSessions                int    `url:"RACADM_maxsessions"`                       //RACADM_maxsessions=4
	RacadmTimeout                    int    `url:"RACADM_timeout"`                           //RACADM_timeout=60
	SnmpEnable                       bool   `url:"SNMP_enable,int"`                          //SNMP_enable=1
	SnmpCommunityNameGet             string `url:"SNMP_COMMUNITYNAME_get"`                   //SNMP_COMMUNITYNAME_get=public
	SnmpProtocol                     int    `url:"SNMP_Protocol"`                            //SNMP_Protocol=0
	SnmpDiscoveryPortSet             int    `url:"SNMP_DiscoveryPort_set"`                   //SNMP_DiscoveryPort_set=161
	ChassisLoggingRemoteSyslogEnable bool   `url:"CHASSIS_LOGGING_remote_syslog_enable,int"` //CHASSIS_LOGGING_remote_syslog_enable=1
	ChassisLoggingRemoteSyslogHost1  string `url:"CHASSIS_LOGGING_remote_syslog_host_1"`     //CHASSIS_LOGGING_remote_syslog_host_1=machine.example.com
	ChassisLoggingRemoteSyslogHost2  string `url:"CHASSIS_LOGGING_remote_syslog_host_2"`     //CHASSIS_LOGGING_remote_syslog_host_2=
	ChassisLoggingRemoteSyslogHost3  string `url:"CHASSIS_LOGGING_remote_syslog_host_3"`     //CHASSIS_LOGGING_remote_syslog_host_3=
	ChassisLoggingRemoteSyslogPort   int    `url:"CHASSIS_LOGGING_remote_syslog_port"`       //CHASSIS_LOGGING_remote_syslog_port=514

}

/cgi-bin/webcgi/interfaces

type LdapArgParams

type LdapArgParams struct {
	SessionToken         string `url:"ST2"`                    //ST2=2ee3449549f4f61b292e31c251da2b36
	PrivBitmap           int    `url:"PrivBitmap"`             //PrivBitmap=4095
	Index                int    `url:"index"`                  //index=1
	GenLdapRoleDn        string `url:"GENLDAP_ROLE_dn"`        //GENLDAP_ROLE_dn=cn=bmcAdmins,ou=Group,dc=activehotels,dc=com
	GenLdapRolePrivilege int    `url:"GENLDAP_ROLE_privilege"` //GENLDAP_ROLE_privilege=4095
	Login                bool   `url:"login,int"`              //login=1
	Cfg                  bool   `url:"cfg,int"`                //cfg=1
	Cfguser              bool   `url:"cfguser,int"`            //cfguser=1
	Clearlog             bool   `url:"clearlog,int"`           //clearlog=1
	Chassiscontrol       bool   `url:"chassiscontrol,int"`     //chassiscontrol=1
	Superuser            bool   `url:"superuser,int"`          //superuser=1
	Serveradmin          bool   `url:"serveradmin,int"`        //serveradmin=1
	Testalert            bool   `url:"testalert,int"`          //testalert=1
	Debug                bool   `url:"debug,int"`              //debug=1
	Afabricadmin         bool   `url:"afabricadmin,int"`       //afabricadmin=1
	Bfabricadmin         bool   `url:"bfabricadmin,int"`       //bfabricadmin=1
}

Setup LDAP role group - administrator

  1. the url parameter ?index=<int> and Index form value must match,
  2. the PrivBitmap, GenLdapRolePrivilege params must match, 4095 = Administrator - full access 3801 = Power user - no access to chassis, user config, debug commands 1 = Guest user - login access only

/cgi-bin/webcgi/ldaprg?index=1

type LoginSecurityParams

type LoginSecurityParams struct {
	SessionToken               string `url:"ST2"`                          //7bdaaa73307ebb471d0e71a9cecc44fb most likely the auth token
	EnforcedIpBlockEnable      bool   `url:"ENFORCED_IPBLOCK_enable,int"`  //1
	EnforcedIpBlockFailcount   int    `url:"ENFORCED_IPBLOCK_failcount"`   //5
	EnforcedIpBlockFailwindow  int    `url:"ENFORCED_IPBLOCK_failwindow"`  //60
	EnforcedIpBlockPenaltyTime int    `url:"ENFORCED_IPBLOCK_penaltytime"` //300
}

/cgi-bin/webcgi/loginSecurity

type M1000e

type M1000e struct {
	SessionToken string //required to set config
	// contains filtered or unexported fields
}

M1000e holds the status and properties of a connection to a CMC device

func New

func New(ip string, username string, password string) (chassis *M1000e, err error)

New returns a connection to M1000e

func (*M1000e) ApplyCfg

func (m *M1000e) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)

func (*M1000e) ApplySecurityCfg

func (m *M1000e) ApplySecurityCfg(cfg LoginSecurityParams) (err error)

Configures various interface params - syslog, snmp etc.

func (*M1000e) Blades

func (m *M1000e) Blades() (blades []*devices.Blade, err error)

Blades returns all StorageBlades found in this chassis

func (*M1000e) BmcType

func (m *M1000e) BmcType() (model string)

BmcType returns just Model id string - m1000e

func (*M1000e) ChassisSnapshot

func (m *M1000e) ChassisSnapshot() (chassis *devices.Chassis, err error)

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

func (*M1000e) CheckCredentials added in v0.1.5

func (m *M1000e) CheckCredentials() (err error)

CheckCredentials verify whether the credentials are valid or not

func (*M1000e) Close

func (m *M1000e) Close() (err error)

Close closes the connection properly

func (*M1000e) FindBladePosition

func (m *M1000e) FindBladePosition(serial string) (position int, err error)

FindBladePosition receives a serial and find the position of the blade using it

func (*M1000e) FwVersion

func (m *M1000e) FwVersion() (version string, err error)

FwVersion returns the current firmware version of the bmc

func (*M1000e) GetFirmwareVersion added in v0.1.6

func (m *M1000e) GetFirmwareVersion() (version string, err error)

FirmwareVersion returns the chassis firmware version

func (*M1000e) IsActive

func (m *M1000e) IsActive() bool

IsActive returns health string status from the bmc

func (*M1000e) IsOn

func (m *M1000e) IsOn() (status bool, err error)

IsOn tells if a machine is currently powered on

func (*M1000e) IsOnBlade

func (m *M1000e) IsOnBlade(position int) (status bool, err error)

IsOnBlade tells if a machine is currently powered on

func (*M1000e) Model

func (m *M1000e) Model() (model string, err error)

Model returns the full device model string

func (*M1000e) Name

func (m *M1000e) Name() (name string, err error)

Name returns the hostname of the machine

func (*M1000e) NewSslMultipartUpload

func (m *M1000e) NewSslMultipartUpload(endpoint string, params map[string]string, SslCert string, SslKey string) (err error)

setup a multipart form with the expected order of form parameters for the payload format see https://github.com/bmc-toolbox/bmclib/issues/3

func (*M1000e) Nics

func (m *M1000e) Nics() (nics []*devices.Nic, err error)

Nics returns all found Nics in the device

func (*M1000e) PassThru

func (m *M1000e) PassThru() (passthru string, err error)

PassThru returns the type of switch we have for this chassis

func (*M1000e) PowerCycle

func (m *M1000e) PowerCycle() (status bool, err error)

PowerCycle reboots the chassis

func (*M1000e) PowerCycleBlade

func (m *M1000e) PowerCycleBlade(position int) (status bool, err error)

PowerCycleBlade reboots the machine via bmc

func (*M1000e) PowerCycleBmcBlade

func (m *M1000e) PowerCycleBmcBlade(position int) (status bool, err error)

PowerCycleBmcBlade reboots the bmc we are connected to

func (*M1000e) PowerKw

func (m *M1000e) PowerKw() (power float64, err error)

PowerKw returns the current power usage in Kw

func (*M1000e) PowerOff

func (m *M1000e) PowerOff() (status bool, err error)

PowerOff power off the chassis

func (*M1000e) PowerOffBlade

func (m *M1000e) PowerOffBlade(position int) (status bool, err error)

PowerOffBlade power off the machine via bmc

func (*M1000e) PowerOn

func (m *M1000e) PowerOn() (status bool, err error)

PowerOn power on the chassis

func (*M1000e) PowerOnBlade

func (m *M1000e) PowerOnBlade(position int) (status bool, err error)

PowerOnBlade power on the machine via bmc

func (*M1000e) Psus

func (m *M1000e) Psus() (psus []*devices.Psu, err error)

Psus returns a list of psus installed on the device

func (*M1000e) PxeOnceBlade

func (m *M1000e) PxeOnceBlade(position int) (status bool, err error)

PxeOnceBlade makes the machine to boot via pxe once

func (*M1000e) ReseatBlade

func (m *M1000e) ReseatBlade(position int) (status bool, err error)

ReseatBlade reboots the machine via bmc

func (*M1000e) Serial

func (m *M1000e) Serial() (serial string, err error)

Serial returns the device serial

func (*M1000e) SetDynamicPower

func (m *M1000e) SetDynamicPower(enable bool) (status bool, err error)

Enable/Disable Dynamic Power - Dynamic Power Supply Engagement (DPSE) in Dell jargon. Dynamic Power Supply Engagement (DPSE) mode is disabled by default. DPSE saves power by optimizing the power efficiency of the PSUs supplying power to the chassis. This also increases the PSU life, and reduces heat generation.

func (*M1000e) SetFlexAddressState

func (m *M1000e) SetFlexAddressState(position int, enable bool) (status bool, err error)

SetFlexAddressState Disable/Enable FlexAddress disables flex Addresses for blades FlexAddress is a virtual addressing scheme

func (*M1000e) SetIpmiOverLan

func (m *M1000e) SetIpmiOverLan(position int, enable bool) (status bool, err error)

Enable/Disable IPMI over lan parameter per blade in chassis

func (*M1000e) Status

func (m *M1000e) Status() (status string, err error)

Status returns health string status from the bmc

func (*M1000e) StorageBlades

func (m *M1000e) StorageBlades() (storageBlades []*devices.StorageBlade, err error)

StorageBlades returns all StorageBlades found in this chassis

func (*M1000e) TempC

func (m *M1000e) TempC() (temp int, err error)

TempC returns the current temperature of the machine

func (*M1000e) UpdateCredentials

func (m *M1000e) UpdateCredentials(username string, password string)

UpdateCredentials updates login credentials

func (*M1000e) UpdateFirmware added in v0.1.6

func (m *M1000e) UpdateFirmware(host, filepath string) (status bool, err error)

UpdateFirmware updates the chassis firmware

func (*M1000e) UpdateFirmwareBmcBlade added in v0.1.6

func (m *M1000e) UpdateFirmwareBmcBlade(position int, host, filepath string) (status bool, err error)

UpdateFirmwareBmcBlade updates the blade BMC firmware

func (*M1000e) Vendor

func (m *M1000e) Vendor() (vendor string)

Vendor returns bmc's vendor

type UserParams

type UserParams struct {
	SessionToken    string `url:"ST2"`                //ST2=ba9a6bbf88764c829ca4f49146fd4817
	Privilege       int    `url:"Privilege"`          //Privilege=4095
	UserId          int    `url:"UserID"`             //UserID=1
	EnableUser      bool   `url:"EnableUser,int"`     //EnableUser=1
	UserName        string `url:"UserName"`           //UserName=Test
	ChangePassword  bool   `url:"ChangePassword,int"` //ChangePassword=1
	Password        string `url:"Password"`           //Password=foobar
	ConfirmPassword string `url:"ConfirmPassword"`    //ConfirmPassword=foobar
	CmcGroup        int    `url:"CMC_GROUP"`          //CMC_GROUP=4095
	Login           bool   `url:"login,int"`          //login=1
	Cfg             bool   `url:"cfg,int"`            //cfg=1
	CfgUser         bool   `url:"cfguser,int"`        //cfguser=1
	ClearLog        bool   `url:"clearlog,int"`       //clearlog=1
	ChassisControl  bool   `url:"chassiscontrol,int"` //chassiscontrol=1
	SuperUser       bool   `url:"superuser,int"`      //superuser=1
	ServerAdmin     bool   `url:"serveradmin,int"`    //serveradmin=1
	TestAlert       bool   `url:"testalert,int"`      //testalert=1
	Debug           bool   `url:"debug,int"`          //debug=1
	AFabricAdmin    bool   `url:"afabricadmin,int"`   //afabricadmin=1
	BFabricAdmin    bool   `url:"bfabricadmin,int"`   //bfabricadmin=1
	CFabricAcminc   bool   `url:"cfabricadmin,int"`   //cfabricadmin=1
}

Manages user login account parameters, notes:

  1. the url parameter ?id=<int> and UserID form value must match,
  2. the CMC_GROUP, Privilege params must match, 4095 = Administrator - full access 3801 = Power user - no access to chassis, user config, debug commands 1 = Guest user - login access only

Endpoint /webcgi/user?id=1

Jump to

Keyboard shortcuts

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