Open GiacomoCortesi opened 3 years ago
We didn't implement code generation for YANG notification
statements as you note simply because we didn't have a use case for them. OpenConfig today does not use such statements (since the ethos there is that notifications come from part of the tree itself, rather than having a separate type). We're happy to review PRs to add this functionality to ygot though.
There is a need to think through what the generated code will be used for such that we can choose the right API -- would the intention be to deserialise JSON notifications coming from a target system such that Unmarshal
needs to be supported? A design document would likely help us understand your use cases such that we can advise on the design to be consistent with other ygot generated code.
exactly, the use case would be to be able to deserialize notification data (JSON/XML) coming from a target system into go structs. Therefore yes, Unmarshal shall be supported for notification type of data.
e.g. we have two devices:
with an active netconf session Notification flow:
any high level suggestion/doubt/observation before I start diving into the code for implementation?
bump
This is likely relatively easy to implement -- one would need to check that goyang
parses notification
statements (today they are not a yang.Entry
AFAIK) and then add a flag to ygot to find these notification
entries to generate code for.
If someone would like to contribute this, I'm happy to review designs and code contributions.
Hi guys,
appreciating the work you are doing with ygot project.
I'm working with yang models from IETF. A lot of these models contain "notification" yang types, an example below:
when running the go generate command I get failures like below:
As soon as I remove the notification type piece from the yang model the generate command succeeds.
Looking into ytypes package I couldn't find any reference to the notification type indeed.
Is there any reason for the missing support of notifications? Is there any plan for adding it in the future?
Thank you!