manager

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: Apache-2.0 Imports: 33 Imported by: 9

Documentation

Overview

Package manager is is the main coordinator for the ONOS configuration subsystem.

Index

Constants

View Source
const SetConfigAlreadyApplied = "Already applied:"

SetConfigAlreadyApplied is a string constant for "Already applied:"

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	LeadershipStore      leadership.Store
	MastershipStore      mastership.Store
	DeviceChangesStore   device.Store
	DeviceStateStore     state.Store
	DeviceStore          devicestore.Store
	DeviceCache          cache.Cache
	NetworkChangesStore  network.Store
	NetworkSnapshotStore networksnap.Store
	DeviceSnapshotStore  devicesnap.Store

	ModelRegistry             *modelregistry.ModelRegistry
	TopoChannel               chan *topodevice.ListResponse
	OperationalStateChannel   chan events.OperationalStateEvent
	SouthboundErrorChan       chan events.DeviceResponse
	Dispatcher                *dispatcher.Dispatcher
	OperationalStateCache     map[topodevice.ID]devicechange.TypedValueMap
	OperationalStateCacheLock *sync.RWMutex
	// contains filtered or unexported fields
}

Manager single point of entry for the config system.

func GetManager

func GetManager() *Manager

GetManager returns the initialized and running instance of manager. Should be called only after NewManager and Run are done.

func NewManager

func NewManager(leadershipStore leadership.Store, mastershipStore mastership.Store, deviceChangesStore device.Store,
	deviceStateStore state.Store, deviceStore devicestore.Store, deviceCache cache.Cache,
	networkChangesStore network.Store, networkSnapshotStore networksnap.Store,
	deviceSnapshotStore devicesnap.Store, allowUnvalidatedConfig bool) *Manager

NewManager initializes the network config manager subsystem.

func (*Manager) CheckCacheForDevice

func (m *Manager) CheckCacheForDevice(target devicetype.ID, deviceType devicetype.Type,
	version devicetype.Version) (devicetype.Type, devicetype.Version, error)

CheckCacheForDevice checks against the device cache (of the device change store to see if a device of that name is already present)

func (*Manager) Close

func (m *Manager) Close()

Close kills the channels and manager related objects

func (*Manager) ComputeDeviceChange

func (m *Manager) ComputeDeviceChange(deviceName devicetype.ID, version devicetype.Version,
	deviceType devicetype.Type, updates devicechange.TypedValueMap,
	deletes []string, description string) (*devicechange.Change, error)

ComputeDeviceChange computes a given device change the given updates and deletes, according to the path on the configuration for the specified target

func (*Manager) GetAllDeviceIds

func (m *Manager) GetAllDeviceIds() *[]string

GetAllDeviceIds returns a list of just DeviceIDs from the device cache

func (*Manager) GetTargetConfig

func (m *Manager) GetTargetConfig(deviceID devicetype.ID, version devicetype.Version, path string, revision networkchange.Revision) ([]*devicechange.PathValue, error)

GetTargetConfig returns a set of change values given a target, a configuration name, a path and a layer. The layer is the numbers of config changes we want to go back in time for. 0 is the latest (Atomix based)

func (*Manager) GetTargetState

func (m *Manager) GetTargetState(target string, path string) []*devicechange.PathValue

GetTargetState returns a set of state values given a target and a path.

func (*Manager) RollbackTargetConfig

func (m *Manager) RollbackTargetConfig(networkChangeID networkchange.ID) error

RollbackTargetConfig rollbacks the last change for a given configuration on the target, by setting phase to rollback and state to pending.

func (*Manager) Run

func (m *Manager) Run()

Run starts a synchronizer based on the devices and the northbound services.

func (*Manager) SetNetworkConfig

func (m *Manager) SetNetworkConfig(targetUpdates map[string]devicechange.TypedValueMap,
	targetRemoves map[string][]string, deviceInfo map[devicetype.ID]cache.Info, netChangeID string) (*networkchange.NetworkChange, error)

SetNetworkConfig creates and stores a new netork config for the given updates and deletes and targets

func (*Manager) ValidateNetworkConfig

func (m *Manager) ValidateNetworkConfig(deviceName devicetype.ID, version devicetype.Version,
	deviceType devicetype.Type, updates devicechange.TypedValueMap, deletes []string, lastWrite networkchange.Revision) error

ValidateNetworkConfig validates the given updates and deletes, according to the path on the configuration for the specified target (Atomix Based)

Jump to

Keyboard shortcuts

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