Documentation
¶
Overview ¶
Package scommon ...
Index ¶
- Variables
- func GetPluginStatus(ctx context.Context, plugin smodel.Plugin) bool
- func GetResourceInfoFromDevice(ctx context.Context, req ResourceInfoRequest, saveRequired bool) (string, error)
- func TrackConfigFileChanges(configFilePath string, errChan chan error)
- type PluginContactRequest
- type ResourceInfoRequest
- type ResponseStatus
- type Schema
Constants ¶
This section is empty.
Variables ¶
var ( //IOReadAll function pointer for the ioutil.ReadAll IOReadAll = ioutil.ReadAll //JSONUnmarshalFunc function pointer for the json.Unmarshal JSONUnmarshalFunc = json.Unmarshal )
Functions ¶
func GetPluginStatus ¶
GetPluginStatus checks the status of given plugin in configured interval
func GetResourceInfoFromDevice ¶
func GetResourceInfoFromDevice(ctx context.Context, req ResourceInfoRequest, saveRequired bool) (string, error)
GetResourceInfoFromDevice will contact to the and gets the Particual resource info from device If saveRequired is set to true the newly collected data will be saved in the DB. Some specific cases may not require the data to be stored in DB, eg: Delete volume requires reset of the BMC to take its effect. Before a reset, volumes retrieval request can provide the deleted volume. We can avoid storing such a data with the use of saveRequired.
func TrackConfigFileChanges ¶
TrackConfigFileChanges monitors the odim config changes using fsnotfiy
Types ¶
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) GetPluginStatus func(context.Context, smodel.Plugin) bool Plugin smodel.Plugin HTTPMethodType string }
PluginContactRequest hold the request of contact plugin
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) DevicePassword func([]byte) ([]byte, error) GetPluginStatus func(context.Context, smodel.Plugin) bool ResourceName string }
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
type Schema ¶
type Schema struct { SearchKeys []map[string]map[string]string `json:"searchKeys"` ConditionKeys []string `json:"conditionKeys"` QueryKeys []string `json:"queryKeys"` }
Schema is used to define the allowed values for search/filter
var SF Schema
SF holds the schema data for search/filter