Documentation ¶
Index ¶
- Constants
- Variables
- type ASRockOption
- type ASRockRack
- func (a *ASRockRack) BmcReset(ctx context.Context, resetType string) (ok bool, err error)
- func (a *ASRockRack) CheckCredentials(ctx context.Context) (err error)
- func (a *ASRockRack) Close(ctx context.Context) (err error)
- func (a *ASRockRack) FirmwareInstallSteps(ctx context.Context, component string) ([]constants.FirmwareInstallStep, error)
- func (a *ASRockRack) FirmwareInstallUploaded(ctx context.Context, component, uploadTaskID string) (installTaskID string, err error)
- func (a *ASRockRack) FirmwareTaskStatus(ctx context.Context, kind constants.FirmwareInstallStep, ...) (state constants.TaskState, status string, err error)
- func (a *ASRockRack) FirmwareUpload(ctx context.Context, component string, file *os.File) (taskID string, err error)
- func (a *ASRockRack) Inventory(ctx context.Context) (device *common.Device, err error)
- func (a *ASRockRack) Name() string
- func (a *ASRockRack) Open(ctx context.Context) (err error)
- func (a *ASRockRack) PostCode(ctx context.Context) (status string, code int, err error)
- func (a *ASRockRack) PowerSet(ctx context.Context, state string) (ok bool, err error)
- func (a *ASRockRack) PowerStateGet(ctx context.Context) (state string, err error)
- func (a *ASRockRack) UserCreate(ctx context.Context, user, pass, role string) (ok bool, err error)
- func (a *ASRockRack) UserRead(ctx context.Context) (users []map[string]string, err error)
- func (a *ASRockRack) UserUpdate(ctx context.Context, user, pass, role string) (ok bool, err error)
- type Config
- type UserAccount
Constants ¶
const ( // ProviderName for the provider implementation ProviderName = "asrockrack" // ProviderProtocol for the provider implementation ProviderProtocol = "vendorapi" E3C256D4ID_NL = "E3C256D4ID-NL" E3C246D4ID_NL = "E3C246D4ID-NL" E3C246D4I_NL = "E3C246D4I-NL" )
Variables ¶
var ( // Features implemented by asrockrack https Features = registrar.Features{ providers.FeaturePostCodeRead, providers.FeatureBmcReset, providers.FeatureUserCreate, providers.FeatureUserUpdate, providers.FeatureFirmwareUpload, providers.FeatureFirmwareInstallUploaded, providers.FeatureFirmwareTaskStatus, providers.FeatureFirmwareInstallSteps, providers.FeatureInventoryRead, providers.FeaturePowerSet, providers.FeaturePowerState, } )
Functions ¶
This section is empty.
Types ¶
type ASRockOption ¶
type ASRockOption func(*ASRockRack)
ASRockOption is a type that can configure an *ASRockRack
func WithHTTPClient ¶
func WithHTTPClient(c *http.Client) ASRockOption
WithHTTPClient sets an HTTP client on the ASRockRack
func WithSecureTLS ¶
func WithSecureTLS(rootCAs *x509.CertPool) ASRockOption
WithSecureTLS enforces trusted TLS connections, with an optional CA certificate pool. Using this option with an nil pool uses the system CAs.
type ASRockRack ¶
type ASRockRack struct {
// contains filtered or unexported fields
}
ASRockRack holds the status and properties of a connection to a asrockrack bmc
func NewWithOptions ¶
func NewWithOptions(ip string, username string, password string, log logr.Logger, opts ...ASRockOption) *ASRockRack
NewWithOptions returns a new ASRockRack instance with options ready to be used
func (*ASRockRack) CheckCredentials ¶
func (a *ASRockRack) CheckCredentials(ctx context.Context) (err error)
CheckCredentials verify whether the credentials are valid or not
func (*ASRockRack) Close ¶
func (a *ASRockRack) Close(ctx context.Context) (err error)
Close a connection to a BMC, implements the Closer interface
func (*ASRockRack) FirmwareInstallSteps ¶ added in v2.2.0
func (a *ASRockRack) FirmwareInstallSteps(ctx context.Context, component string) ([]constants.FirmwareInstallStep, error)
bmc client interface implementations methods
func (*ASRockRack) FirmwareInstallUploaded ¶ added in v2.2.0
func (*ASRockRack) FirmwareTaskStatus ¶ added in v2.2.0
func (a *ASRockRack) FirmwareTaskStatus(ctx context.Context, kind constants.FirmwareInstallStep, component, taskID, installVersion string) (state constants.TaskState, status string, err error)
FirmwareTaskStatus returns the status of a firmware related task queued on the BMC.
func (*ASRockRack) FirmwareUpload ¶ added in v2.2.0
func (*ASRockRack) Name ¶
func (a *ASRockRack) Name() string
func (*ASRockRack) Open ¶
func (a *ASRockRack) Open(ctx context.Context) (err error)
Open a connection to a BMC, implements the Opener interface
func (*ASRockRack) PowerStateGet ¶
func (a *ASRockRack) PowerStateGet(ctx context.Context) (state string, err error)
PowerStateGet gets the power state of a machine
func (*ASRockRack) UserCreate ¶
UserCreate adds a new user account
func (*ASRockRack) UserUpdate ¶
UserUpdate updates a user password and role
type UserAccount ¶
type UserAccount struct { ID int `json:"id"` Name string `json:"name"` Access int `json:"access"` AccessByChannel string `json:"accessByChannel,omitempty"` Kvm int `json:"kvm"` Vmedia int `json:"vmedia"` NetworkPrivilege string `json:"network_privilege"` FixedUserCount int `json:"fixed_user_count"` OEMProprietaryLevelPrivilege int `json:"OEMProprietary_level_Privilege"` Privilege string `json:"privilege,omitempty"` PrivilegeByChannel string `json:"privilegeByChannel,omitempty"` PrivilegeLimitSerial string `json:"privilege_limit_serial"` SSHKey string `json:"ssh_key"` CreationTime int `json:"creation_time"` Changepassword int `json:"changepassword"` UserOperation int `json:"UserOperation"` Password string `json:"password"` ConfirmPassword string `json:"confirm_password"` PasswordSize string `json:"password_size"` PrevSNMP int `json:"prev_snmp"` SNMP int `json:"snmp"` SNMPAccess string `json:"snmp_access"` SNMPAuthenticationProtocol string `json:"snmp_authentication_protocol"` EmailFormat string `json:"email_format"` EmailID string `json:"email_id"` }
UserAccount is a ASRR BMC user account struct