Documentation
¶
Overview ¶
Package config maintains all of the machinery and embedded terraform data to configure field routers and access points
Index ¶
- Constants
- type Configurator
- func (c *Configurator) ActivateBootstrapNet() error
- func (c *Configurator) BootstrapPhase0() error
- func (c *Configurator) BootstrapPhase1() error
- func (c *Configurator) BootstrapPhase2() error
- func (c *Configurator) BootstrapPhase3() error
- func (c *Configurator) Converge(refresh bool, target string) error
- func (c *Configurator) CycleRadio(band string) error
- func (c *Configurator) DeactivateBootstrapNet() error
- func (c *Configurator) GetIDOnPort(field int, quad string) (int, error)
- func (c *Configurator) Init() error
- func (c *Configurator) ROSPing(addr, user, pass string) error
- func (c *Configurator) RadioChannelForField(id int) string
- func (c *Configurator) RadioMode() string
- func (c *Configurator) ReprovisionCAP() error
- func (c *Configurator) SyncState(ctx map[string]interface{}) error
- func (c *Configurator) SyncTLM(tlm map[int]string) error
- func (c *Configurator) Zap() error
- type EventStreamer
- type Option
Constants ¶
const ( // BootstrapAddr points to where the scoring router would be // during the bootstrap scenario. BootstrapAddr = "100.64.1.1" // NormalAddr points to where the scoring router is during // normal operation. NormalAddr = "100.64.0.1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurator ¶
type Configurator struct {
// contains filtered or unexported fields
}
Configurator is a mechansim to drive terraform under the hood and validate that the configuration is as intended.
func (*Configurator) ActivateBootstrapNet ¶ added in v0.1.9
func (c *Configurator) ActivateBootstrapNet() error
ActivateBootstrapNet raises VLAN2 with special addressing and allows the FMS processes to talk to the network elements prior to bootstrapping being complete.
func (*Configurator) BootstrapPhase0 ¶ added in v0.1.9
func (c *Configurator) BootstrapPhase0() error
BootstrapPhase0 sets up the intial structures on disk and gets to a point where further assumptions around bootstrapping can proceed.
func (*Configurator) BootstrapPhase1 ¶ added in v0.1.9
func (c *Configurator) BootstrapPhase1() error
BootstrapPhase1 handles the bring up of the core router to a point where it is providing DHCP and the rest of the system is able to communicate.
func (*Configurator) BootstrapPhase2 ¶ added in v0.1.9
func (c *Configurator) BootstrapPhase2() error
BootstrapPhase2 handles the bootstrapping of fields.
func (*Configurator) BootstrapPhase3 ¶ added in v0.1.9
func (c *Configurator) BootstrapPhase3() error
BootstrapPhase3 toggles out of bootstrap mode, and returns the system to its normal operating state.
func (*Configurator) Converge ¶
func (c *Configurator) Converge(refresh bool, target string) error
Converge commands all network hardware to achieve the state currently on disk.
func (*Configurator) CycleRadio ¶
func (c *Configurator) CycleRadio(band string) error
CycleRadio forces a provisioning cycle on the given band.
func (*Configurator) DeactivateBootstrapNet ¶ added in v0.1.9
func (c *Configurator) DeactivateBootstrapNet() error
DeactivateBootstrapNet undoes what is setup by ActivateBootstrapNet and returns the system to its normal network operations.
func (*Configurator) GetIDOnPort ¶ added in v0.1.9
func (c *Configurator) GetIDOnPort(field int, quad string) (int, error)
GetIDOnPort checks for an LLDP identity on the given port and then resolves the number assuming that it is of the form 'gizmoDS-NNNN'.
func (*Configurator) Init ¶
func (c *Configurator) Init() error
Init performs initialization of the underlying terraform workspace to fetch plugins and initialize module links.
func (*Configurator) ROSPing ¶ added in v0.1.9
func (c *Configurator) ROSPing(addr, user, pass string) error
ROSPing reaches out to a device and attempts to retrive its identity. This validates that the device is up to a point that ROS can respond to API calls.
func (*Configurator) RadioChannelForField ¶ added in v0.1.6
func (c *Configurator) RadioChannelForField(id int) string
RadioChannelForField returns the currently configured radio channel for a given field.
func (*Configurator) RadioMode ¶ added in v0.1.6
func (c *Configurator) RadioMode() string
RadioMode returns the configured radio mode. This is useful for passing to other systems to determine what mode they should be in based on what mode the FMS radio is in.
func (*Configurator) ReprovisionCAP ¶ added in v0.1.6
func (c *Configurator) ReprovisionCAP() error
ReprovisionCAP removes all CAP interfaces and then triggers a provisioning cycle.
func (*Configurator) SyncState ¶
func (c *Configurator) SyncState(ctx map[string]interface{}) error
SyncState pushes the in-memory state down to the disk.
func (*Configurator) SyncTLM ¶
func (c *Configurator) SyncTLM(tlm map[int]string) error
SyncTLM takes a mapping from the TLM and puts it down on disk so that a later converge run may act upon it.
func (*Configurator) Zap ¶ added in v0.1.9
func (c *Configurator) Zap() error
Zap destructively removes all state information that is used by the controller.
type EventStreamer ¶ added in v0.1.9
type EventStreamer interface { PublishError(error) PublishLogLine(string) PublishActionComplete(string) }
EventStreamer provides an option to stream configuration events to remote consumers.
type Option ¶
type Option func(*Configurator)
Option configures the Configurator
func WithEventStreamer ¶ added in v0.1.9
func WithEventStreamer(es EventStreamer) Option
WithEventStreamer provides a means of streaming events that the config engine takes.
func WithFMS ¶
WithFMS provides the current FMS configuration to the system, which influences the components that are configured.
func WithLogger ¶
func WithLogger(l hclog.Logger) Option
WithLogger sets the parent logging instance for the configurator
func WithRouter ¶
WithRouter sets the address on which the router can be contacted.
func WithStateDirectory ¶ added in v0.1.9
WithStateDirectory allows moving the terraform state directory to an absolutely referenced path.