Documentation ¶
Overview ¶
Package manager is is the main coordinator for the ONOS configuration subsystem.
Index ¶
- Constants
- type Manager
- func (m *Manager) CheckCacheForDevice(target devicetype.ID, deviceType devicetype.Type, version devicetype.Version) (devicetype.Type, devicetype.Version, error)
- func (m *Manager) Close()
- func (m *Manager) GetAllDeviceIds() *[]string
- func (m *Manager) GetTargetConfig(deviceID devicetype.ID, version devicetype.Version, path string, ...) ([]*devicechange.PathValue, error)
- func (m *Manager) GetTargetState(target string, path string) []*devicechange.PathValue
- func (m *Manager) RollbackTargetConfig(networkChangeID networkchange.ID) error
- func (m *Manager) Run()
- func (m *Manager) SetNetworkConfig(targetUpdates map[devicetype.ID]devicechange.TypedValueMap, ...) (*networkchange.NetworkChange, error)
- func (m *Manager) ValidateNetworkConfig(deviceName devicetype.ID, version devicetype.Version, ...) error
Constants ¶
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 RbacCache rbac.Cache // 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, rbacCache rbac.Cache, modelRegistry *modelregistry.ModelRegistry) *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) GetAllDeviceIds ¶
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[devicetype.ID]devicechange.TypedValueMap, targetRemoves map[devicetype.ID][]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)