Hello Alexander, Jean, all,


I fully agree with Alexander that groupings have great potential.



> 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



> 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.

>

> 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 existing YANG framework.


Doing so would indeed be very useful. Actually, when experimenting on 
supporting templates as introduced in 
slides-120-netmod-10-bbf-liaison-on-management-at-scale-projects<https://datatracker.ietf.org/meeting/120/materials/slides-120-netmod-10-bbf-liaison-on-management-at-scale-projects>
 last week, we found that defining grouping for standard data nodes would allow 
applying "refine" statements to them in order to easily control mandatory and 
default statements of data nodes - a flexibility required by template methods, 
as explained. Moreover, with such groupings, one could think at solutions 
available very quickly, still with current YANG 1.1.



> Grouping does not solve everything, you cannot augment a grouping so any

> augmentation would have to be repeated for each use of the grouping.



Jean, I agree with you that groupings have their own limitations and attention 
points (e.g. xpaths !) but I find that their "refine" capability can be a great 
advantage in the above context, though. The issue you raise about augments 
could be alleviated by defining new augments in new groupings, leaving the 
original groupings untouched. If these new augments are to be used elsewhere, 
it would just boil down to adding a use statement for this new grouping at the 
target place.



> 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.



I fully agree that the "full embed" design time proposal offer key perspectives 
in the long term when it comes to reusability of existing YANG data 
nodes/modules. On the other side flexibility in mandatory and default 
statements (call it "tuned reusability") is something it should also support to 
enable templates, though. My point is that groupings that contain standard data 
nodes could be one way to ease such a "tuned reusability" - to be further 
discussed.



Thanks,

Best regards,

Robert





-----Original Message-----
From: Jean Quilbeuf <[email protected]>
Sent: Tuesday, July 30, 2024 11:35 AM
To: Alexander L Clemm <[email protected]>; [email protected]
Subject: [netmod] Re: Defining groupings after the fact? 
draft-jouqui-netmod-yang-full-include and the reuse of definitions



[You don't often get email from 
[email protected]<mailto:[email protected]>.
 Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]



CAUTION: This is an external email. Please be very careful when clicking links 
or opening attachments. See the URL nok.it/ext for additional information.







Hello Alexander,

I put some answers inline.



> -----Original Message-----

> From: Alexander L Clemm 
> <[email protected]<mailto:[email protected]>>

> Sent: Monday, July 29, 2024 8:22 PM

> To: [email protected]<mailto:[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-in

> clude-

> 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]<mailto:[email protected]> To unsubscribe 
> send an email to

> [email protected]<mailto:[email protected]>

_______________________________________________

netmod mailing list -- [email protected]<mailto:[email protected]>

To unsubscribe send an email to 
[email protected]<mailto:[email protected]>
_______________________________________________
netmod mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to