func (vds *VppDataStore) DeleteNode(nodeName string) error {
	vds.lock.Lock()
	defer vds.lock.Unlock()
	nodeID, err := strconv.Atoi(nodeName)
	if err != nil {
		return fmt.Errorf("invalid nodeId %s", nodeName)
	}
	for _, node := range vds.NodeMap {
		if node.ID == uint32(nodeID) {
			for _, intf := range node.NodeInterfaces {
				if intf.Value.Name == ipnet.DefaultVxlanBVIInterfaceName {
					delete(vds.LoopMACMap, intf.Value.PhysAddress)
					for _, ip := range intf.Value.IpAddresses {
						delete(vds.LoopIPMap, ip)
					}
				}
			}
			delete(vds.NodeMap, node.Name)
			delete(vds.GigEIPMap, node.IPAddr)
			return nil
		}
	}
	return fmt.Errorf("node %s does not exist", nodeName)
}
DeleteNode handles node deletions from the cache. The delete callback
actually hands off to us the node ID in a string format, so we have
to first find the node by its ID, not its name. If the nodeName parameter
is invalid, or it does not identify a node that is present in the cache,
we return an error.
package datastore
import (
	"fmt"
	"sort"
	"strconv"
	"strings"
	"sync"
	"github.com/pkg/errors"
	"github.com/contiv/vpp/plugins/crd/cache/telemetrymodel"
	"github.com/contiv/vpp/plugins/ipnet"
	"github.com/contiv/vpp/plugins/ipnet/restapi"
	"go.ligato.io/cn-infra/v2/health/statuscheck/model/status"
)
type VppDataStore struct {
	lock *sync.Mutex
	NodeMap    map[string]*telemetrymodel.Node
	LoopIPMap  map[string]*telemetrymodel.Node
	GigEIPMap  map[string]*telemetrymodel.Node
	LoopMACMap map[string]*telemetrymodel.Node
	HostIPMap  map[string]*telemetrymodel.Node
}
func (vds *VppDataStore) CreateNode(ID uint32, nodeName, IPAddr string) error {
	vds.lock.Lock()
	defer vds.lock.Unlock()
	if _, ok := vds.retrieveNode(nodeName); ok {
		return fmt.Errorf("node %s already exists", nodeName)
	}
	n := &telemetrymodel.Node{
		NodeInfo: &telemetrymodel.NodeInfo{IPAddr: IPAddr, ID: ID, Name: nodeName},
	}
	n.PodMap = make(map[string]*telemetrymodel.Pod)
	vds.NodeMap[nodeName] = n
	if IPAddr != "" {
		ipa := strings.Split(IPAddr, "/")
		vds.GigEIPMap[ipa[0]] = n
	}
	return nil
}
func (vds *VppDataStore) RetrieveNode(nodeName string) (n *telemetrymodel.Node, err error) {
	vds.lock.Lock()
	defer vds.lock.Unlock()
	node, ok := vds.retrieveNode(nodeName)
	if ok {
		return node, nil
	}
	return nil, fmt.Errorf("node %s not found", nodeName)
}