Documentation ¶
Overview ¶
Package agmodel ...
Index ¶
- func AddAggregateHostIndex(uuid string, hostIP []string) error
- func AddAggregationSource(req AggregationSource, aggregationSourceURI string) *errors.Error
- func AddConnectionMethod(connectionMethod ConnectionMethod, connectionMethodURI string) *errors.Error
- func AddElementsToAggregate(aggregate Aggregate, aggregateURL string) *errors.Error
- func AddNewHostToAggregateHostIndex(aggregateID string, hostIP string) error
- func AddSystemResetInfo(systemID, resetType string) *errors.Error
- func CheckActiveRequest(key string) (bool, *errors.Error)
- func CheckMetricRequest(key string) (bool, *errors.Error)
- func CreateAggregate(aggregate Aggregate, aggregateURI string) *errors.Error
- func Delete(table, key string, dbtype common.DbType) *errors.Error
- func DeleteActiveRequest(key string) *errors.Error
- func DeleteAggregate(key string) *errors.Error
- func DeleteAggregateHostIndex(uuid string) error
- func DeleteAggregationSource(aggregtionSourceURI string) *errors.Error
- func DeleteComputeSystem(index int, key string) *errors.Error
- func DeleteManagersData(key, table string) *errors.Error
- func DeleteMetricRequest(key string) *errors.Error
- func DeletePluginData(key, table string) *errors.Error
- func DeleteSystem(key string) *errors.Error
- func DeleteSystemOperationInfo(systemURI string) *errors.Error
- func DeleteSystemResetInfo(systemURI string) *errors.Error
- func GenericSave(body []byte, table string, key string) error
- func GetAllKeysFromTable(table string) ([]string, error)
- func GetAllMatchingDetails(table, pattern string, dbtype common.DbType) ([]string, *errors.Error)
- func GetComputeSystem(ctx context.Context, deviceUUID string) (dmtfmodel.ComputerSystem, error)
- func GetComputerSystem(systemid string) (string, *errors.Error)
- func GetDeviceSubscriptions(hostIP string) (*common.DeviceSubscription, error)
- func GetEventSubscriptions(key string) ([]string, error)
- func GetRegistryFile(Table, key string) (string, *errors.Error)
- func GetResource(Table, key string) (string, *errors.Error)
- func GetResourceDetails(key string) (string, *errors.Error)
- func GetString(index, match string) ([]string, error)
- func GetSystemResetInfo(systemURI string) (map[string]string, *errors.Error)
- func RemoveElementsFromAggregate(aggregate Aggregate, aggregateURL string) *errors.Error
- func RemoveNewIPToAggregateHostIndex(aggregateID string, hostIP string) error
- func SaveBMCInventory(data map[string]interface{}) error
- func SaveChassis(ctx context.Context, chassis dmtfmodel.Chassis, deviceUUID string) error
- func SaveComputeSystem(ctx context.Context, computeServer dmtfmodel.ComputerSystem, deviceUUID string) error
- func SaveIndex(searchForm map[string]interface{}, table, uuid, bmcAddress string) error
- func SavePluginData(plugin Plugin) *errors.Error
- func SavePluginManagerInfo(body []byte, table string, key string) error
- func SaveRegistryFile(ctx context.Context, body []byte, table string, key string) error
- func UpdateAggregtionSource(aggregationSource AggregationSource, key string) *errors.Error
- func UpdateComputeSystem(key string, computeData interface{}) error
- func UpdateConnectionMethod(connectionMethod ConnectionMethod, key string) *errors.Error
- func UpdateDeviceSubscription(devSubscription common.DeviceSubscription) error
- func UpdateIndex(searchForm map[string]interface{}, table, uuid, bmcAddress string) error
- func UpdatePluginData(plugin Plugin, key string) *errors.Error
- func UpdateSystemData(system SaveSystem, key string) *errors.Error
- type Aggregate
- type AggregationSource
- type ConnectionMethod
- type DeviceData
- type EventSubscriptionInfo
- type Links
- type OdataID
- type Plugin
- type PluginContactRequest
- type PluginStartUpData
- type SNMP
- type SaveSystem
- type Schema
- type ServerInfo
- type SystemOperation
- type Target
- type TriggerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAggregateHostIndex ¶
AddAggregateHostIndex add aggregate hosts
func AddAggregationSource ¶
func AddAggregationSource(req AggregationSource, aggregationSourceURI string) *errors.Error
AddAggregationSource connects to the persistencemgr and Add the AggregationSource to db
Inputs:
1.req: AggregationSource info 2.aggregationSourceURI : uri of AggregationSource
func AddConnectionMethod ¶
func AddConnectionMethod(connectionMethod ConnectionMethod, connectionMethodURI string) *errors.Error
AddConnectionMethod will add connection methods on disk
func AddElementsToAggregate ¶
AddElementsToAggregate add elements to the aggregate
func AddNewHostToAggregateHostIndex ¶
AddNewHostToAggregateHostIndex add aggregate hosts
func AddSystemResetInfo ¶
AddSystemResetInfo connects to the persistencemgr and Add the system reset info to db
Inputs:
1.systemURI: computer system uri for which system operation is maintained 2.resetType : reset type which is performed
func CheckActiveRequest ¶
CheckActiveRequest will check the DB to see whether there are any active requests for the given key It will return true if there is an active request or false if not It will also through an error if any DB connection issues arise
func CheckMetricRequest ¶
CheckMetricRequest will check the DB to see whether there are any active requests for the given key It will return true if there is an active request or false if not It will also through an error if any DB connection issues arise
func CreateAggregate ¶
CreateAggregate will create aggregate on disk
func DeleteActiveRequest ¶
DeleteActiveRequest deletes the active request key from the DB, return error if any
func DeleteAggregate ¶
DeleteAggregate will delete the aggregate
func DeleteAggregateHostIndex ¶
DeleteAggregateHostIndex delete aggregate from aggregatehostsIndex table
func DeleteAggregationSource ¶
DeleteAggregationSource will delete the AggregationSource entry from the database based on the aggregtionSourceURI
func DeleteComputeSystem ¶
DeleteComputeSystem will delete the compute system
func DeleteManagersData ¶
DeleteManagersData will delete the table entry from the database based on the uuid
func DeleteMetricRequest ¶
DeleteMetricRequest deletes the active request key from the DB, return error if any
func DeletePluginData ¶
DeletePluginData will delete the plugin entry from the database based on the uuid
func DeleteSystem ¶
DeleteSystem will delete the system from OnDisk
func DeleteSystemOperationInfo ¶
DeleteSystemOperationInfo will delete the system operation entry from the database based on the systemURI
func DeleteSystemResetInfo ¶
DeleteSystemResetInfo will delete the system reset entry from the database based on the systemURI
func GenericSave ¶
GenericSave will save any resource data into the database
func GetAllKeysFromTable ¶
GetAllKeysFromTable retrun all matching data give table name
func GetAllMatchingDetails ¶
GetAllMatchingDetails accepts the table name ,pattern and DB type and return all the keys which mathces the pattern
func GetComputeSystem ¶
GetComputeSystem will fetch the compute resource details
func GetComputerSystem ¶
GetComputerSystem fetches computer system details by UUID from database
func GetDeviceSubscriptions ¶
func GetDeviceSubscriptions(hostIP string) (*common.DeviceSubscription, error)
GetDeviceSubscriptions is to get subscription details of device
func GetEventSubscriptions ¶
GetEventSubscriptions is for getting the event subscription details
func GetRegistryFile ¶
GetRegistryFile from InMemory DB
func GetResource ¶
GetResource fetches a resource from database using table and key
func GetResourceDetails ¶
GetResourceDetails fetches a resource from database using key
func GetString ¶
GetString is used to retrive index values of type string
Inputs:
1. index is the index name to search with 2. match is the value to match with
func GetSystemResetInfo ¶
GetSystemResetInfo fetches the system reset info for the given systemURI
Inputs:
1.systemURI: computer system uri for which system operation is maintained
func RemoveElementsFromAggregate ¶
RemoveElementsFromAggregate remove elements from an aggregate
func RemoveNewIPToAggregateHostIndex ¶
RemoveNewIPToAggregateHostIndex remove existing host ip from aggregate
func SaveBMCInventory ¶
SaveBMCInventory function save all bmc inventory data togeter using the transaction model
func SaveChassis ¶
SaveChassis will save the chassis details into the database
func SaveComputeSystem ¶
func SaveComputeSystem(ctx context.Context, computeServer dmtfmodel.ComputerSystem, deviceUUID string) error
SaveComputeSystem will save the compute server complete details into the database
func SavePluginData ¶
SavePluginData will saves plugin on disk
func SavePluginManagerInfo ¶
SavePluginManagerInfo will save plugin manager data into the database
func SaveRegistryFile ¶
SaveRegistryFile will save any Registry file in database OnDisk DB
func UpdateAggregtionSource ¶
func UpdateAggregtionSource(aggregationSource AggregationSource, key string) *errors.Error
UpdateAggregtionSource updates the aggregation details
func UpdateComputeSystem ¶
UpdateComputeSystem is used for updating ComputerSystem table
func UpdateConnectionMethod ¶
func UpdateConnectionMethod(connectionMethod ConnectionMethod, key string) *errors.Error
UpdateConnectionMethod updates the Connection Method details
func UpdateDeviceSubscription ¶
func UpdateDeviceSubscription(devSubscription common.DeviceSubscription) error
UpdateDeviceSubscription is to update subscription details of device
func UpdateIndex ¶
UpdateIndex is used for updating an existing index
func UpdatePluginData ¶
UpdatePluginData updates the plugin details
func UpdateSystemData ¶
func UpdateSystemData(system SaveSystem, key string) *errors.Error
UpdateSystemData updates the bmc details
Types ¶
type Aggregate ¶
type Aggregate struct {
Elements []OdataID `json:"Elements"`
}
Aggregate payload is used for perform the operations on Aggregate
type AggregationSource ¶
type AggregationSource struct { HostName string `json:"HostName"` UserName string `json:"UserName,omitempty"` Password []byte `json:"Password,omitempty"` Links interface{} `json:"Links,omitempty"` ODataContext string `json:"@odata.context,omitempty"` ODataEtag string `json:"@odata.etag,omitempty"` ODataID string `json:"@odata.id"` ODataType string `json:"@odata.type"` Name string `json:"Name"` Actions *dmtfmodel.OemActions `json:"Actions,omitempty"` Description string `json:"Description,omitempty"` ID string `json:"Id"` Oem *dmtfmodel.Oem `json:"Oem,omitempty"` SNMP *SNMP `json:"SNMP,omitempty"` AggregationType string `json:"AggregationType,omitempty"` }
AggregationSource payload of adding a AggregationSource
func GetAggregationSourceInfo ¶
func GetAggregationSourceInfo(aggregationSourceURI string) (AggregationSource, *errors.Error)
GetAggregationSourceInfo fetches the AggregationSource info for the given aggregationSourceURI
type ConnectionMethod ¶
type ConnectionMethod struct { ConnectionMethodType string `json:"ConnectionMethodType"` ConnectionMethodVariant string `json:"ConnectionMethodVariant"` Links Links `json:"Links"` }
ConnectionMethod payload is used for perform the operations on connection method
func GetConnectionMethod ¶
func GetConnectionMethod(connectionMethodURI string) (ConnectionMethod, *errors.Error)
GetConnectionMethod fetches the connection method info for the given connection method uri
type DeviceData ¶
type DeviceData struct { UserName string Password []byte Address string Operation string EventSubscriptionInfo *EventSubscriptionInfo TriggerInfo *TriggerInfo }
DeviceData holds device credentials, event subcription and trigger details
type EventSubscriptionInfo ¶
EventSubscriptionInfo holds the event subscription details of a device
type Links ¶
type Links struct {
AggregationSources []OdataID `json:"AggregationSources"`
}
Links is payload of aggregation resources
type OdataID ¶
type OdataID struct {
OdataID string `json:"@odata.id"`
}
OdataID struct definition for @odata.id
type Plugin ¶
type Plugin struct { IP string Port string Username string Password []byte ID string PluginType string PreferredAuthType string ManagerUUID string }
Plugin is the model for plugin information
type PluginContactRequest ¶
type PluginContactRequest struct { URL string HTTPMethodType string ContactClient func(string, string, string, string, interface{}, map[string]string) (*http.Response, error) PostBody interface{} LoginCredential map[string]string Token string Plugin Plugin }
PluginContactRequest holds the details required to contact the plugin
type PluginStartUpData ¶
type PluginStartUpData struct { RequestType string ResyncEvtSubscription bool Devices map[string]DeviceData }
PluginStartUpData holds the required data for plugin startup
type SNMP ¶
type SNMP struct { AuthenticationKey string `json:"AuthenticationKey,omitempty"` AuthenticationKeySet string `json:"AuthenticationKeySet,omitempty"` AuthenticationProtocol string `json:"AuthenticationProtocol,omitempty"` EncryptionKey string `json:"EncryptionKey,omitempty"` EncryptionKeySet bool `json:"EncryptionKeySet,omitempty"` EncryptionProtocol string `json:"EncryptionProtocol,omitempty"` TrapCommunity string `json:"TrapCommunity,omitempty"` }
SNMP payload of adding a SNMP
type SaveSystem ¶
type SaveSystem struct { ManagerAddress string Password []byte UserName string DeviceUUID string PluginID string }
SaveSystem model is used to save encrypted data into db
type Schema ¶
type Schema struct { SearchKeys []map[string]map[string]string `json:"searchKeys"` ConditionKeys []string `json:"conditionKeys"` QueryKeys []string `json:"queryKeys"` }
Schema model is used to iterate throgh the schema json for search/filter
type SystemOperation ¶
type SystemOperation struct {
Operation string
}
SystemOperation hold the value system operation(InventoryRediscovery or Delete)
func GetSystemOperationInfo ¶
func GetSystemOperationInfo(systemURI string) (SystemOperation, *errors.Error)
GetSystemOperationInfo fetches the system opeation info for the given systemURI
Inputs:
1.systemURI: computer system uri for which system operation is maintained
func (*SystemOperation) AddSystemOperationInfo ¶
func (system *SystemOperation) AddSystemOperationInfo(systemID string) *errors.Error
AddSystemOperationInfo connects to the persistencemgr and Add the system operation info to db
Inputs:
1.systemURI: computer system uri for which system operation is maintained
type Target ¶
type Target struct { ManagerAddress string `json:"ManagerAddress"` Password []byte `json:"Password"` UserName string `json:"UserName"` PostBody []byte `json:"PostBody"` DeviceUUID string `json:"DeviceUUID"` PluginID string `json:"PluginID"` }
Target is for sending the requst to south bound/plugin
func GetAllSystems ¶
GetAllSystems extracts all the computer systems saved in ondisk
type TriggerInfo ¶
type TriggerInfo struct { }
TriggerInfo holds the metric trigger info of a device