utils

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package utils holds utilities for the northbound servers

Index

Constants

View Source
const OIDCServerURL = "OIDC_SERVER_URL"

OIDCServerURL - the ENV var that signified security is turned on - no groups will be extracted from request without this

View Source
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

func GetAllDeviceIds(deviceCache cache.Cache) *[]string

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.

Jump to

Keyboard shortcuts

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