asrockrack

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName for the provider implementation
	ProviderName = "asrockrack"
	// ProviderProtocol for the provider implementation
	ProviderProtocol = "vendorapi"
)

Variables

Functions

This section is empty.

Types

type ASRockOption added in v0.5.3

type ASRockOption func(*ASRockRack)

ASRockOption is a type that can configure an *ASRockRack

func WithHTTPClient added in v0.5.3

func WithHTTPClient(c *http.Client) ASRockOption

WithHTTPClient sets an HTTP client on the ASRockRack

func WithSecureTLS added in v0.5.3

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 New

func New(ip string, username string, password string, log logr.Logger) (*ASRockRack, error)

New returns a new ASRockRack instance ready to be used

func NewWithOptions added in v0.5.3

func NewWithOptions(ip string, username string, password string, log logr.Logger, opts ...ASRockOption) (r *ASRockRack, err error)

NewWithOptions returns a new ASRockRack instance with options ready to be used

func (*ASRockRack) BmcReset added in v0.5.3

func (a *ASRockRack) BmcReset(ctx context.Context, resetType string) (ok bool, err error)

BmcReset will reset the BMC - ASRR BMCs only support a cold reset.

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) Compatible

func (a *ASRockRack) Compatible(ctx context.Context) bool

Compatible implements the registrar.Verifier interface returns true if the BMC is identified to be an asrockrack

func (*ASRockRack) FirmwareInstall added in v0.5.3

func (a *ASRockRack) FirmwareInstall(ctx context.Context, component, applyAt string, forceInstall bool, reader io.Reader) (jobID string, err error)

FirmwareInstall uploads and initiates firmware update for the component

func (*ASRockRack) FirmwareInstallStatus added in v0.5.3

func (a *ASRockRack) FirmwareInstallStatus(ctx context.Context, installVersion, component, taskID string) (status string, err error)

FirmwareInstallStatus returns the status of the firmware install process, a bool value indicating if the component requires a reset

func (*ASRockRack) Inventory added in v0.5.3

func (a *ASRockRack) Inventory(ctx context.Context) (device *devices.Device, err error)

func (*ASRockRack) Open

func (a *ASRockRack) Open(ctx context.Context) (err error)

Open a connection to a BMC, implements the Opener interface

func (*ASRockRack) PostCode added in v0.5.3

func (a *ASRockRack) PostCode(ctx context.Context) (status string, code int, err error)

func (*ASRockRack) PowerSet added in v0.5.3

func (a *ASRockRack) PowerSet(ctx context.Context, state string) (ok bool, err error)

PowerSet sets the hardware power state of a machine

func (*ASRockRack) PowerStateGet added in v0.5.3

func (a *ASRockRack) PowerStateGet(ctx context.Context) (state string, err error)

PowerStateGet gets the power state of a machine

func (*ASRockRack) UserCreate added in v0.4.14

func (a *ASRockRack) UserCreate(ctx context.Context, user, pass, role string) (ok bool, err error)

UserCreate adds a new user account

func (*ASRockRack) UserRead added in v0.4.14

func (a *ASRockRack) UserRead(ctx context.Context) (users []map[string]string, err error)

UserRead returns a list of enabled user accounts

func (*ASRockRack) UserUpdate added in v0.4.14

func (a *ASRockRack) UserUpdate(ctx context.Context, user, pass, role string) (ok bool, err error)

UserUpdate updates a user password and role

type UserAccount added in v0.4.14

type UserAccount struct {
	ID                           int    `json:"id"`
	Name                         string `json:"name"`
	Access                       int    `json:"access"`
	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"`
	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

Jump to

Keyboard shortcuts

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