updater

package
v0.0.0-...-0bd7171 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChefAPIClient

type ChefAPIClient interface {
	NewClient(interface{}) interface{}
}

ChefAPIClient is an interface for a chef api client

type ChefUpdater

type ChefUpdater struct {
	ChefUpdaterConfig
	// contains filtered or unexported fields
}

ChefUpdater uses the Chef client API to update a sensor node with an IP address.

func NewChefUpdater

func NewChefUpdater(config ChefUpdaterConfig) (*ChefUpdater, error)

NewChefUpdater creates a new instance of a ChefUpdater.

func (*ChefUpdater) AllowLicense

func (cu *ChefUpdater) AllowLicense(license string) []error

AllowLicense iterates a node list and unblock all sensors with the given license.

func (*ChefUpdater) BlockOrganization

func (cu *ChefUpdater) BlockOrganization(organization string, productType uint32) []error

BlockOrganization iterates a node list and block all sensor belonging to an organization.

func (*ChefUpdater) FetchNodes

func (cu *ChefUpdater) FetchNodes() error

FetchNodes updates the internal node database and keep it in memory

func (*ChefUpdater) ResetAllSensors

func (cu *ChefUpdater) ResetAllSensors() error

ResetAllSensors sets the blocked status to true for all sensors

func (*ChefUpdater) UpdateNode

func (cu *ChefUpdater) UpdateNode(
	address net.IP, serialNumber string, obsID uint32, deviceID uint32) error

UpdateNode gets a list of nodes an look for one with the given address. If a node is found will update the deviceID. If a node with the given address is not found an error is returned

type ChefUpdaterConfig

type ChefUpdaterConfig struct {
	Name                 string
	URL                  string
	AccessKey            string
	SerialNumberPath     string
	SensorUUIDPath       string
	ObservationIDPath    string
	IPAddressPath        string
	BlockedStatusPath    string
	ProductTypePath      string
	OrganizationUUIDPath string
	LicenseUUIDPath      string
	DataBagName          string
	DataBagItem          string
	SkipSSL              bool
	// contains filtered or unexported fields
}

ChefUpdaterConfig contains the configuration for a ChefUpdater.

type UUID

type UUID string

UUID identifies the sensor that reached the limit

type Updater

type Updater interface {
	UpdateNode(net.IP, uint32, uint32) error
	BlockNode(UUID) error
}

Updater is an interface for an updater that adds an IP address to a sensors information object.

Jump to

Keyboard shortcuts

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