Re: [netmod] Proposal to enhance the YANG tree output

"Xufeng Liu" <xufeng.liu.ietf@gmail.com> Tue, 26 September 2017 02:57 UTC

Return-Path: <xufeng.liu.ietf@gmail.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 65A4113219E for <netmod@ietfa.amsl.com>; Mon, 25 Sep 2017 19:57:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 8p4K3RvbvW6z for <netmod@ietfa.amsl.com>; Mon, 25 Sep 2017 19:56:57 -0700 (PDT)
Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 68168132D44 for <netmod@ietf.org>; Mon, 25 Sep 2017 19:56:57 -0700 (PDT)
Received: by mail-oi0-x22c.google.com with SMTP id p126so9960601oih.9 for <netmod@ietf.org>; Mon, 25 Sep 2017 19:56:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=qVY77SGLfqx9B3NGVo/GaGWV5wOtaUtmY6YAB+XY5MU=; b=gkLqNjxIJ/fRFttn+4hmwDYk841Yebo8nxnLodCV/U5Lia8n2GSAXqtJgDQqnLhHvW uID1oSOhtH+OcXu5iu7Y/YuJZ8Vr+XV2SSFMDzQEJ2tpyVcPZB1+yt8C85VqQ/pQ1evQ rJjnmEdF5+qYpnPdT2JKfpFUCXtXZhdKjikZjsMX/x7O2nNlOXBZkJi5eyGYBHZgdLDp QdHrX1NswWgSnLHtRy90XhiGh7MfroVL1oeiDA8PDbNl+S+80/ojBMvt0AYRzdymDgwm quUoKf6osXZpM/oB/6iz2VcZoRsAubOKBfAQxjWUbZ5Dd8ENv4kBjq9F1inBPYA2rU0A y+Yg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=qVY77SGLfqx9B3NGVo/GaGWV5wOtaUtmY6YAB+XY5MU=; b=WJdypzZ4XfzyVLybgJRl0KqqJoZZK+KmOUGVSBwzuQc9+IFxzwPkbszvazcfCWbOZu /y6DXbS64Y/sauA2frTkmNatbUZQOeNBhE714AURA4jN4UsaMqR2TXgRVF4dXHFOGHNS 6OIqDf8pdbIyn7SUYuaQ5jn/uwESzRZOz4yN18aHHk9yRM+mYB2hn5aBwbWLYBpWh2Cw B+nZm6klNPCr8O/2HgTwdrADt1fMJC2Tk83KEozVX7/KSlTTVWBHRu6oCRuoRwpovkiL HEj2kd0LLNuW4N8N3LIzIXPYPpxiOBLVXmgjHQu+RpShr/KL2TdgCsYeThqrb1xBxMDm 5z6w==
X-Gm-Message-State: AHPjjUhffajyw7GWzeZ+auZoFhuzDaQ7A8obpaih05gvYxeuL9lUhEMj Btlm4jUX7W4iJcvKrVSB/Hc=
X-Google-Smtp-Source: AOwi7QCC/aNLMVEP0ij6W38uQC5Q24JnMTnkAS/OWHc9DBV7DilaAyOH01Yhnoq2csC37eMy4C50eg==
X-Received: by 10.202.107.9 with SMTP id g9mr7948015oic.144.1506394616791; Mon, 25 Sep 2017 19:56:56 -0700 (PDT)
Received: from xliuus (ip72-209-195-86.dc.dc.cox.net. [72.209.195.86]) by smtp.gmail.com with ESMTPSA id n13sm703867ote.29.2017.09.25.19.56.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Sep 2017 19:56:56 -0700 (PDT)
From: "Xufeng Liu" <xufeng.liu.ietf@gmail.com>
To: "'Martin Bjorklund'" <mbj@tail-f.com>, <acee@cisco.com>
Cc: <netmod@ietf.org>
References: <1505470900.18681.0.camel@nic.cz> <D5E153B9.C80CF%acee@cisco.com> <D5EEA5E2.C9623%acee@cisco.com> <20170925.193903.1777711656523405872.mbj@tail-f.com>
In-Reply-To: <20170925.193903.1777711656523405872.mbj@tail-f.com>
Date: Mon, 25 Sep 2017 22:56:54 -0400
Message-ID: <005601d33673$1d27c180$57774480$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQKwBGEFaMxUg+s4xnRBAtCiCR/z3QMcvPuxAYzk5ZACS8EYQ6DVMLPw
Content-Language: en-us
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/4Fq_YaELugtbRPutRLRKG6bdXlI>
Subject: Re: [netmod] Proposal to enhance the YANG tree output
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: Tue, 26 Sep 2017 02:57:02 -0000

To a user of the schema-mount, it is important to be able to visualize all key elements of the mounting mechanism: mount-point, mounted schema module, and parent-reference. The details can be worked out, but if any of these elements were not useful in the presentation, it would be questionable whether it had well-specified in the schema mount draft.

> -----Original Message-----
> From: netmod [mailto:netmod-bounces@ietf.org] On Behalf Of Martin
> Bjorklund
> Sent: Monday, September 25, 2017 1:39 PM
> To: acee@cisco.com
> Cc: netmod@ietf.org
> Subject: Re: [netmod] Proposal to enhance the YANG tree output
> 
> "Acee Lindem (acee)" <acee@cisco.com> wrote:
> > Martin, Lada, et al,
> >
> > While I don’t think we need additional annotations that Joe had
> > prototyped (at least not as the default), I strongly believe we need
> > to keep the ‘@‘ and ‘/‘ in the tree output for schema mount.
> 
> Can you explain what information "/" gives the reader?  Compare these two
> trees:
> 
>   +--mp vrf-root
>      +--rw rt:routing/
>         +--rw rt:router-id
> 
> and
> 
>   +--mp vrf-root
>      +--rw rt:routing
>         +--rw rt:router-id
> 
> What did the "/" in the first tree tell me that I don't see in the second tree?

[Xufeng] Because the schema mount draft allows an augmenting module not to be listed in the mounted schema list. The following two examples show two different configurations:

  +--mp root
     +--rw rt:routing/
     |  +--rw router-id?                 yang:dotted-quad
     |  +--rw control-plane-protocols
     |     +--rw control-plane-protocol* [type name]
     |        +--rw ospf:ospf/

where ospf augments rt, and has been listed in the mounting schema list.

  +--mp root
     +--rw rt:routing/
     |  +--rw router-id?                 yang:dotted-quad
     |  +--rw control-plane-protocols
     |     +--rw control-plane-protocol* [type name]
     |        +--rw ospf:ospf

where ospf augments rt, and has not been listed in the mounting schema list.


> 
> 
> 
> Then consider:
> 
>   +--ro if:interfaces@
> 
> and
> 
>   +--ro if:interfaces
>      +-- if:interface@
> 
> and
> 
>   +--ro if:interfaces@
>      +-- if:interface@
> 
> 
> Which ones are legal, and what do they mean?
> 
[Xufeng] The display shows the result of the XPath, right? Whether they are legal or not should be determined by the schema-mount draft, not by the displaying notation.

> 
> 
> /martin
> 
> While the former enhancement
> > provided details, the schema mount tree designations are every bit as
> > important as knowing, for example, whether or not a schema leaf is a
> > presence node.
> >
> > Thanks,
> > Acee
> >
> >
> > On 9/15/17, 9:56 AM, "Acee Lindem (acee)" <acee@cisco.com> wrote:
> >
> > >+1 - Also it is hard enough to format the tree output to fit in a
> > >+draft
> > >w/o further annotations (even with —-tree-line-length).
> > >Thanks,
> > >Acee
> > >
> > >
> > >On 9/15/17, 6:21 AM, "netmod on behalf of Ladislav Lhotka"
> > ><netmod-bounces@ietf.org on behalf of lhotka@nic.cz> wrote:
> > >
> > >>Andy Bierman píše v Čt 14. 09. 2017 v 08:43 -0700:
> > >>> Hi,
> > >>>
> > >>>
> > >>> Actually I liked the early pyang output that was concise and easy
> > >>>to remember.
> > >>> The current format gets very cluttered and there are too many
> > >>>little symbols  to remember them all.
> > >>
> > >>I agree.
> > >>
> > >>Lada
> > >>
> > >>>
> > >>>
> > >>> Andy
> > >>>
> > >>>
> > >>> On Thu, Sep 14, 2017 at 8:33 AM, Joe Clarke <jclarke@cisco.com> wrote:
> > >>> > I've been hacking on pyang, and I changed tree.py to add the
> > >>> > enum
> > >>>values
> > >>> > for enumeration types and identiyref bases for identityref types.
> > >>>Here
> > >>> > is an example:
> > >>> >
> > >>> > module: yang-catalog
> > >>> >     +--rw catalog
> > >>> >        +--rw modules
> > >>> >        |  +--rw module* [name revision organization]
> > >>> >        |     +--rw name                     yang:yang-identifier
> > >>> >        |     +--rw revision                 union
> > >>> >        |     +--rw organization             string
> > >>> >        |     +--rw ietf
> > >>> >        |     |  +--rw ietf-wg?   string
> > >>> >        |     +--rw namespace                inet:uri
> > >>> >        |     +--rw schema?                  inet:uri
> > >>> >        |     +--rw generated-from?          enumeration [mib, code,
> > >>> > not-applicable, native]
> > >>> >        |     +--rw maturity-level?          enumeration [ratified,
> > >>> > adopted, initial, not-applicable] ...
> > >>> >                                +--rw protocols
> > >>> >                                |  +--rw protocol* [name]
> > >>> >                                |     +--rw name
> > >>> > identityref -> protocol
> > >>> > ...
> > >>> >
> > >>> > My questions are:
> > >>> >
> > >>> > 1. Is this useful?
> > >>> >
> > >>> > 2. If so, can this be added to pyang (happy to submit a PR) and
> > >>> > draft-ietf-netmod-yang-tree-diagrams?
> > >>> >
> > >>> > 3. What changes to the output format would you recommend?
> > >>> >
> > >>> > Thanks.
> > >>> >
> > >>> > Joe
> > >>> >
> > >>> > _______________________________________________
> > >>> > netmod mailing list
> > >>> > netmod@ietf.org
> > >>> > https://www.ietf.org/mailman/listinfo/netmod
> > >>>
> > >>> _______________________________________________
> > >>> netmod mailing list
> > >>> netmod@ietf.org
> > >>> https://www.ietf.org/mailman/listinfo/netmod
> > >>--
> > >>Ladislav Lhotka
> > >>Head, CZ.NIC Labs
> > >>PGP Key ID: 0xB8F92B08A9F76C67
> > >>
> > >>_______________________________________________
> > >>netmod mailing list
> > >>netmod@ietf.org
> > >>https://www.ietf.org/mailman/listinfo/netmod
> > >
> >
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod