Documentation ¶
Overview ¶
Package utils holds utilities for the northbound servers
Index ¶
- Constants
- func CheckCacheForDevice(target devicetype.ID, deviceType devicetype.Type, version devicetype.Version, ...) (devicetype.Type, devicetype.Version, error)
- func GetAllDeviceIds(deviceCache cache.Cache) *[]string
- func GetTargetConfig(deviceID devicetype.ID, version devicetype.Version, deviceType devicetype.Type, ...) ([]*devicechange.PathValue, error)
- func GetTargetState(target string, path string, ...) []*devicechange.PathValue
- func RollbackTargetConfig(networkChangeID networkchange.ID, networkChangesStore networkchangestore.Store) error
- func SetNetworkConfig(targetUpdates map[devicetype.ID]devicechange.TypedValueMap, ...) (*networkchange.NetworkChange, error)
- func ValidateNetworkConfig(deviceName devicetype.ID, version devicetype.Version, ...) error
Constants ¶
const OIDCServerURL = "OIDC_SERVER_URL"
OIDCServerURL - the ENV var that signified security is turned on - no groups will be extracted from request without this
const SetConfigAlreadyApplied = "Already applied:"
SetConfigAlreadyApplied is a string constant for "Already applied:"
Variables ¶
This section is empty.
Functions ¶
func CheckCacheForDevice ¶
func CheckCacheForDevice(target devicetype.ID, deviceType devicetype.Type, version devicetype.Version, deviceCache cache.Cache, deviceStore devicestore.Store) (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 GetAllDeviceIds ¶
GetAllDeviceIds returns a list of just DeviceIDs from the device cache
func GetTargetConfig ¶
func GetTargetConfig(deviceID devicetype.ID, version devicetype.Version, deviceType devicetype.Type, path string, revision networkchange.Revision, groups []string, deviceStateStore state.Store, modelRegistry *modelregistry.ModelRegistry, allowUnvalidatedConfig bool) ([]*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 GetTargetState ¶
func GetTargetState(target string, path string, operationalStateCache map[topodevice.ID]devicechange.TypedValueMap, operationalStateCacheLock *sync.RWMutex) []*devicechange.PathValue
GetTargetState returns a set of state values given a target and a path.
func RollbackTargetConfig ¶
func RollbackTargetConfig(networkChangeID networkchange.ID, networkChangesStore networkchangestore.Store) error
RollbackTargetConfig rollbacks the last change for a given configuration on the target, by setting phase to rollback and state to pending.
func SetNetworkConfig ¶
func SetNetworkConfig(targetUpdates map[devicetype.ID]devicechange.TypedValueMap, targetRemoves map[devicetype.ID][]string, deviceInfo map[devicetype.ID]cache.Info, netChangeID string, username string, networkChangesStore network.Store) (*networkchange.NetworkChange, error)
SetNetworkConfig creates and stores a new netork config for the given updates and deletes and targets
func ValidateNetworkConfig ¶
func ValidateNetworkConfig(deviceName devicetype.ID, version devicetype.Version, deviceType devicetype.Type, updates devicechange.TypedValueMap, deletes []string, lastWrite networkchange.Revision, modelRegistry *modelregistry.ModelRegistry, pluginRegistry *pluginregistry.PluginRegistry, deviceStateStore state.Store, allowUnvalidatedConfig bool, usePluginRegistry bool) error
ValidateNetworkConfig validates the given updates and deletes, according to the path on the configuration for the specified target (Atomix Based)
Types ¶
This section is empty.