Documentation ¶
Overview ¶
Package inventory contains implementation of aws:softwareInventory plugin
Index ¶
- func ConvertToCurrentAssociationsMap(input []*associateModel.InstanceAssociation) (currentAssociations map[string]string)
- func Name() string
- func RefreshLastTrackedAssociationExecutions(oldTrackedExecutions, currentAssociations map[string]string) (newTrackedExecutions map[string]string)
- type Plugin
- func (p *Plugin) ApplyInventoryPolicy(context context.T, inventoryInput PluginInput) (inventoryOutput contracts.PluginOutput)
- func (p *Plugin) CanGathererRun(context context.T, name string) (status bool, gatherer gatherers.T, err error)
- func (p *Plugin) Execute(context context.T, config contracts.Configuration, cancelFlag task.CancelFlag, ...) (res contracts.PluginResult)
- func (p *Plugin) IsInventoryBeingInvokedAsAssociation(fileName string) (status bool, err error)
- func (p *Plugin) IsMulitpleAssociationPresent(currentAssociationID string) (status bool, otherAssociationID string)
- func (p *Plugin) ParseAssociationIdFromFileName(input string) string
- func (p *Plugin) RunGatherers(gatherers map[gatherers.T]model.Config) (items []model.Item, err error)
- func (p *Plugin) SendDataToInventory(context context.T, items []*ssm.InventoryItem) (status, retryWithFullData bool)
- func (p *Plugin) ValidateInventoryInput(context context.T, input PluginInput) (configuredGatherers map[gatherers.T]model.Config, err error)
- func (p *Plugin) VerifyInventoryDataSize(item model.Item, items []model.Item) bool
- type PluginInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToCurrentAssociationsMap ¶
func ConvertToCurrentAssociationsMap(input []*associateModel.InstanceAssociation) (currentAssociations map[string]string)
ConvertToCurrentAssociationsMap converts a list of current association to a map of association.
Types ¶
type Plugin ¶
type Plugin struct { pluginutil.DefaultPlugin // contains filtered or unexported fields }
Plugin encapsulates the logic of configuring, starting and stopping inventory plugin
func NewPlugin ¶
func NewPlugin(context context.T, pluginConfig pluginutil.PluginConfig) (*Plugin, error)
NewPlugin creates a new inventory worker plugin.
func (*Plugin) ApplyInventoryPolicy ¶
func (p *Plugin) ApplyInventoryPolicy(context context.T, inventoryInput PluginInput) (inventoryOutput contracts.PluginOutput)
ApplyInventoryPolicy applies given inventory policy regarding which gatherers to run
func (*Plugin) CanGathererRun ¶
func (p *Plugin) CanGathererRun(context context.T, name string) (status bool, gatherer gatherers.T, err error)
CanGathererRun returns true if the gatherer can run on given OS, else it returns false. It throws error if the gatherer is not recognized.
func (*Plugin) Execute ¶
func (p *Plugin) Execute(context context.T, config contracts.Configuration, cancelFlag task.CancelFlag, subDocumentRunner runpluginutil.PluginRunner) (res contracts.PluginResult)
Execute runs the inventory plugin
func (*Plugin) IsInventoryBeingInvokedAsAssociation ¶
IsInventoryBeingInvokedAsAssociation returns true if inventory plugin is invoked via ssm-associate or else it returns false. It throws error if the detection itself fails
func (*Plugin) IsMulitpleAssociationPresent ¶
func (p *Plugin) IsMulitpleAssociationPresent(currentAssociationID string) (status bool, otherAssociationID string)
IsMulitpleAssociationPresent returns true if there are multiple associations for inventory plugin else it returns false. It also refreshes map of tracked association executions accordingly.
func (*Plugin) ParseAssociationIdFromFileName ¶
ParseAssociationIdFromFileName parses associationID from the given input NOTE: Input will be of format - AssociationID.RunID -> as per the format of bookkeepingfilename for associate documents
func (*Plugin) RunGatherers ¶
func (p *Plugin) RunGatherers(gatherers map[gatherers.T]model.Config) (items []model.Item, err error)
RunGatherers execute given array of gatherers and accordingly returns. It returns error if gatherer is not registered or if at any stage the data returned breaches size limit
func (*Plugin) SendDataToInventory ¶
func (p *Plugin) SendDataToInventory(context context.T, items []*ssm.InventoryItem) (status, retryWithFullData bool)
SendDataToInventory sends data to SSM and returns if data was sent successfully or not. If data is not uploaded successfully, it parses the error message and determines if it should be sent again.
func (*Plugin) ValidateInventoryInput ¶
func (p *Plugin) ValidateInventoryInput(context context.T, input PluginInput) (configuredGatherers map[gatherers.T]model.Config, err error)
ValidateInventoryInput validates inventory input and returns a map of eligible gatherers & their corresponding config. It throws an error if gatherer is not recognized/installed.
type PluginInput ¶
type PluginInput struct { contracts.PluginInput Applications string AWSComponents string NetworkConfig string WindowsUpdates string CustomInventory string CustomInventoryDirectory string }
PluginInput represents configuration which is applied to inventory plugin during execution.
Directories ¶
Path | Synopsis |
---|---|
Package datauploader contains routines upload inventory data to SSM - Inventory service
|
Package datauploader contains routines upload inventory data to SSM - Inventory service |
Package gatherers contains routines for different types of inventory gatherers
|
Package gatherers contains routines for different types of inventory gatherers |
application
Package application contains a application gatherer.
|
Package application contains a application gatherer. |
awscomponent
Package awscomponent contains a aws component gatherer.
|
Package awscomponent contains a aws component gatherer. |
custom
Package custom contains a gatherer for collecting custom inventory items
|
Package custom contains a gatherer for collecting custom inventory items |
network
Package network contains a network gatherer.
|
Package network contains a network gatherer. |
Package model contains contracts for inventory
|
Package model contains contracts for inventory |