Closed babuveld closed 2 years ago
Generally we use Go bindings (i.e. ygot-generated GoStructs) since it's easier to manipulate configuration in code than generated protobuf code. There is a rich set of utilities in ygot for marshalling/unmarshalling to/from the GoStructs to gNMI notifications.
For an example using Go bindings, see https://github.com/openconfig/ygot/tree/master/demo/gnmi_telemetry
I believe protomap does not support converting from protobuf binding -> gNMI Notifications yet, so the Go binding approach is definitely preferred right now.
Thanks for the quick response.
Am considering below approach. Please let me know if its feasible with ygot. I think producer side of things should be possible to do, however consumer side am not sure if its possible. I see protomap matches my expectation, however I don't see much examples to give a try. Can you please confirm and provide a possible example for protomap usage.
Producer:
YANG -> Protobuf (generate proto using ygot and encode using c++) -> Serialize -> Stream to consumer.
Consumer:
case 1: Deserialize -> Protobuf -> gNMI notification. case 2: Deserialize -> Protobuf -> EmitJson.