Documentation ¶
Overview ¶
Package datauploader contains routines upload inventory data to SSM - Inventory service
Package datauploader contains routines upload inventory data to SSM - Inventory service ¶
Package datauploader contains routines upload inventory data to SSM - Inventory service
Index ¶
- Constants
- func ConvertToMap(input interface{}) (res map[string]*string)
- func ConvertToSSMInventoryItem(item model.Item) (inventoryItem *ssm.InventoryItem, err error)
- type Impl
- type InventoryUploader
- func (u *InventoryUploader) ConvertToSsmInventoryItems(items []model.Item) (optimizedInventoryItems, nonOptimizedInventoryItems []*ssm.InventoryItem, ...)
- func (u InventoryUploader) GetDirtySsmInventoryItems(items []model.Item) (dirtyInventoryItems []*ssm.InventoryItem, err error)
- func (u *InventoryUploader) SendDataToSSM(items []*ssm.InventoryItem) (err error)
- type Optimizer
- type SSMCaller
- type T
Constants ¶
const ( // Name represents name of this component that uploads data to SSM Name = "InventoryUploader" // The maximum time window range for random back off before call PutInventory API Max_Time_TO_Back_Off = 30 )
Variables ¶
This section is empty.
Functions ¶
func ConvertToMap ¶
ConvertToMap converts given object to map[string]*string
func ConvertToSSMInventoryItem ¶
func ConvertToSSMInventoryItem(item model.Item) (inventoryItem *ssm.InventoryItem, err error)
ConvertToSSMInventoryItem converts given InventoryItem to []map[string]*string
Types ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
Impl implements content hash optimizations for inventory plugin
func (*Impl) GetContentHash ¶
func (*Impl) UpdateContentHash ¶
type InventoryUploader ¶
type InventoryUploader struct {
// contains filtered or unexported fields
}
InventoryUploader implements functionality to upload data to SSM Inventory.
func NewInventoryUploader ¶
func NewInventoryUploader(context context.T) (*InventoryUploader, error)
NewInventoryUploader creates a new InventoryUploader (which sends data to SSM Inventory)
func (*InventoryUploader) ConvertToSsmInventoryItems ¶
func (u *InventoryUploader) ConvertToSsmInventoryItems(items []model.Item) (optimizedInventoryItems, nonOptimizedInventoryItems []*ssm.InventoryItem, err error)
ConvertToSsmInventoryItems converts given array of inventory.Item into an array of *ssm.InventoryItem. It returns 2 such arrays - one is optimized array which contains only contentHash for those inventory types where the dataset hasn't changed from previous collection. The other array is non-optimized array which contains both contentHash & content. This is done to avoid iterating over the inventory data twice. It throws error when it encounters error during conversion process.
func (InventoryUploader) GetDirtySsmInventoryItems ¶
func (u InventoryUploader) GetDirtySsmInventoryItems(items []model.Item) (dirtyInventoryItems []*ssm.InventoryItem, err error)
GetDirtySsmInventoryItems get the inventory item data for items that have changes since last successful report to SSM.
func (*InventoryUploader) SendDataToSSM ¶
func (u *InventoryUploader) SendDataToSSM(items []*ssm.InventoryItem) (err error)
SendDataToSSM uploads given inventory items to SSM
type Optimizer ¶
type Optimizer interface { UpdateContentHash(inventoryItemName, hash string) (err error) GetContentHash(inventoryItemName string) (hash string) }
Optimizer defines operations of content optimizer which inventory plugin makes use of
type SSMCaller ¶
type SSMCaller interface {
PutInventory(input *ssm.PutInventoryInput) (output *ssm.PutInventoryOutput, err error)
}
type T ¶
type T interface { SendDataToSSM(items []*ssm.InventoryItem) (err error) ConvertToSsmInventoryItems(items []model.Item) (optimizedInventoryItems, nonOptimizedInventoryItems []*ssm.InventoryItem, err error) GetDirtySsmInventoryItems(items []model.Item) (dirtyInventoryItems []*ssm.InventoryItem, err error) }
T represents contracts for SSM Inventory data uploader