Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceBuilder ¶
type DeviceBuilder interface {
// Name sets the device name.
Name(string) DeviceOption
// DisplayName sets the device name.
DisplayName(string) DeviceOption
// CollectorID sets the preferred collector ID for the device.
CollectorID(int32) DeviceOption
// SystemCategories sets the system.categories property on the device.
SystemCategories(string) DeviceOption
// ResourceLabels sets custom properties for the device
ResourceLabels(map[string]string) DeviceOption
// Auto adds an auto property to the device.
Auto(string, string) DeviceOption
// System adds a system property to the device.
System(string, string) DeviceOption
// System adds a custom property to the device.
Custom(string, string) DeviceOption
}
DeviceBuilder is the interface responsible for building a device struct.
type DeviceManager ¶
type DeviceManager interface {
DeviceMapper
DeviceBuilder
}
DeviceManager is an interface that describes how resources in Kubernetes are mapped into LogicMonitor as devices.
type DeviceMapper ¶
type DeviceMapper interface {
// Config returns the Argus config.
Config() *config.Config
// FindByDisplayName searches for a device by it's display name. It will return a device if and only if
// one device was found, and return nil otherwise.
FindByDisplayName(string) (*models.Device, error)
// FindByDisplayNames searches for devices by the specified string by its display name. It will return the device list.
FindByDisplayNames(...string) ([]*models.Device, error)
// FindByDisplayNameAndClusterName searches for device by the specified string by its display name and clusterName. It will return a device if and only if
FindByDisplayNameAndClusterName(string) (*models.Device, error)
// Add adds a device to a LogicMonitor account.
Add(...DeviceOption) (*models.Device, error)
// UpdateAndReplace updates a device using the 'replace' OpType.
UpdateAndReplace(*models.Device, ...DeviceOption) (*models.Device, error)
// UpdateAndReplaceByDisplayName updates a device using the 'replace' OpType if and onlt if it does not already exist.
UpdateAndReplaceByDisplayName(string, ...DeviceOption) (*models.Device, error)
// UpdateAndReplaceField updates a device using the 'replace' OpType for a
// specific field of a device.
UpdateAndReplaceField(*models.Device, string, ...DeviceOption) (*models.Device, error)
// UpdateAndReplaceFieldByDisplayName updates a device using the 'replace' OpType for a
// specific field of a device.
UpdateAndReplaceFieldByDisplayName(string, string, ...DeviceOption) (*models.Device, error)
// DeleteByID deletes a device by device ID.
DeleteByID(int32) error
// DeleteByDisplayName deletes a device by device display name.
DeleteByDisplayName(string) error
}
DeviceMapper is the interface responsible for mapping a Kubernetes resource to a LogicMonitor device.
type DeviceOption ¶
DeviceOption is the function definition for the functional options pattern.
Click to show internal directories.
Click to hide internal directories.