fleetdb

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerNotFound      = errors.New("server not found")
	ErrFirmwareSetNotFound = errors.New("firmware set not found")
)
View Source
var (
	ErrBMCCredentials = errors.New("invalid bmc credentials. missing user or password")
)

Functions

This section is empty.

Types

type FleetDB

type FleetDB interface {
	// AddServer creates a server in fleet db.
	AddServer(ctx context.Context, serverID uuid.UUID, facilityCode, bmcAddr, bmcUser, bmcPass string) (func() error, error)
	// Get Server attributes.
	// @serverID: required
	GetServer(ctx context.Context, serverID uuid.UUID) (*model.Server, error)
	// DeleteServer
	DeleteServer(ctx context.Context, serverID uuid.UUID) error
	// WriteEventHistory commits the final state of this Condition to FleetDB
	WriteEventHistory(ctx context.Context, cond *rctypes.Condition) error
	// FirmwareSetByID returns the firmware set matched by its identifier
	FirmwareSetByID(ctx context.Context, setID uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error)
}

FleetDB handles traffics between conditionorc and fleet db. NOTE: when updating this interface, run make gen-store-mock to make sure the mocks are updated.

func NewFleetDBClient

func NewFleetDBClient(ctx context.Context, config *app.Configuration, logger *logrus.Logger) (FleetDB, error)

type MockFleetDB

type MockFleetDB struct {
	mock.Mock
}

MockFleetDB is an autogenerated mock type for the FleetDB type

func NewMockFleetDB

func NewMockFleetDB(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockFleetDB

NewMockFleetDB creates a new instance of MockFleetDB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockFleetDB) AddServer

func (_m *MockFleetDB) AddServer(ctx context.Context, serverID uuid.UUID, facilityCode string, bmcAddr string, bmcUser string, bmcPass string) (func() error, error)

AddServer provides a mock function with given fields: ctx, serverID, facilityCode, bmcAddr, bmcUser, bmcPass

func (*MockFleetDB) DeleteServer added in v1.0.1

func (_m *MockFleetDB) DeleteServer(ctx context.Context, serverID uuid.UUID) error

DeleteServer provides a mock function with given fields: ctx, serverID

func (*MockFleetDB) EXPECT

func (_m *MockFleetDB) EXPECT() *MockFleetDB_Expecter

func (*MockFleetDB) FirmwareSetByID added in v1.1.3

func (_m *MockFleetDB) FirmwareSetByID(ctx context.Context, setID uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error)

FirmwareSetByID provides a mock function with given fields: ctx, setID

func (*MockFleetDB) GetServer

func (_m *MockFleetDB) GetServer(ctx context.Context, serverID uuid.UUID) (*model.Server, error)

GetServer provides a mock function with given fields: ctx, serverID

func (*MockFleetDB) WriteEventHistory added in v1.0.9

func (_m *MockFleetDB) WriteEventHistory(ctx context.Context, cond *condition.Condition) error

WriteEventHistory provides a mock function with given fields: ctx, cond

type MockFleetDB_AddServer_Call added in v1.0.9

type MockFleetDB_AddServer_Call struct {
	*mock.Call
}

MockFleetDB_AddServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddServer'

func (*MockFleetDB_AddServer_Call) Return added in v1.0.9

func (*MockFleetDB_AddServer_Call) Run added in v1.0.9

func (_c *MockFleetDB_AddServer_Call) Run(run func(ctx context.Context, serverID uuid.UUID, facilityCode string, bmcAddr string, bmcUser string, bmcPass string)) *MockFleetDB_AddServer_Call

func (*MockFleetDB_AddServer_Call) RunAndReturn added in v1.0.9

type MockFleetDB_DeleteServer_Call added in v1.0.9

type MockFleetDB_DeleteServer_Call struct {
	*mock.Call
}

MockFleetDB_DeleteServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServer'

func (*MockFleetDB_DeleteServer_Call) Return added in v1.0.9

func (*MockFleetDB_DeleteServer_Call) Run added in v1.0.9

func (*MockFleetDB_DeleteServer_Call) RunAndReturn added in v1.0.9

type MockFleetDB_Expecter added in v1.0.9

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

func (*MockFleetDB_Expecter) AddServer added in v1.0.9

func (_e *MockFleetDB_Expecter) AddServer(ctx interface{}, serverID interface{}, facilityCode interface{}, bmcAddr interface{}, bmcUser interface{}, bmcPass interface{}) *MockFleetDB_AddServer_Call

AddServer is a helper method to define mock.On call

  • ctx context.Context
  • serverID uuid.UUID
  • facilityCode string
  • bmcAddr string
  • bmcUser string
  • bmcPass string

func (*MockFleetDB_Expecter) DeleteServer added in v1.0.9

func (_e *MockFleetDB_Expecter) DeleteServer(ctx interface{}, serverID interface{}) *MockFleetDB_DeleteServer_Call

DeleteServer is a helper method to define mock.On call

  • ctx context.Context
  • serverID uuid.UUID

func (*MockFleetDB_Expecter) FirmwareSetByID added in v1.1.3

func (_e *MockFleetDB_Expecter) FirmwareSetByID(ctx interface{}, setID interface{}) *MockFleetDB_FirmwareSetByID_Call

FirmwareSetByID is a helper method to define mock.On call

  • ctx context.Context
  • setID uuid.UUID

func (*MockFleetDB_Expecter) GetServer added in v1.0.9

func (_e *MockFleetDB_Expecter) GetServer(ctx interface{}, serverID interface{}) *MockFleetDB_GetServer_Call

GetServer is a helper method to define mock.On call

  • ctx context.Context
  • serverID uuid.UUID

func (*MockFleetDB_Expecter) WriteEventHistory added in v1.0.9

func (_e *MockFleetDB_Expecter) WriteEventHistory(ctx interface{}, cond interface{}) *MockFleetDB_WriteEventHistory_Call

WriteEventHistory is a helper method to define mock.On call

  • ctx context.Context
  • cond *condition.Condition

type MockFleetDB_FirmwareSetByID_Call added in v1.1.3

type MockFleetDB_FirmwareSetByID_Call struct {
	*mock.Call
}

MockFleetDB_FirmwareSetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirmwareSetByID'

func (*MockFleetDB_FirmwareSetByID_Call) Return added in v1.1.3

func (*MockFleetDB_FirmwareSetByID_Call) Run added in v1.1.3

func (*MockFleetDB_FirmwareSetByID_Call) RunAndReturn added in v1.1.3

type MockFleetDB_GetServer_Call added in v1.0.9

type MockFleetDB_GetServer_Call struct {
	*mock.Call
}

MockFleetDB_GetServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetServer'

func (*MockFleetDB_GetServer_Call) Return added in v1.0.9

func (*MockFleetDB_GetServer_Call) Run added in v1.0.9

func (*MockFleetDB_GetServer_Call) RunAndReturn added in v1.0.9

type MockFleetDB_WriteEventHistory_Call added in v1.0.9

type MockFleetDB_WriteEventHistory_Call struct {
	*mock.Call
}

MockFleetDB_WriteEventHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteEventHistory'

func (*MockFleetDB_WriteEventHistory_Call) Return added in v1.0.9

func (*MockFleetDB_WriteEventHistory_Call) Run added in v1.0.9

func (*MockFleetDB_WriteEventHistory_Call) RunAndReturn added in v1.0.9

Jump to

Keyboard shortcuts

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