Documentation ¶
Index ¶
- Variables
- func ContactPlugin(ctx context.Context, req agmodel.PluginContactRequest, serverName string) (*http.Response, error)
- func CreateContext(transactionId, actionId, actionName, threadId, threadName, ProcessName string) context.Context
- func GetAllPlugins(ctx context.Context) ([]agmodel.Plugin, error)
- func GetDeviceSubscriptionDetails(serverAddress string) (string, []string, error)
- func GetPluginStatus(ctx context.Context, plugin agmodel.Plugin) bool
- func GetPluginStatusRecord(plugin string) (int, bool)
- func GetSearchKey(key, index string) string
- func GetStorageResources(ctx context.Context, oid string) map[string]interface{}
- func GetSubscribedEvtTypes(searchKey string) ([]string, error)
- func LookupHost(addr string) (ip, host, port string, err error)
- func LookupPlugin(ctx context.Context, addr string) (agmodel.Plugin, error)
- func SetPluginStatusRecord(plugin string, count int)
- func TrackConfigFileChanges(dbInterface DBInterface, errChan chan error)
- func UpdateDeviceSubscriptionDetails(ctx context.Context, subsData map[string]string)
- type DBInterface
- type PluginHealthCheckInterface
- type PluginStatusRecord
Constants ¶
This section is empty.
Variables ¶
var ( //GetResourceDetailsFunc function pointer for the agmodel.GetResourceDetails GetResourceDetailsFunc = agmodel.GetResourceDetails // GetAllKeysFromTableFunc function pointer for the agmodel.GetAllKeysFromTable GetAllKeysFromTableFunc = agmodel.GetAllKeysFromTable //GetAllSystemsFunc function pointer for the agmodel.GetAllSystems GetAllSystemsFunc = agmodel.GetAllSystems //GetDeviceSubscriptionsFunc function pointer for the agmodel.GetDeviceSubscriptions GetDeviceSubscriptionsFunc = agmodel.GetDeviceSubscriptions // UpdateDeviceSubscriptionFunc function pointer for the agmodel.UpdateDeviceSubscription UpdateDeviceSubscriptionFunc = agmodel.UpdateDeviceSubscription // GetEventSubscriptionsFunc function pointer for the agmodel.GetEventSubscriptions GetEventSubscriptionsFunc = agmodel.GetEventSubscriptions // JSONUnMarshalFunc function pointer for the json.Unmarshal JSONUnMarshalFunc = json.Unmarshal //LookupIPfunc function pointer for the net.LookupIP LookupIPfunc = net.LookupIP //SplitHostPortfunc function pointer for the net.SplitHostPort SplitHostPortfunc = net.SplitHostPort )
var ( // ConfigFilePath holds the value of odim config file path ConfigFilePath string // PSRecord holds the record of each plugin health check status PSRecord PluginStatusRecord )
var SupportedConnectionMethodTypes = map[string]bool{ "Redfish": true, "SNMP": false, "OEM": false, "NETCONF": false, "IPMI15": false, "IPMI20": false, }
SupportedConnectionMethodTypes is for validating the connection method type
Functions ¶
func ContactPlugin ¶
func ContactPlugin(ctx context.Context, req agmodel.PluginContactRequest, serverName string) (*http.Response, error)
ContactPlugin is for sending requests to a plugin.
func CreateContext ¶
func GetAllPlugins ¶
GetAllPlugins is for fetching all the plugins added andn stored in db.
func GetDeviceSubscriptionDetails ¶
GetDeviceSubscriptionDetails is for getting device event susbcription details
func GetPluginStatus ¶
GetPluginStatus checks the status of given plugin
func GetPluginStatusRecord ¶
GetPluginStatusRecord is for getting the status record of a plugin
func GetSearchKey ¶
GetSearchKey will return search key with regular expression for filtering
func GetStorageResources ¶
GetStorageResources will get the resource details from the database for the given odata id
func GetSubscribedEvtTypes ¶
GetSubscribedEvtTypes is to get event subscription details
func LookupHost ¶
LookupHost - look up the ip from the host address
func LookupPlugin ¶
LookupPlugin is for fetching the plugin data using the plugin address for lookup
func SetPluginStatusRecord ¶
SetPluginStatusRecord is for setting the status record of a plugin
func TrackConfigFileChanges ¶
func TrackConfigFileChanges(dbInterface DBInterface, errChan chan error)
TrackConfigFileChanges monitors the odim config changes using fsnotfiy Whenever any config file changes and events will be and reload the configuration and verify the existing connection methods
Types ¶
type DBInterface ¶
type DBInterface struct { GetAllKeysFromTableInterface func(string) ([]string, error) GetConnectionMethodInterface func(string) (agmodel.ConnectionMethod, *errors.Error) AddConnectionMethodInterface func(agmodel.ConnectionMethod, string) *errors.Error DeleteInterface func(string, string, common.DbType) *errors.Error }
DBInterface hold interface for db functions
func (*DBInterface) AddConnectionMethods ¶
func (e *DBInterface) AddConnectionMethods(connectionMethodConf []config.ConnectionMethodConf) error
AddConnectionMethods will add the connection method type and variant into DB
type PluginHealthCheckInterface ¶
type PluginHealthCheckInterface struct { DecryptPassword func([]byte) ([]byte, error) PluginConfig config.PluginStatusPolling RootCA []byte }
PluginHealthCheckInterface holds the methods required for plugin healthcheck
func (*PluginHealthCheckInterface) DupPluginConf ¶
func (phc *PluginHealthCheckInterface) DupPluginConf()
DupPluginConf is for duplicating the plugin status polling config using a lock at one place instead of acquiring a lock and reading the config params multiple times
func (*PluginHealthCheckInterface) GetPluginManagedServers ¶
func (phc *PluginHealthCheckInterface) GetPluginManagedServers(plugin agmodel.Plugin) []agmodel.Target
GetPluginManagedServers is for fetching the list of servers managed by a plugin
func (*PluginHealthCheckInterface) GetPluginStatus ¶
func (phc *PluginHealthCheckInterface) GetPluginStatus(ctx context.Context, plugin agmodel.Plugin) (bool, []string)
GetPluginStatus is for checking the status of a plugin