domain

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsHandledCSFUT bool
View Source
var LOADERLOGSDIR string = "/fw/loaderlogs/"
View Source
var LoaderRunning bool = false
View Source
var UTMutex sync.Mutex

Functions

func AbortActionID

func AbortActionID(actionID uuid.UUID) (pb model.Passback)

AbortActionID - halt a running action

func BuildSnapshot

func BuildSnapshot(snapshot storage.Snapshot)

func CheckBlockage

func CheckBlockage(allOperations *[]storage.Operation)

CheckBlockage scans all blockedOperations and checks if its blocker is completed, if it is then it updates the state to configured

func ConfigureSystemForUnitTesting

func ConfigureSystemForUnitTesting()

func CreateImage

func CreateImage(i presentation.RawImage) (pb model.Passback)

CreateImage - will create an image

func CreateSnapshot

func CreateSnapshot(parameters storage.SnapshotParameters) (pb model.Passback)

TODO if a ImageID isnt set for a device target, we cant restore it! -> therefore we should probably point that out in the return data!

func DeleteAction

func DeleteAction(id uuid.UUID) (pb model.Passback)

DeleteAction - deletes a non running action

func DeleteExpiredActions added in v1.27.0

func DeleteExpiredActions(daysToKeep int)

func DeleteExpiredSnapshots added in v1.27.0

func DeleteExpiredSnapshots()

func DeleteImage

func DeleteImage(imageID uuid.UUID) (pb model.Passback)

DeleteImage - deletes an Image

func DeleteLoaderRun

func DeleteLoaderRun(id uuid.UUID) (pb model.Passback)

func DeleteSnapshot

func DeleteSnapshot(name string) (pb model.Passback)

func DeleteStoredAction added in v1.24.0

func DeleteStoredAction(actionID uuid.UUID) (err error)

func DeleteStoredImage added in v1.24.0

func DeleteStoredImage(imageID uuid.UUID) (err error)

func DeleteStoredOperation added in v1.24.0

func DeleteStoredOperation(operationID uuid.UUID) (err error)

func DeleteStoredSnapshot added in v1.24.0

func DeleteStoredSnapshot(name string) (err error)

func DoLoadFromNexus

func DoLoadFromNexus(sleeptimeMinutes int)

Loads firmware from Nexus - Called when FAS Starts Continues runnning until images are in FAS

func DoLoader

func DoLoader(localFile string, id uuid.UUID)

func FillInImageIDForDevices

func FillInImageIDForDevices(deviceMap *map[string]storage.Device, hsmData *map[hsm.XnameTarget]hsm.HsmData, imageMap *map[uuid.UUID]storage.Image)

func FillInImageId

func FillInImageId(operation *storage.Operation, imageMap *map[uuid.UUID]storage.Image, parameters storage.ActionParameters) (err error)

func FilterImage

func FilterImage(candidateOperations *map[uuid.UUID]storage.Operation, parameters storage.ActionParameters) (err error)

func FilterModelManufacturer

func FilterModelManufacturer(dataMap *map[hsm.XnameTarget]hsm.HsmData, parameters storage.InventoryHardwareFilter) (err error)

func FilterTargets

func FilterTargets(hsmDataMap *map[string]hsm.HsmData, parameters storage.TargetFilter) (XnameTargets []hsm.XnameTarget, MatchedXnameTargets []hsm.XnameTarget, UnMatchedXnameTargets []hsm.XnameTarget)

func FlattenDeviceMap

func FlattenDeviceMap(A map[string]storage.Device) (B []storage.Device)

func FullJoinDeviceMap

func FullJoinDeviceMap(A map[string]storage.Device, B map[string]storage.Device) (C map[string]storage.Device)

func GenerateOperations

func GenerateOperations(actionID uuid.UUID)

Create Update List for this Update ActionID and add to Master Update List

func GetAction

func GetAction(id uuid.UUID) (pb model.Passback)

GetAction - gets an action and formats it for presentation

func GetActionDetail

func GetActionDetail(id uuid.UUID) (pb model.Passback)

GetActionDetail - gets an action and formats it for presentation

func GetActionOperationID

func GetActionOperationID(actionID uuid.UUID, operationID uuid.UUID) (pb model.Passback)

GetActionOperationID - gets the operation for an action

func GetActionState

func GetActionState(id uuid.UUID) (action storage.Action)

func GetActionStatus

func GetActionStatus(actionID uuid.UUID) (pb model.Passback)

func GetAllAbortSignaledActions

func GetAllAbortSignaledActions() []storage.Action

func GetAllActions

func GetAllActions() (pb model.Passback)

GetAllActions - gets all actions from the system formatting them as a summary

func GetAllActiveOperationsFromAction

func GetAllActiveOperationsFromAction(actionID uuid.UUID) []storage.Operation

func GetAllNonCompleteNonInitialActions

func GetAllNonCompleteNonInitialActions() []storage.Action

func GetAllOperations added in v1.27.0

func GetAllOperations() (operations []storage.Operation, err error)

func GetAllOperationsFromAction

func GetAllOperationsFromAction(actionID uuid.UUID) (operations []storage.Operation, err error)

func GetCurrentFirmwareVersionsFromHsmDataAndTargets

func GetCurrentFirmwareVersionsFromHsmDataAndTargets(hd map[hsm.XnameTarget]hsm.HsmData) (deviceMap map[string]storage.Device, errors []string)

passing in a copy!

func GetCurrentFirmwareVersionsFromParams

func GetCurrentFirmwareVersionsFromParams(params storage.SnapshotParameters) (devices []storage.Device, errlist []string)

func GetFirmwareVersionURL

func GetFirmwareVersionURL(data hsm.HsmData, target string) (retURL string, err error)

func GetImage

func GetImage(imageID uuid.UUID) (pb model.Passback)

GetImage - returns an image by imageID

func GetImageMap

func GetImageMap() (images map[uuid.UUID]storage.Image)

func GetImageStorage

func GetImageStorage(imageID uuid.UUID) (pb model.Passback)

func GetImages

func GetImages() (pb model.Passback)

GetImages - returns all images

func GetLoaderStatus

func GetLoaderStatus() (pb model.Passback)

func GetLoaderStatusID

func GetLoaderStatusID(id uuid.UUID) (pb model.Passback)

func GetOperationSummaryFromAction

func GetOperationSummaryFromAction(actionID uuid.UUID) (operationCounts presentation.OperationCounts)

func GetSnapshot

func GetSnapshot(name string) (pb model.Passback)

GetSnapshot - gets a snapshot summary

func GetSnapshots

func GetSnapshots() (pb model.Passback)

GetSnapshots - gets all snapshot summaries

func GetStoredAction added in v1.24.0

func GetStoredAction(actionID uuid.UUID) (action storage.Action, err error)

func GetStoredActions added in v1.24.0

func GetStoredActions() (actions []storage.Action, err error)

func GetStoredImage added in v1.24.0

func GetStoredImage(imageID uuid.UUID) (image storage.Image, err error)

func GetStoredImages added in v1.24.0

func GetStoredImages() (images []storage.Image, err error)

func GetStoredOperation added in v1.24.0

func GetStoredOperation(operationID uuid.UUID) (operation storage.Operation, err error)

func GetStoredOperations added in v1.24.0

func GetStoredOperations(actionID uuid.UUID) (operations []storage.Operation, err error)

func GetStoredSnapshot added in v1.24.0

func GetStoredSnapshot(name string) (snapshot storage.Snapshot, err error)

func GetStoredSnapshots added in v1.24.0

func GetStoredSnapshots() (snapshots []storage.Snapshot, err error)

func GetTaskLinkURL

func GetTaskLinkURL(data hsm.HsmData, tasklink string) (retURL string, err error)

func GetUpdateInfoURL

func GetUpdateInfoURL(data hsm.HsmData, updateinfolink string) (retURL string, err error)

func Init

func Init(glob *DOMAIN_GLOBALS)

func NumImages

func NumImages() (num int, err error)

func PruneXnameTargetList

func PruneXnameTargetList(hd *map[hsm.XnameTarget]hsm.HsmData) (badDeviceMap map[string]storage.Device, errors []string)

PruneXnameTargetList -> if there is an xnametarget, whose hsmdata isnt DiscoverOK, then we CANT get the fw version, so kick it out.

func RestoreSnapshot

func RestoreSnapshot(action storage.Action, snapshot storage.Snapshot)

func RetrieveFirmwareVersion

func RetrieveFirmwareVersion(hd *hsm.HsmData, target string) (firmwareVersion string, err error)

func RetrieveFirmwareVersionFromTargets

func RetrieveFirmwareVersionFromTargets(hd *map[hsm.XnameTarget]hsm.HsmData) (deviceMap map[string]storage.Device, err error)

func RetrieveTaskStatus

func RetrieveTaskStatus(hd *hsm.HsmData, tasklink string) (stateStatus model.TaskStateStatus, err error)

func RetrieveUpdateInfo

func RetrieveUpdateInfo(hd *hsm.HsmData, updateinfolink string) (updateInfo model.UpdateInfo, err error)

func ServiceStatusDetails

func ServiceStatusDetails(check CheckServiceStatus) (pb model.Passback)

func SetErrSolOp added in v1.28.0

func SetErrSolOp(candidateOperation *storage.Operation)

func SetFirmwareVersion

func SetFirmwareVersion(candidateOperation *storage.Operation, deviceMap *map[string]storage.Device)

func SetNoOpOp

func SetNoOpOp(candidateOperation *storage.Operation, overwriteSameImage bool)

func SetNoSolOp

func SetNoSolOp(candidateOperation *storage.Operation)

func StartRestoreSnapshot

func StartRestoreSnapshot(name string, overrideDryrun bool, timeLimit int) (pb model.Passback)

func StoreAction

func StoreAction(action storage.Action) (err error)

func StoreImage added in v1.24.0

func StoreImage(image storage.Image) (err error)

func StoreOperation

func StoreOperation(operation storage.Operation) (err error)

func StoreSnapshot added in v1.24.0

func StoreSnapshot(snapshot storage.Snapshot) (err error)

func TriggerFirmwareUpdate

func TriggerFirmwareUpdate(params storage.ActionParameters) (pb model.Passback)

TriggerFirmwareUpdate - will construct an ID, and async fire off work

func UpdateImage

func UpdateImage(image presentation.RawImage, imageid uuid.UUID) (pb model.Passback)

UpdateImage - create or update an image

func ValidateActionParameters

func ValidateActionParameters(l *storage.ActionParameters) (err error)

ValidateActionParameters -> will VALIDATE the parameters, and set a few defaults along the way. It will check that an xname is a valid form, but not that it exists. When we generate the operations we will only generate ones we can we will flush out the list and return it to users... if they ask for a 'valid' xname that doesnt exist, is that an error? at this point I say NO; dont prevent everthing else so the question then becomes, how does an admin learn that an xname wasnt actually used?

func ValidateCommandParameter

func ValidateCommandParameter(c *storage.Command) (err error)

func ValidateImageFilter

func ValidateImageFilter(i *storage.ImageFilter) (err error)

ValidateImageFilter - makes sure that if set 1 and ONLY 1 image corresponds to the

func ValidateImageParameters

func ValidateImageParameters(i *storage.Image) (err error)

Require:

ImageID - Non-nil
CreateTime -
DeviceType - Required
Manufacturer - Required
Models - Required
Target - Required
Tags -
FirmwareVersion - Required
SemanticFirmwareVersion - Required
UpdateURI -
VersionURI -
NeedManualReboot -
S3URL - Required
AllowableDeviceStates -
DependsOn -
tftpURL

func ValidateSnapshotParameters

func ValidateSnapshotParameters(l *storage.SnapshotParameters) (err error)

func ValidateStateComponentFilter

func ValidateStateComponentFilter(c *storage.StateComponentFilter) (err error)

func ValidateXnames

func ValidateXnames(c *storage.StateComponentFilter) (err error)

Types

type CheckServiceStatus

type CheckServiceStatus struct {
	Version           bool
	Status            bool
	HSMStatus         bool
	StorageStatus     bool
	RFTransportStatus bool
}

type DOMAIN_GLOBALS

type DOMAIN_GLOBALS struct {
	CAUri             string
	BaseTRSTask       *trs_http_api.HttpTask
	RFTloc            *trs_http_api.TrsAPI
	HSMTloc           *trs_http_api.TrsAPI
	RFClientLock      *sync.RWMutex
	Running           *bool
	DSP               *storage.StorageProvider
	HSM               *hsm.HSMProvider
	RFHttpClient      *hms_certs.HTTPClientPair
	SVCHttpClient     *hms_certs.HTTPClientPair
	RFTransportReady  *bool
	DaysToKeepActions int
}
var GLOB *DOMAIN_GLOBALS

func (*DOMAIN_GLOBALS) NewGlobals

func (g *DOMAIN_GLOBALS) NewGlobals(base *trs_http_api.HttpTask,
	tlocRF *trs_http_api.TrsAPI,
	tlocSVC *trs_http_api.TrsAPI,
	clientRF *hms_certs.HTTPClientPair,
	clientSVC *hms_certs.HTTPClientPair,
	rfClientLock *sync.RWMutex,
	running *bool, dsp *storage.StorageProvider,
	hsm *hsm.HSMProvider, daysToKeepActions int)

type ServiceStatus

type ServiceStatus struct {
	Version           string `json:"serviceVersion,omitempty"`
	Status            string `json:"serviceStatus,omitempty"`
	HSMStatus         string `json:"hsmStatus,omitempty"`
	StorageStatus     string `json:"storageStatus,omitempty"`
	RFTransportStatus string `json:"rfTransportStatus,omitempty"`
}

Jump to

Keyboard shortcuts

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