Documentation ¶
Overview ¶
Package system ...
Package system ...
Package system ...
Package system ...
Package system ...
Package system ...
Index ¶
- Constants
- Variables
- func CreateDefaultEventSubscription(ctx context.Context, systemID []string)
- func PerformPluginHealthCheck()
- func PublishEvent(ctx context.Context, systemIDs []string, collectionName string)
- func PublishPluginStatusOKEvent(ctx context.Context, plugin string, msgQueues []string)
- func PushPluginStartUpData(ctx context.Context, plugin agmodel.Plugin, ...) error
- func SendPluginStartUpData(ctx context.Context, pluginIP string, plugin agmodel.Plugin) error
- func UpdateTaskData(ctx context.Context, taskData common.TaskData) error
- type ActiveRequestsSet
- type AddResourceRequest
- type AggregationResetRequest
- type AggregationSetDefaultBootOrderRequest
- type AggregationSource
- type ConnectionMethod
- type Device
- type ExternalInterface
- func (e *ExternalInterface) AddAggregationSource(ctx context.Context, taskID string, sessionUserName string, ...) response.RPC
- func (e *ExternalInterface) AddElementsToAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) CreateAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) DeleteAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) DeleteAggregationSource(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) DeleteAggregationSources(ctx context.Context, taskID string, targetURI string, ...) error
- func (e *ExternalInterface) GetAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) GetAggregationSource(ctx context.Context, reqURI string) response.RPC
- func (e *ExternalInterface) GetAggregationSourceCollection(ctx context.Context) response.RPC
- func (e *ExternalInterface) GetAllAggregates(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) GetAllConnectionMethods(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) GetConnectionMethodInfo(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) RediscoverResources() error
- func (e *ExternalInterface) RediscoverSystemInventory(ctx context.Context, deviceUUID, systemURL string, updateFlag bool)
- func (e *ExternalInterface) RemoveElementsFromAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) Reset(ctx context.Context, taskID string, sessionUserName string, ...) response.RPC
- func (e *ExternalInterface) ResetElementsOfAggregate(ctx context.Context, taskID string, sessionUserName string, ...) response.RPC
- func (e *ExternalInterface) SendStartUpData(ctx context.Context, startUpReq *aggregatorproto.SendStartUpDataRequest) response.RPC
- func (e *ExternalInterface) SetDefaultBootOrder(ctx context.Context, taskID string, sessionUserName string, ...) response.RPC
- func (e *ExternalInterface) SetDefaultBootOrderElementsOfAggregate(ctx context.Context, taskID string, sessionUserName string, ...) response.RPC
- func (e *ExternalInterface) UpdateAggregationSource(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
- func (e *ExternalInterface) UpdateSystemState(ctx context.Context, updateReq *aggregatorproto.UpdateSystemStateRequest) error
- type Links
- type OdataID
- type ResetRequest
- type TaskData
- type WildCard
Constants ¶
const ( // SystemUUID is used to replace with system id in wildcard property SystemUUID = "SystemID" // ChassisUUID is used to replace with chassis id in wildcard property ChassisUUID = "ChassisID" // ManagersTable is used to replace with table id Managers ManagersTable = "Managers" // PluginTable is used to replace with table id PluginTable PluginTable = "Plugin" //LogServiceCollection is used to replace with table id LogServicesCollection LogServiceCollection = "LogServicesCollection" //LogServices is used to replace with table id LogServices LogServices = "LogServices" //EntriesCollection is used to replace with table id EntriesCollection EntriesCollection = "EntriesCollection" )
const ( PluginHealthCheckActionID = "216" PluginHealthCheckActionName = "PluginHealthCheck" )
const ( RediscoverResourcesActionID = "217" RediscoverResourcesActionName = "RediscoverResources" )
Variables ¶
var ( //UpdateSubscription ... UpdateSubscription = updateSubscription //RemoveSubscription ... RemoveSubscription = removeSubscription //DeleteAggregateSubscription ... DeleteAggregateSubscription = deleteAggregateSubscription )
var ( // GetAllPluginfunc function pointer for the agcommon.GetAllPlugins GetAllPluginfunc = agcommon.GetAllPlugins // LookupPlugin function pointer for the agcommon.LookupPlugin LookupPlugin = agcommon.LookupPlugin // DecryptWithPrivateKey function pointer for the agcommon.DecryptWithPrivateKey DecryptWithPrivateKey = common.DecryptWithPrivateKey // GetPluginStatusRecord function pointer for the agcommon.GetPluginStatusRecord GetPluginStatusRecord = agcommon.GetPluginStatusRecord )
Functions ¶
func CreateDefaultEventSubscription ¶
CreateDefaultEventSubscription will create default events subscriptions
func PerformPluginHealthCheck ¶
func PerformPluginHealthCheck()
PerformPluginHealthCheck is for checking the status of all the plugins continuously over a configured interval
func PublishEvent ¶
PublishEvent will publish default events
func PublishPluginStatusOKEvent ¶
PublishPluginStatusOKEvent is for notifying active status of a plugin and indicating to resubscribe the EMB of the plugin
func PushPluginStartUpData ¶
func PushPluginStartUpData(ctx context.Context, plugin agmodel.Plugin, startUpData *agmodel.PluginStartUpData) error
PushPluginStartUpData is for sending the plugin startup data when the plugin starts or when a server is added or deleted
func SendPluginStartUpData ¶
SendPluginStartUpData is for sending the plugin startup data when the plugin requests through an event
Types ¶
type ActiveRequestsSet ¶
type ActiveRequestsSet struct { // ReqRecord holds data of ongoing requests ReqRecord map[string]interface{} // UpdateMu is the mutex for protecting OngoingReqs UpdateMu sync.Mutex }
ActiveRequestsSet holds details of ongoing requests
type AddResourceRequest ¶
type AddResourceRequest struct { ManagerAddress string `json:"ManagerAddress"` UserName string `json:"UserName"` Password string `json:"Password"` ConnectionMethod *ConnectionMethod `json:"ConnectionMethod"` }
AddResourceRequest is payload of adding a resource
type AggregationResetRequest ¶
type AggregationResetRequest struct { BatchSize int `json:"BatchSize"` DelayBetweenBatchesInSeconds int `json:"DelayBetweenBatchesInSeconds"` ResetType string `json:"ResetType"` TargetURIs []string `json:"TargetURIs"` }
AggregationResetRequest struct for reset the BMC
type AggregationSetDefaultBootOrderRequest ¶
type AggregationSetDefaultBootOrderRequest struct {
Systems []OdataID `json:"Systems"`
}
AggregationSetDefaultBootOrderRequest struct for set default boot order the BMC
type AggregationSource ¶
type AggregationSource struct { HostName string `json:"HostName"` UserName string `json:"UserName"` Password string `json:"Password"` Links *Links `json:"Links,omitempty"` }
AggregationSource payload of adding a AggregationSource
type ConnectionMethod ¶
type ConnectionMethod struct {
OdataID string `json:"@odata.id"`
}
ConnectionMethod struct definition for @odata.id
type Device ¶
type Device struct { ServerIP string `json:"ServerIP"` Username string `json:"Username"` DeviceUUID string `json:"device_UUID"` }
Device struct to define the response from plugin for UUID
type ExternalInterface ¶
type ExternalInterface struct { ContactClient func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error) Auth func(string, []string, []string) (response.RPC, error) GetSessionUserName func(string) (string, error) CreateChildTask func(context.Context, string, string) (string, error) CreateTask func(context.Context, string) (string, error) UpdateTask func(context.Context, common.TaskData) error CreateSubcription func(context.Context, []string) PublishEvent func(context.Context, []string, string) PublishEventMB func(context.Context, string, string, string) GetPluginStatus func(context.Context, agmodel.Plugin) bool SubscribeToEMB func(string, []string) error EncryptPassword func([]byte) ([]byte, error) DecryptPassword func([]byte) ([]byte, error) DeleteComputeSystem func(int, string) *errors.Error DeleteSystem func(string) *errors.Error DeleteEventSubscription func(string) (*eventsproto.EventSubResponse, error) EventNotification func(context.Context, string, string, string) GetAllKeysFromTable func(string) ([]string, error) GetConnectionMethod func(string) (agmodel.ConnectionMethod, *errors.Error) UpdateConnectionMethod func(agmodel.ConnectionMethod, string) *errors.Error GetPluginMgrAddr func(string) (agmodel.Plugin, *errors.Error) GetAggregationSourceInfo func(string) (agmodel.AggregationSource, *errors.Error) GenericSave func([]byte, string, string) error CheckActiveRequest func(string) (bool, *errors.Error) DeleteActiveRequest func(string) *errors.Error GetAllMatchingDetails func(string, string, common.DbType) ([]string, *errors.Error) CheckMetricRequest func(string) (bool, *errors.Error) DeleteMetricRequest func(string) *errors.Error GetResource func(string, string) (string, *errors.Error) Delete func(string, string, common.DbType) *errors.Error }
ExternalInterface struct holds the function pointers all outboud services
func (*ExternalInterface) AddAggregationSource ¶
func (e *ExternalInterface) AddAggregationSource(ctx context.Context, taskID string, sessionUserName string, req *aggregatorproto.AggregatorRequest) response.RPC
AddAggregationSource is the handler for adding bmc or manager Discovers its top level odata.ID links and store them in inmemory db. Upon successfull operation this api returns added AggregationSourceUUID in the response body with 201 OK.
func (*ExternalInterface) AddElementsToAggregate ¶
func (e *ExternalInterface) AddElementsToAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
AddElementsToAggregate is the handler for adding elements to an aggregate
func (*ExternalInterface) CreateAggregate ¶
func (e *ExternalInterface) CreateAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
CreateAggregate is the handler for cr/snap/code/103/usr/share/code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.htmleating an aggregate check if the elelments/resources added into odimra if not then return an error. else add an entry of an aggregayte in db
func (*ExternalInterface) DeleteAggregate ¶
func (e *ExternalInterface) DeleteAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
DeleteAggregate is the handler for deleting an aggregate if the aggregate id is present then delete from the db else return an error.
func (*ExternalInterface) DeleteAggregationSource ¶
func (e *ExternalInterface) DeleteAggregationSource(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
DeleteAggregationSource is the handler for removing bmc or manager
func (*ExternalInterface) DeleteAggregationSources ¶
func (e *ExternalInterface) DeleteAggregationSources(ctx context.Context, taskID string, targetURI string, req *aggregatorproto.AggregatorRequest) error
DeleteAggregationSources is used to delete aggregation sources
func (*ExternalInterface) GetAggregate ¶
func (e *ExternalInterface) GetAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
GetAggregate is the handler for getting an aggregate if the aggregate id is present then return aggregate details else return an error.
func (*ExternalInterface) GetAggregationSource ¶
GetAggregationSource is used to fetch the AggregationSource with given aggregation source uri and returns AggregationSource
func (*ExternalInterface) GetAggregationSourceCollection ¶
func (e *ExternalInterface) GetAggregationSourceCollection(ctx context.Context) response.RPC
GetAggregationSourceCollection is to fetch all the AggregationSourceURI uri's and returns with created collection of AggregationSource data from odim
func (*ExternalInterface) GetAllAggregates ¶
func (e *ExternalInterface) GetAllAggregates(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
GetAllAggregates is the handler for getting collection of aggregates
func (*ExternalInterface) GetAllConnectionMethods ¶
func (e *ExternalInterface) GetAllConnectionMethods(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
GetAllConnectionMethods is the handler for getting the connection methods collection
func (*ExternalInterface) GetConnectionMethodInfo ¶
func (e *ExternalInterface) GetConnectionMethodInfo(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
GetConnectionMethodInfo is the handler for getting the connection method
func (*ExternalInterface) RediscoverResources ¶
func (e *ExternalInterface) RediscoverResources() error
RediscoverResources is a function to rediscover the server inventory, in the event of InMemory DB crashed and/or rebooted all of the content/inventory in the Inmemory DB is gone. So to repopulate the inventory of all the added server, this function can be used. Takes: None Returns: error On success nil On Failure Non nil
func (*ExternalInterface) RediscoverSystemInventory ¶
func (e *ExternalInterface) RediscoverSystemInventory(ctx context.Context, deviceUUID, systemURL string, updateFlag bool)
RediscoverSystemInventory is the handler for redicovering system whenever the restrat event detected in event service It deletes old data and Discovers Computersystem & Chassis and its top level odata.ID links and store them in inmemory db.
func (*ExternalInterface) RemoveElementsFromAggregate ¶
func (e *ExternalInterface) RemoveElementsFromAggregate(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
RemoveElementsFromAggregate is the handler for removing elements from an aggregate
func (*ExternalInterface) Reset ¶
func (e *ExternalInterface) Reset(ctx context.Context, taskID string, sessionUserName string, req *aggregatorproto.AggregatorRequest) response.RPC
Reset is for reseting the computer systems mentioned in the request body
func (*ExternalInterface) ResetElementsOfAggregate ¶
func (e *ExternalInterface) ResetElementsOfAggregate(ctx context.Context, taskID string, sessionUserName string, req *aggregatorproto.AggregatorRequest) response.RPC
ResetElementsOfAggregate is the handler for reseting elements of an aggregate
func (*ExternalInterface) SendStartUpData ¶
func (e *ExternalInterface) SendStartUpData(ctx context.Context, startUpReq *aggregatorproto.SendStartUpDataRequest) response.RPC
SendStartUpData is for sending plugin start up data
func (*ExternalInterface) SetDefaultBootOrder ¶
func (e *ExternalInterface) SetDefaultBootOrder(ctx context.Context, taskID string, sessionUserName string, req *aggregatorproto.AggregatorRequest) response.RPC
SetDefaultBootOrder defines the logic for setting the boot order to the default
func (*ExternalInterface) SetDefaultBootOrderElementsOfAggregate ¶
func (e *ExternalInterface) SetDefaultBootOrderElementsOfAggregate(ctx context.Context, taskID string, sessionUserName string, req *aggregatorproto.AggregatorRequest) response.RPC
SetDefaultBootOrderElementsOfAggregate is the handler for set default boot order elements of an aggregate
func (*ExternalInterface) UpdateAggregationSource ¶
func (e *ExternalInterface) UpdateAggregationSource(ctx context.Context, req *aggregatorproto.AggregatorRequest) response.RPC
UpdateAggregationSource defines the interface for updation of added Aggregation Source
func (*ExternalInterface) UpdateSystemState ¶
func (e *ExternalInterface) UpdateSystemState(ctx context.Context, updateReq *aggregatorproto.UpdateSystemStateRequest) error
UpdateSystemState is used for updating ComputerSystem table and also the server search index, if required.
type Links ¶
type Links struct {
ConnectionMethod *ConnectionMethod `json:"ConnectionMethod,omitempty"`
}
Links holds information of Oem
type OdataID ¶
type OdataID struct {
OdataID string `json:"@odata.id"`
}
OdataID struct definition for @odata.id
type ResetRequest ¶
type ResetRequest struct { BatchSize int `json:"BatchSize"` DelayBetweenBatchesInSeconds int `json:"DelayBetweenBatchesInSeconds"` ResetType string `json:"ResetType"` }
ResetRequest is struct for reset of elements of an aggregate