Documentation
¶
Overview ¶
Package evmodel have the struct models and DB functionalities
Index ¶
- Constants
- Variables
- func DeleteDeviceSubscription(hostIP string) error
- func DeleteEvtSubscription(key string) error
- func DeleteUndeliveredEvents(destination string) error
- func DeleteUndeliveredEventsFlag(destination string) error
- func GetAggregateHosts(aggregateID string) ([]string, error)
- func GetAggregateList(hostIP string) ([]string, error)
- func GetAllAggregates() ([]string, error)
- func GetAllDeviceSubscriptions() ([]string, error)
- func GetAllEvtSubscriptions() ([]string, error)
- func GetAllFabrics() ([]string, error)
- func GetAllKeysFromTable(table string) ([]string, error)
- func GetAllMatchingDetails(table, pattern string, dbtype common.DbType) ([]string, *errors.Error)
- func GetAllPlugins() ([]common.Plugin, *errors.Error)
- func GetAllSystems() ([]string, error)
- func GetDeviceSubscriptions(hostIP string) (*common.DeviceSubscription, error)
- func GetPluginData(pluginID string) (*common.Plugin, *errors.Error)
- func GetResource(Table, key string) (string, *errors.Error)
- func GetSingleSystem(id string) (string, error)
- func GetSliceFromString(sliceString string) []string
- func GetTarget(deviceUUID string) (*common.Target, error)
- func GetUndeliveredEvents(destination string) (string, error)
- func GetUndeliveredEventsFlag(destination string) (bool, error)
- func GetUndeliveredEventsKeyList(table, pattern string, dbType common.DbType, nextCursor int) ([]string, int, *errors.Error)
- func SaveAggregateSubscription(aggregateID string, hostIP []string) error
- func SaveDeviceSubscription(devSubscription common.DeviceSubscription) error
- func SaveEventSubscription(evtSubscription SubscriptionResource) error
- func SaveUndeliveredEvents(key string, event []byte) error
- func SetUndeliveredEventsFlag(destination string) error
- func UpdateAggregateHosts(aggregateID string, hostIP []string) error
- func UpdateDeviceSubscriptionLocation(devSubscription common.DeviceSubscription) error
- func UpdateEventSubscription(evtSubscription SubscriptionResource) error
- type Aggregate
- type EventPost
- type Fabric
- type PluginTaskInfo
- type SubscriptionResource
Constants ¶
const ( // EventFormatType is set to Event (MetricReport is not supporting now EventFormatType = "Event" // SubscriptionType is set to RedfishEvent (make it as array of SubscriptionType SubscriptionType = "RedfishEvent" // Context is set to default if its empty Context = "Default" // SubscriptionName is set to default name incase if its empty SubscriptionName = "Event Subscription" // SubscriptionIndex is a index name which required for indexing of event subscriptions SubscriptionIndex = common.SubscriptionIndex // DeviceSubscriptionIndex is a index name which required for indexing // subscription of device DeviceSubscriptionIndex = common.DeviceSubscriptionIndex // UndeliveredEvents holds table for UndeliveredEvent UndeliveredEvents = "UndeliveredEvents" // ReadInProgress holds table for ReadInProgress ReadInProgress = "ReadInProgress" // DeliveryRetryPolicy is set to default value incase if its empty DeliveryRetryPolicy = "RetryForever" // AggregateSubscriptionIndex is a index name which required for indexing // subscription of device AggregateSubscriptionIndex = common.AggregateSubscriptionIndex )
Variables ¶
var ( //GetDbConnection alias for common.GetDBConnection GetDbConnection = common.GetDBConnection )
Functions ¶
func DeleteDeviceSubscription ¶
DeleteDeviceSubscription is to delete subscription details of device
func DeleteEvtSubscription ¶
DeleteEvtSubscription is to delete event subscription details
func DeleteUndeliveredEvents ¶
DeleteUndeliveredEvents deletes the undelivered events for the destination
func DeleteUndeliveredEventsFlag ¶
DeleteUndeliveredEventsFlag deletes the PickUpUndeliveredEventsFlag key from the DB, return error if any
func GetAggregateHosts ¶
GetAggregateHosts is to get subscription details of device
func GetAggregateList ¶
GetAggregateList will fetch aggregate list
func GetAllAggregates ¶
GetAllAggregates return all aggregate url added in DB
func GetAllDeviceSubscriptions ¶
GetAllDeviceSubscriptions is to get subscription details of device
func GetAllEvtSubscriptions ¶
GetAllEvtSubscriptions is to get all event subscription details
func GetAllKeysFromTable ¶
GetAllKeysFromTable return all matching data give table name
func GetAllMatchingDetails ¶
GetAllMatchingDetails accepts the table name ,pattern and DB type and return all the keys which matches the pattern
func GetAllPlugins ¶
GetAllPlugins gets all the Plugin from the db
func GetAllSystems ¶
GetAllSystems retrieves all the compute systems in odimra
func GetDeviceSubscriptions ¶
func GetDeviceSubscriptions(hostIP string) (*common.DeviceSubscription, error)
GetDeviceSubscriptions is to get subscription details of device
func GetPluginData ¶
GetPluginData will fetch plugin details
func GetResource ¶
GetResource fetches a resource from database using table and key
func GetSingleSystem ¶
GetSingleSystem retrieves specific compute system in odimra based on the ID
func GetSliceFromString ¶
GetSliceFromString is to convert the string to array
func GetUndeliveredEvents ¶
GetUndeliveredEvents read the undelivered events for the destination
func GetUndeliveredEventsFlag ¶
GetUndeliveredEventsFlag will get the flag to maintain one instance already picked up the undelivered events for the destination
func GetUndeliveredEventsKeyList ¶
func GetUndeliveredEventsKeyList(table, pattern string, dbType common.DbType, nextCursor int) ([]string, int, *errors.Error)
GetUndeliveredEventsKeyList accepts the table name ,pattern ,cursor value and DB type and return all the keys which matches the pattern
func SaveAggregateSubscription ¶
SaveAggregateSubscription is to save subscription details of device
func SaveDeviceSubscription ¶
func SaveDeviceSubscription(devSubscription common.DeviceSubscription) error
SaveDeviceSubscription is to save subscription details of device
func SaveEventSubscription ¶
func SaveEventSubscription(evtSubscription SubscriptionResource) error
SaveEventSubscription is to save event subscription details in db
func SaveUndeliveredEvents ¶
SaveUndeliveredEvents accepts the undelivered event and destination with unique eventId and saves it
func SetUndeliveredEventsFlag ¶
SetUndeliveredEventsFlag will set the flag to maintain one instance already picked up the undelivered events for the destination
func UpdateAggregateHosts ¶
UpdateAggregateHosts is to update aggregate hosts details of device
func UpdateDeviceSubscriptionLocation ¶
func UpdateDeviceSubscriptionLocation(devSubscription common.DeviceSubscription) error
UpdateDeviceSubscriptionLocation is to update subscription details of device
func UpdateEventSubscription ¶
func UpdateEventSubscription(evtSubscription SubscriptionResource) error
UpdateEventSubscription is to update event subscription details
Types ¶
type Aggregate ¶
Aggregate is the model for Aggregate information
func GetAggregate ¶
GetAggregate fetches the aggregate info for the given aggregateURI
func GetAggregateData ¶
GetAggregateData will fetch aggregate details
type EventPost ¶
type EventPost struct { Destination string EventID string UndeliveredEventID string Message []byte }
EventPost is the model for post data to client
type Fabric ¶
Fabric is the model for fabrics information
func GetFabricData ¶
GetFabricData will fetch fabric details
type PluginTaskInfo ¶
PluginTaskInfo hold the task information from plugin
type SubscriptionResource ¶
type SubscriptionResource struct { EventDestination *dmtf.EventDestination `json:"EventDestination"` EventHostIP string `json:"EventHostIP,omitempty"` Hosts []string `json:"Hosts"` SubscriptionID string `json:"SubscriptionID"` UserName string `json:"UserName"` Location string `json:"location,omitempty"` }
SubscriptionResource is a model to store the subscription details
func GetEvtSubscriptions ¶
func GetEvtSubscriptions(searchKey string) ([]SubscriptionResource, error)
GetEvtSubscriptions is to get event subscription details