Documentation
¶
Index ¶
- type ChefAPIClient
- type ChefUpdater
- func (cu *ChefUpdater) AllowLicense(license string) []error
- func (cu *ChefUpdater) BlockOrganization(organization string, productType uint32) []error
- func (cu *ChefUpdater) FetchNodes() error
- func (cu *ChefUpdater) ResetAllSensors() error
- func (cu *ChefUpdater) UpdateNode(address net.IP, serialNumber string, obsID uint32, deviceID uint32) error
- type ChefUpdaterConfig
- type UUID
- type Updater
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.