inventory

package
v0.0.0-...-7638cb1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package inventory contains implementation of aws:softwareInventory plugin

Index

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.

func Name

func Name() string

Name returns the plugin name

func RefreshLastTrackedAssociationExecutions

func RefreshLastTrackedAssociationExecutions(oldTrackedExecutions, currentAssociations map[string]string) (newTrackedExecutions map[string]string)

RefreshLastTrackedAssociationExecutions refreshes map of tracked association executions.

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

func (p *Plugin) IsInventoryBeingInvokedAsAssociation(fileName string) (status bool, err error)

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

func (p *Plugin) ParseAssociationIdFromFileName(input string) string

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.

func (*Plugin) VerifyInventoryDataSize

func (p *Plugin) VerifyInventoryDataSize(item model.Item, items []model.Item) bool

VerifyInventoryDataSize returns true if size of collected inventory data is within size restrictions placed by SSM, else false.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL