Documentation ¶
Index ¶
- Variables
- func DeviceCommunication(ctx context.Context, req ResourceInfoRequest) response.RPC
- func GetPluginToken(ctx context.Context, req PluginContactRequest) string
- func GetResourceInfoFromDevice(ctx context.Context, req ResourceInfoRequest) (string, error)
- func TrackConfigFileChanges(configFilePath string, dbInterface DBInterface, errChan chan error)
- func TranslateToSouthBoundURL(url string) string
- type BmcUpdatedCreds
- type DBInterface
- type PluginContactRequest
- type PluginToken
- type ResourceInfoRequest
- type ResponseStatus
Constants ¶
This section is empty.
Variables ¶
var ( GetPluginTokenFunc = GetPluginToken GetPluginDataFunc = mgrmodel.GetPluginData StringEqualFold = strings.EqualFold ContactPluginFunc = ContactPlugin JSON_UnmarshalFunc = json.Unmarshal )
Functions ¶
func DeviceCommunication ¶
func DeviceCommunication(ctx context.Context, req ResourceInfoRequest) response.RPC
DeviceCommunication to connect with device with all the params
func GetPluginToken ¶
func GetPluginToken(ctx context.Context, req PluginContactRequest) string
GetPluginToken will verify the if any token present to the plugin else it will create token for the new plugin
func GetResourceInfoFromDevice ¶
func GetResourceInfoFromDevice(ctx context.Context, req ResourceInfoRequest) (string, error)
GetResourceInfoFromDevice will contact to the and gets the Particual resource info from device
func TrackConfigFileChanges ¶
func TrackConfigFileChanges(configFilePath string, dbInterface DBInterface, errChan chan error)
TrackConfigFileChanges monitors the odim config changes using fsnotfiy
func TranslateToSouthBoundURL ¶
TranslateToSouthBoundURL translates the url to southbound URL
Types ¶
type BmcUpdatedCreds ¶
type DBInterface ¶
type DBInterface struct { AddManagertoDBInterface func(mgrmodel.RAManager) error GenericSave func([]byte, string, string) error }
DBInterface hold interface for db functions
type PluginContactRequest ¶
type PluginContactRequest struct { Token string OID string DeviceInfo interface{} BasicAuth map[string]string ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) Plugin mgrmodel.Plugin HTTPMethodType string }
PluginContactRequest hold the request of contact plugin
type PluginToken ¶
PluginToken interface to hold the token
var Token PluginToken
Token variable hold the all the XAuthToken against the plguin ID
func (*PluginToken) GetToken ¶
func (p *PluginToken) GetToken(pluginID string) string
GetToken to get the token from map
func (*PluginToken) StoreToken ¶
func (p *PluginToken) StoreToken(plguinID, token string)
StoreToken to store the token ioto the map
type ResourceInfoRequest ¶
type ResourceInfoRequest struct { URL string UUID string SystemID string ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) DecryptDevicePassword func([]byte) ([]byte, error) HTTPMethod string RequestBody []byte BmcUpdatedCreds *BmcUpdatedCreds }
ResourceInfoRequest hold the request of getting Resource
type ResponseStatus ¶
ResponseStatus holds the response of Contact Plugin
func ContactPlugin ¶
func ContactPlugin(ctx context.Context, req PluginContactRequest, errorMessage string) ([]byte, string, ResponseStatus, error)
ContactPlugin is commons which handles the request and response of Contact Plugin usage
func RetryManagersOperation ¶
func RetryManagersOperation(ctx context.Context, req PluginContactRequest, errorMessage string) ([]byte, string, ResponseStatus, error)
RetryManagersOperation will be called whenever the unauthorized status code during the plugin call This function will create a new session token reexcutes the plugin call