Allow vendor specifics in OC
OpenConfig allows the implementation of so called augments
and deviations
. The modifications change the YANG models. We need to find a way to load them generically.
// The issue with the loc below is the type assertion. It depends on the generated
// model and cannot be executed dynamically at runtime.
ytypes.SetNode(schema, d.Device.(*openconfig.Device), val.Path, val.Val, opts...)
The use of reflect
may be a feasible way. Another option would be to inject interface specific func
s to the nucleus.Device
struct similar to
type Device struct {
// ...
SetNode func(schema, d.Device.(*openconfig.Device), val.Path, val.Val, opts...) error
// ...
}
in combination with
d := nucleus.Device{
SetNode = sbi.SetNode
}