diff --git a/nucleus/principalNetworkDomain.go b/nucleus/principalNetworkDomain.go index c304f8ae399d2278b576c2f36daebafd161f8195..6a6eaf5acda654183a1021934bcca2cec5760304 100644 --- a/nucleus/principalNetworkDomain.go +++ b/nucleus/principalNetworkDomain.go @@ -17,7 +17,7 @@ type PrincipalNetworkDomain interface { RequestAll(string) error GetName() string GetDescription() string - GetDevices() map[uuid.UUID]*Device + GetDevice(uuid.UUID) (*Device, bool) GetSBIs() map[string]SouthboundInterface } @@ -45,8 +45,8 @@ func (pnd *pndImplementation) GetName() string { return pnd.name } -func (pnd *pndImplementation) GetDevices() map[uuid.UUID]*Device { - return pnd.devices +func (pnd *pndImplementation) GetDevice(uuid uuid.UUID) (*Device, bool) { + return pnd.getDevice(uuid) } func (pnd *pndImplementation) GetDescription() string { @@ -104,6 +104,11 @@ func (pnd *pndImplementation) removeDevice(uuid uuid.UUID) error { return nil } +func (pnd *pndImplementation) getDevice(uuid uuid.UUID) (*Device, bool) { + device, exists := pnd.devices[uuid] + return device, exists +} + func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) error { d := pnd.devices[uuid] ctx := context.Background() diff --git a/nucleus/southbound.go b/nucleus/southbound.go index cb2ac3721bb67e493c96c4de9abe94bfb3960a0a..2a31d78f270f01e0cb153cdca907ee9422cfbc25 100644 --- a/nucleus/southbound.go +++ b/nucleus/southbound.go @@ -62,6 +62,9 @@ func (oc *OpenConfig) SetNode() func(schema *yang.Entry, root interface{}, path } } +// deprecated +// Use for prototyping only. +// Use OpenConfig instead type AristaOC struct { // deprecated transport Transport