hsm

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: 24 Imported by: 0

Documentation

Overview

* MIT License * * (C) Copyright [2020-2024] Hewlett Packard Enterprise Development LP * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoveryInfoEquals

func DiscoveryInfoEquals(obj rf.DiscoveryInfo, other rf.DiscoveryInfo) bool

Types

type HSMProvider

type HSMProvider interface {
	RefillModelRF(XtHd *map[XnameTarget]HsmData, specialTargets map[string]string) (errs []error)
	GetTargetsRF(hd *map[string]HsmData) (tuples []XnameTarget, errs []error)
	FillRedfishEndpointData(hd *map[string]HsmData) (errs []error)
	FillUpdateServiceData(hd *map[string]HsmData) (errs []error)
	FillModelManufacturerRF(hd *map[string]HsmData) (errs []error)
	FillComponentEndpointData(hd *map[string]HsmData) (errs []error)
	GetStateComponents(xnames []string, partitions []string, groups []string, types []string) (data base.ComponentArray, err error)
	FillHSMData(xnames []string, partitions []string, groups []string, types []string) (hd map[string]HsmData, errs []error)
	RestoreCredentials(hd *HsmData) (err error)
	//OtherStuff -> GOOD
	ClearLock(xnames []string) error
	SetLock(xnames []string) error
	Ping() (err error)
	Init(globals *HSM_GLOBALS) (err error)
}

type HSM_GLOBALS

type HSM_GLOBALS struct {
	Logger             *logrus.Logger
	BaseTRSTask        *trsapi.HttpTask
	RFTloc             *trsapi.TrsAPI
	SVCTloc            *trsapi.TrsAPI
	RFClientLock       *sync.RWMutex
	StateManagerServer string
	VaultEnabled       bool
	VaultKeypath       string
	Credentials        *compcredentials.CompCredStore
	Running            *bool
	LockEnabled        bool
	RFHttpClient       *hms_certs.HTTPClientPair
	SVCHttpClient      *hms_certs.HTTPClientPair
	Reservation        reservation.Production
}

func (*HSM_GLOBALS) NewGlobals

func (g *HSM_GLOBALS) NewGlobals(Logger *logrus.Logger, baseTRSRequest *trsapi.HttpTask,
	tlocRF *trsapi.TrsAPI, tlocSVC *trsapi.TrsAPI,
	clientRF *hms_certs.HTTPClientPair,
	clientSVC *hms_certs.HTTPClientPair,
	rfClientLock *sync.RWMutex,
	sms string, vault bool, keypath string, running *bool,
	lockEnabled bool)

type HSMv0

type HSMv0 struct {
	HSMGlobals HSM_GLOBALS
}

func (*HSMv0) ClearLock

func (b *HSMv0) ClearLock(xnames []string) (error error)

func (*HSMv0) FillComponentEndpointData

func (b *HSMv0) FillComponentEndpointData(hd *map[string]HsmData) (errs []error)

func (*HSMv0) FillHSMData

func (b *HSMv0) FillHSMData(xnames []string, partitions []string, groups []string, types []string) (hd map[string]HsmData, errs []error)

func (*HSMv0) FillModelManufacturerRF

func (b *HSMv0) FillModelManufacturerRF(hd *map[string]HsmData) (errs []error)

func (*HSMv0) FillRedfishEndpointData

func (b *HSMv0) FillRedfishEndpointData(hd *map[string]HsmData) (errs []error)

func (*HSMv0) FillUpdateServiceData

func (b *HSMv0) FillUpdateServiceData(hd *map[string]HsmData) (errs []error)

func (*HSMv0) GetStateComponents

func (b *HSMv0) GetStateComponents(xnames []string, partitions []string, groups []string, types []string) (data base.ComponentArray, err error)

func (*HSMv0) GetTargetsRF

func (b *HSMv0) GetTargetsRF(hd *map[string]HsmData) (tuples []XnameTarget, errs []error)

func (*HSMv0) Init

func (b *HSMv0) Init(globals *HSM_GLOBALS) (err error)

func (*HSMv0) Ping

func (b *HSMv0) Ping() (err error)

func (*HSMv0) RefillModelRF

func (b *HSMv0) RefillModelRF(XnameTargetHsmData *map[XnameTarget]HsmData, specialTargets map[string]string) (errs []error)

RefillModelRF -> will take a listing of xnameTargets / hsmdata + a list of special targets/ rf paths and perform an operation to reset the hsmdata.model. It will use the rf path to query the device and pull out the model

func (*HSMv0) RestoreCredentials

func (b *HSMv0) RestoreCredentials(hd *HsmData) (err error)

func (*HSMv0) SetLock

func (b *HSMv0) SetLock(xnames []string) (error error)

We expect FAS to be reserving individual items. If we get a list, we will reserve anything in the list. Already being reserved is an error, and reservations do not nest, so only call ClearLock call once!

type HsmData

type HsmData struct {
	ID           string           `json:"id,omitempty"`
	Type         string           `json:"type"`
	Hostname     string           `json:"hostname,omitempty"`
	Domain       string           `json:"domain,omitempty"`
	FQDN         string           `json:"FQDN"`
	Password     string           `json:"-"`
	User         string           `json:"-"`
	UpdateURI    string           `json:"updateURI"`
	InventoryURI string           `json:"inventoryURI"`
	Role         string           `json:"role"`
	Model        string           `json:"model"`
	Manufacturer string           `json:"manufacturer"`
	Error        error            `json:"error"`
	BmcPath      string           `json:"bmdPath"'`
	RfType       string           `json:"rfType"`
	DiscInfo     rf.DiscoveryInfo `json:"DiscoveryInfo,omitempty"`
	ActionReset  rf.ActionReset   `json:"actionReset,omitempty"`
}

func ToHsmDataFromRFEndpoint

func ToHsmDataFromRFEndpoint(src *rf.RedfishEPDescription) (dst HsmData)

func (*HsmData) CopyFrom

func (src *HsmData) CopyFrom(ref *HsmData)

func (*HsmData) Equals

func (obj *HsmData) Equals(other HsmData) bool

type InventoryHardware

type InventoryHardware struct {
	PopulatedFRU struct {
		NodeFRUInfo struct {
			Model string `json:"Models"`
		}
	}
}

type NodeInfo

type NodeInfo struct {
	Model string `json:"Model"`
}

type RedfishEndpointIDs

type RedfishEndpointIDs struct {
	RedfishEndpoints []struct {
		Id string `json:"id"`
	}
}

type RedfishEndpoints

type RedfishEndpoints struct {
	RedfishEndpoints []HsmData `json:"RedfishEndpoints"`
}

type RedfishModel

type RedfishModel struct {
	Model string `json:"Model"`
}

type StateComponents

type StateComponents struct {
	Role string `json:"Role"`
}

type TargetedMembers

type TargetedMembers struct {
	InventoriedMembers []struct {
		Path       string `json:"@odata.id"`
		TargetId   string `json:"Id"`
		TargetName string `json:"Name"`
		Version    string `json:"Version"`
	} `json:"Members"`
}

type UpdateService

type UpdateService struct {
	ServiceInfo struct {
		FirmwareInventory struct {
			Path string `json:"@odata.id"`
		} `json:"FirmwareInventory"`
		SoftwareInventory struct {
			Path string `json:"@odata.id"`
		} `json:"SoftwareInventory"`
		Actions struct {
			Update struct {
				Path string `json:"target"`
			} `json:"#UpdateService.SimpleUpdate"`
		}
	}
}

type XnameTarget

type XnameTarget struct {
	Xname      string
	Target     string
	TargetName string
	Version    string
}

Jump to

Keyboard shortcuts

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