provisioner

package
v0.0.0-...-178e1e7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2017 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ExampleYAML = `` /* 1588-byte string literal not displayed */

ExampleYAML provides a complete set of config options in YAML format and can be used for documentation purposes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ConfigDirectory   string              `yaml:"config_directory"`
	FirmwareDirectory string              `yaml:"firmware_directory"`
	SafeUpgradePaths  map[string][]string `yaml:"safe_upgrade_paths"`

	InterfaceNames []string `yaml:"interfaces"`

	SSHAuthMethods []sshAuthMethod `yaml:"ssh"`

	Web struct {
		Host string `yaml:"host"`
		Port int    `yaml:"port"`
	} `yaml:"web"`
	// contains filtered or unexported fields
}

Configuration maps config options to values

func LoadConfig

func LoadConfig(fileName string) (c *Configuration, errs []error)

LoadConfig reads a YAML file and converts it to a config object

func (*Configuration) DeviceConfigs

func (c *Configuration) DeviceConfigs() []string

DeviceConfigs prepares a list of device configuration names

func (*Configuration) FindDevice

func (c *Configuration) FindDevice(mac string) *Device

FindDevice searches the list of discovered devices and returns a pointer to it (or nil, if we can't find it).

func (*Configuration) FirmwareImages

func (c *Configuration) FirmwareImages() []string

FirmwareImages prepares a list of firmware names

func (*Configuration) GetDevices

func (c *Configuration) GetDevices() (list []*Device)

GetDevices returns an array with all discovered devices.

func (*Configuration) StartAutoDiscover

func (c *Configuration) StartAutoDiscover(notify discovery.NotifyHandler) (d *discovery.Discover, err error)

StartAutoDiscover starts the UBNT auto discovery mechanism. See discovery.AutoDiscover for details.

type Device

type Device struct {
	*discovery.Device
	IPAddress string

	RebootedAt time.Time
	// contains filtered or unexported fields
}

Device is a wrapper around discovery.Device, and annotates a primary IP address, the latest available Firmware and/or system config.

It also knows how to communicate with the device.

func (*Device) CanUpgrade

func (d *Device) CanUpgrade() bool

CanUpgrade indicates, whether new firmware image is available

func (*Device) HasConfig

func (d *Device) HasConfig() bool

HasConfig indicates, whether system config is available

func (*Device) IsBusy

func (d *Device) IsBusy() bool

IsBusy states whether or not this Device is ready to receive commands.

func (*Device) Provision

func (d *Device) Provision() error

Provision updates the system config on the remote device.

func (*Device) Reboot

func (d *Device) Reboot() error

Reboot issues a reboot on the device.

func (*Device) Status

func (d *Device) Status() string

Status gives a human-readable status information about this device. The status may be "idle", "upgrading", "provisioning", or "rebooting". Note that this status text only indicates a current event, when this device is actually marked busy. Otherwise, you'll get the _last_ state.

func (*Device) Upgrade

func (d *Device) Upgrade() error

Upgrade uploads the firmware image to the remote device and starts the upgrade process.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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