Re: [netmod] yang-data-ext issues
Martin Bjorklund <mbj@tail-f.com> Mon, 16 April 2018 15:02 UTC
Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 095D312DA24 for <netmod@ietfa.amsl.com>; Mon, 16 Apr 2018 08:02:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vQEivOXO2dPN for <netmod@ietfa.amsl.com>; Mon, 16 Apr 2018 08:02:22 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id A8C51124319 for <netmod@ietf.org>; Mon, 16 Apr 2018 08:02:22 -0700 (PDT)
Received: from localhost (unknown [173.38.220.61]) by mail.tail-f.com (Postfix) with ESMTPSA id C61351AE00A0; Mon, 16 Apr 2018 17:02:21 +0200 (CEST)
Date: Mon, 16 Apr 2018 17:02:21 +0200
Message-Id: <20180416.170221.1581228820475809080.mbj@tail-f.com>
To: andy@yumaworks.com
Cc: jclarke@cisco.com, netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <CABCOCHRY9tOoz4PB-EtrU4pC1o3Qi22_AX887yU_Mo2cx8mSAw@mail.gmail.com>
References: <20180416.145617.1262098657698751846.mbj@tail-f.com> <f5336084-ebc5-de9e-35f8-89730db69b78@cisco.com> <CABCOCHRY9tOoz4PB-EtrU4pC1o3Qi22_AX887yU_Mo2cx8mSAw@mail.gmail.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/MrZpRwvUk93Fgd4AJVCuHsgv570>
Subject: Re: [netmod] yang-data-ext issues
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Apr 2018 15:02:26 -0000
Hi, Andy Bierman <andy@yumaworks.com> wrote: > On Mon, Apr 16, 2018 at 6:33 AM, Joe Clarke <jclarke@cisco.com> wrote: > > > On 4/16/18 08:56, Martin Bjorklund wrote: > > > Hi, > > > > > > While preparing draft-ietf-netmod-yang-data-ext-02, it turned out that > > > it is not clear what, if any, restrictions should be enforced for > > > yang-data structures. Even among the authors we have different ideas > > > for how this should work. > > > > > > Background: > > > > > > In 8040, the original yang-data extension had a restriction that said > > > that a yang-data structure MUST have exactly one container, since it > > > wouldn't be possible to have a yang-data structure in an XML instance > > > document otherwise. > > > > > > Since people want to use yang-data structures in other places, this > > > restriction was lifted in the new draft: > > > > > > There is no longer an assumption that a yang data structure can > > > only be used as a top-level abstraction, instead of nested within > > > some other data structure. > > > > > > > > > With this in mind, here's a use case that I think we ought to support: > > > > > > rpc my-first-rpc { > > > description > > > "Bla bla... > > > If an error occurs, <error-info> will contain an instance of > > > the yang-data structure 'my-first-rpc-error-info'."; > > > ... > > > } > > > > > > yang-data my-first-rpc-error-info { > > > leaf reason { ... } > > > container user-info { ... } > > > } > > > > > > rpc my-second-rpc { > > > description > > > "Bla bla... > > > If an error occurs, <error-info> will contain an instance of > > > the yang-data structure 'my-second-rpc-error-info'."; > > > ... > > > } > > > > > > yang-data my-second-rpc-error-info { > > > leaf reason { ... } > > > leaf important-url { ... } > > > } > > > > > > (maybe in the future we could even have a YANG extension statement to > > > formalize the description: > > > > > > rpc my-first-rpc { > > > ... > > > opx:error-info-structure my-first-rpc-error-info; > > > } > > > > > > but this is not point now.) > > > > > > In the example above, note that the leaf "reason" is present in both > > > structures. IMO this is not a problem, since these structures are > > > used in different contexts. > > > > > > My point is that I think we should impose as few restrictions as > > > possible to the yang-data extension. It should be up to the user of > > > yang-data to ensure that the structure is defined in such a way so > > > that it can be used properly. For example, a structure that is > > > supposed to describe an XML instance document cannot define two leafs > > > at the top level. > > > > > > If the WG agrees with what I wrote above, we need to change the > > > augment-yang-data extension so that you would write for example: > > > > > > yx:augment-yang-data /ex:my-first-rpc-error-info/ex:user-info { > > > ... > > > } > > > > > > Comments? > > > > I found the "single container only" policy to be too restricting. I was > > modeling data that would [typically] be serialized to something other > > than XML, and this just made me jump through more hoops than I wanted to > > use rc:yang-data. > > > > I agree with your laissez-faire proposal here. I think there should be > > some text to the same effect about how it is up to the author of the > > yd:yang-data elements to make sure the modeled data can be encoded as > > they require. > > > > > > How will your tool handle this? > > > module foo { > x:yang-data fake-namespace1 { > container top { ... } > } > > x:yang-data fake-namespace2 { > container top { ... } > } > > container top { ... } > > } > > > You parse an artifact file: > > <top xmlns="module-foo-namespace"> > <next> ... </next> > </top> If the yang-data structures are supposed be used in instance documents w/ no additional context information, then the designer should not use two nodes with the same name in different strcuctures, just like he wouldn't use two top-level containers. But as my original email demonstrated, there are cases where the context provides the information which structure to use.n > Current YANG says that the <toip> node can only be defined once. > This makes it possible for a parser to pick the correct schema. > If 2 or or more yang-data definitions have this name (foo:top) > then how does your tool pick the right one.? > > This existing restriction in YANG serves a useful purpose. > Removing it would be unwise. > > There is no restriction to limit the yang-data to a container. > This has already been removed. > > > My counter-proposal is to remove the argument for yang-data > since it servers no purpose: > > > x:yang-data { > container top { ... } > } > > x:yang-data { > list bar { ... } > } I think this would be a mistake. It wouldn't even be possible to talk about the different structures in a module. For example, the subscribed notification draft has this: These are the following three yang-data structures for failed event stream subscriptions: 1. "establish-subscription-stream-error-info": This MUST be returned ... And it would be impossible to add an extension like: opx:error-info-structure my-first-rpc-error-info; (see my original email for details) /martin > > Joe > > > > > > Andy > > > > > _______________________________________________ > > netmod mailing list > > netmod@ietf.org > > https://www.ietf.org/mailman/listinfo/netmod > >
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Joe Clarke
- Re: [netmod] yang-data-ext issues Kent Watsen
- [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Joe Clarke
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Robert Wilton
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Robert Wilton
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Robert Varga
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Robert Varga
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Robert Varga
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- [netmod] Extensions vs new YANG versions [was Re:… Robert Wilton
- Re: [netmod] yang-data-ext issues Robert Wilton
- Re: [netmod] Extensions vs new YANG versions [was… Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Robert Wilton
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Robert Wilton
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Robert Wilton
- Re: [netmod] yang-data-ext issues Martin Bjorklund
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Ladislav Lhotka
- Re: [netmod] yang-data-ext issues Robert Varga
- Re: [netmod] yang-data-ext issues Robert Varga
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Juergen Schoenwaelder
- Re: [netmod] yang-data-ext issues Andy Bierman
- Re: [netmod] yang-data-ext issues Kent Watsen
- Re: [netmod] yang-data-ext issues Ladislav Lhotka