model

package
v0.0.0-...-0117b6e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 32

Documentation

Overview

Package model contains contracts for inventory

Index

Constants

View Source
const (
	// AWSInstanceInformation is inventory type of instance information
	AWSInstanceInformation = "AWS:InstanceInformation"
	// Enabled represents constant string used to enable various components of inventory plugin
	Enabled = "Enabled"
	// ErrorThreshold represents error threshold for inventory plugin
	ErrorThreshold = 10
	// InventoryPolicyDocName represents name of inventory policy doc
	InventoryPolicyDocName = "policy.json"
	// SizeLimitKBPerInventoryType represents size limit in KB for 1 inventory data type
	// Bump up to 3MB for agent. We have more strict size limit rule in the micro service.
	SizeLimitKBPerInventoryType = 3072
	// TotalSizeLimitKB represents size limit in KB for 1 PutInventory API call
	TotalSizeLimitKB = 10240
	// Standard name for 64-bit architecture
	Arch64Bit = "x86_64"
	// Standard name for 32-bit architecture
	Arch32Bit = "i386"
)

Variables

This section is empty.

Functions

func FormatArchitecture

func FormatArchitecture(arch string) string

FormatArchitecture converts different architecture values to the standard inventory value

Types

type ApplicationData

type ApplicationData struct {
	Name            string
	Publisher       string
	Version         string
	Release         string `json:",omitempty"`
	Epoch           string `json:",omitempty"`
	InstalledTime   string `json:",omitempty"`
	ApplicationType string `json:",omitempty"`
	Architecture    string
	URL             string        `json:",omitempty"`
	Summary         string        `json:",omitempty"`
	PackageId       string        `json:",omitempty"`
	CompType        ComponentType `json:"-"`
}

ApplicationData captures all attributes present in AWS:Application inventory type

func MergeLists

func MergeLists(primary []ApplicationData, secondary []ApplicationData) []ApplicationData

MergeLists combines a list of application data from a secondary source with a list from a primary source and returns a sorted result

type BillingInfoData

type BillingInfoData struct {
	BillingProductId string
}

BillingInfoData captures all attributes present in AWS:BillingInfo inventory type

type ByNamePublisherVersion

type ByNamePublisherVersion []ApplicationData

ByNamePublisherVersion implements sorting ApplicationData elements by name (case insensitive) then by publisher (case insensitive) then version (by component)

func (ByNamePublisherVersion) Len

func (s ByNamePublisherVersion) Len() int

func (ByNamePublisherVersion) Less

func (s ByNamePublisherVersion) Less(i, j int) bool

func (ByNamePublisherVersion) Swap

func (s ByNamePublisherVersion) Swap(i, j int)

type ComponentType

type ComponentType uint

ComponentType is a flags enum that data providers can set and gatherers can filter on

const (
	AWSComponent ComponentType = 1 << iota
)

type Config

type Config struct {
	Collection string `json:"Collection"`
	Filters    string `json:"Filters"`
	Location   string `json:"Location"`
}

Config captures all various properties (including optional) that can be supplied to a gatherer. NOTE: Not all properties will be applicable to all gatherers. E.g: Applications gatherer uses Collection, Files use Filters, Custom uses Collection & Location.

type CustomInventoryItem

type CustomInventoryItem struct {
	TypeName      string
	SchemaVersion string
	Content       interface{}
}

CustomInventoryItem represents the schema of custom inventory item

type FileData

type FileData struct {
	Name             string
	Size             string
	Description      string
	FileVersion      string
	InstalledDate    string
	ModificationTime string
	LastAccessTime   string
	ProductName      string
	InstalledDir     string
	CompanyName      string
	ProductVersion   string
	ProductLanguage  string
}

FileData captures all attributes present in AWS:File inventory type

type InstanceDetailedInformation

type InstanceDetailedInformation struct {
	CPUModel              string
	CPUSpeedMHz           string
	CPUs                  string
	CPUSockets            string
	CPUCores              string
	CPUHyperThreadEnabled string
	OSServicePack         string
	KernelVersion         string
}

InstanceDetailedInformation captures all attributes present in AWS:InstanceDetailedInformation inventory type

type InstanceInformation

type InstanceInformation struct {
	AgentStatus     string
	AgentVersion    string
	ComputerName    string
	PlatformName    string
	PlatformType    string
	PlatformVersion string
	// SSM Inventory expects it InstanceId and not InstanceID
	InstanceId string
	// SSM Inventory expects it IpAddress and not IPAddress
	IpAddress string
}

InstanceInformation captures all attributes present in AWS:InstanceInformation inventory type

type Item

type Item struct {
	Name string
	//content depends on inventory type - hence set as interface{} here.
	//e.g: for application - it will contain []ApplicationData,
	//for instanceInformation - it will contain []InstanceInformation.
	Content       interface{}
	ContentHash   string
	SchemaVersion string
	CaptureTime   string
}

Item encapsulates an inventory item

type NetworkData

type NetworkData struct {
	Name       string
	SubnetMask string `json:",omitempty"`
	Gateway    string `json:",omitempty"`
	DHCPServer string `json:",omitempty"`
	DNSServer  string `json:",omitempty"`
	MacAddress string
	IPV4       string
	IPV6       string
}

NetworkData captures all attributes present in AWS:Network inventory type

type Policy

type Policy struct {
	InventoryPolicy map[string]Config
}

Policy defines how an inventory policy document looks like

type RegistryData

type RegistryData struct {
	ValueName string
	ValueType string
	KeyPath   string
	Value     string
}

type RoleData

type RoleData struct {
	Name                      string
	DisplayName               string
	Description               string
	Installed                 string
	InstalledState            string
	FeatureType               string
	Path                      string
	SubFeatures               string
	ServerComponentDescriptor string
	DependsOn                 string
	Parent                    string
}

type ServiceData

type ServiceData struct {
	Name               string
	DisplayName        string
	Status             string
	DependentServices  string
	ServicesDependedOn string
	ServiceType        string
	StartType          string
}

type WindowsUpdateData

type WindowsUpdateData struct {
	// SSM Inventory expects it HotFixId and not HotFixID
	HotFixId      string
	Description   string
	InstalledTime string
	InstalledBy   string
}

WindowsUpdateData captures all attributes present in AWS:WindowsUpdate inventory type

Jump to

Keyboard shortcuts

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