Hello Alexander, I put some answers inline. > -----Original Message----- > From: Alexander L Clemm <[email protected]> > Sent: Monday, July 29, 2024 8:22 PM > To: [email protected] > Subject: [netmod] Defining groupings after the fact? draft-jouqui-netmod-yang- > full-include and the reuse of definitions > > Hello Jean, Benoit, Thomas, > > After your presentation at IETF 120, I looked at your draft > https://datatracker.ietf.org/doc/html/draft-jouqui-netmod-yang-full-include- > 02. > > > I do have some questions regarding what happens if the embedded module is > being augmented. Is the augmentation automatically embedded as well; does > such embedding need to be explicitly stated? Is there a way to augment an > embedded module only within the context of the embedding module?
Yes, as per the example in the slides: if you want ietf-interfaces augmented by ietf-ip, you have to embed them both. > On a more general note, it strikes me that there is an increased need in > reusing > definitions. In various forms, we see this in your use cases, in network > inventory > use cases, in schema-mount, in peer-mount. YANG does not provide good > support for that, which is somewhat ironic in that it does actually support > several constructs with reuse and extensibility in mind, from identities to > groupings. Hopefully the YANG-next effort will go a long ways towards > improving definition reuse to that the need for after-the-fact bandaids can be > avoided. Fully agree, the full embed as defined here should be a keyword in YANG-next. Similar constructs exist in protobuf and json-schema for instance. > When it comes to reusing parts of definitions, it seems that a lot of grief > could be > avoided if portions that are to be reused would have been defined as > groupings, > which could then be used wherever needed. The problem is that the grouping > construct is rarely used, so many YANG definitions are not available for reuse > that otherwise might be. Grouping does not solve everything, you cannot augment a grouping so any augmentation would have to be repeated for each use of the grouping. I recommend reading the intro of RFC8528 YANG Schema Mount for a detailed description of these reuse issues. > As a thought, it might be useful to introduce a construct that will allow to > define > a _grouping_ after-the-fact, for later reuse. I.e., allow groupings to be > defined > in a way that the new grouping embeds an existing definition, then simply make > use of that grouping. That would seem perhaps cleanest, able to address many > of the use cases and have the additional advantage that the semantics here > will > be very clear since part of the exising YANG framework. There is still the augment issue from above, we have it in draft-ietf-opsawg-collected-data-manifest when reusing ietf-yang-push which augments ietf-subscribed-notifications. All these augments have to be rewritten with paths corresponding to the new location of the uses. I think the semantics for Schema Mount as defined in RFC8525 is the key to reuse the full semantics of YANG (i.e. not only groupings but also augmentations, rpcs ...) without having to modify existing modules. What we propose in full embed is just to enable a simplified version of schema mount, for design time. Best, Jean > --- Alex > > > > _______________________________________________ > netmod mailing list -- [email protected] > To unsubscribe send an email to [email protected] _______________________________________________ netmod mailing list -- [email protected] To unsubscribe send an email to [email protected]
