Re: [netmod] tree diagrams - flags

Ladislav Lhotka <lhotka@nic.cz> Tue, 21 March 2017 10:49 UTC

Return-Path: <lhotka@nic.cz>
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 24E23129676 for <netmod@ietfa.amsl.com>; Tue, 21 Mar 2017 03:49:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7
X-Spam-Level:
X-Spam-Status: No, score=-7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 p1fYY8EqUGZx for <netmod@ietfa.amsl.com>; Tue, 21 Mar 2017 03:49:32 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 331A11293F3 for <netmod@ietf.org>; Tue, 21 Mar 2017 03:49:32 -0700 (PDT)
Received: from [IPv6:2001:718:1a02:1:d20:8e4d:8768:16f6] (unknown [IPv6:2001:718:1a02:1:d20:8e4d:8768:16f6]) by mail.nic.cz (Postfix) with ESMTPSA id D195E6090C; Tue, 21 Mar 2017 11:49:30 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1490093370; bh=UJz4e9shuKdcyJ1gBzNCz7VMIEQ/DSNa9zH9RXy6u8A=; h=From:Date:To; b=GemLrxzUmh6qEBfBcVHSc1CAf7M+4FtTpRmBV3KDwBbQpsDpkM5YwgLGG0ZAYjvuQ eRyNiOMMn9Mi6rJDiBAwgLS5Lpx0k1ewzXp1FS7JGw8Jh2CPRtcME1ohpaVKbeDeVQ T3NWQ7gQRMwTCRjjXWkRX9I3ZDKLqYVtZjBhCfE4=
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <20170321102533.GC35449@elstar.local>
Date: Tue, 21 Mar 2017 11:49:30 +0100
Cc: netmod@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <05D066C2-08AA-4140-9399-87654141F821@nic.cz>
References: <20170321102533.GC35449@elstar.local>
To: Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de>
X-Mailer: Apple Mail (2.3259)
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/3ihVDtHCOkRa4azOtiLbTHdjIbo>
Subject: Re: [netmod] tree diagrams - flags
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, 21 Mar 2017 10:49:34 -0000

> On 21 Mar 2017, at 11:25, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> 
> Hi,
> 
> if we want to standardize tree diagrams, we may want to take a more
> critical look at them, in particular the flags (that were created
> ad-hoc and in resemblance to MIB tree diagrams). pyang --tree-help
> says:
> 
>  <flags> is one of:
>    rw  for configuration data
>    ro  for non-configuration data
>    -x  for rpcs and actions
>    -n  for notifications
> 
> This is (a) incomlete and (b) somewhat confusing since ct does not
> equate to readwrite. I am attaching a sample yang file and here is the
> output pyang 1.7.1 produces:
> 
> module: tree-sample
>    +--rw config-true-container
>    |  +--rw param?   string
>    +--ro config-false-container
>    |  +--ro value?   string
>    +--rw inline-action
>    |  +---x action
>    |     +---- oops?     string
>    |     +---w input
>    |     |  +---w in?   string
>    |     +--ro output
>    |        +--ro out?   string
>    +--rw inline-notification
>       +---n notification
>          +---- duration?   string
> 
>  rpcs:
>    +---x rpc
>       +---w input
>       |  +---w in?   string
>       +--ro output
>       |  +--ro out?   string
>       +--ro oops?     string
> 
>  notifications:
>    +---n notification
>       +--ro boom?   string
> 
> I think a better usage of two letter flags would have been this (since
> it more naturally aligns with what the YANG definition says):
> 
>  <flags> is one of:
>    ct  for configuration data
>    cf  for non-configuration data
>    x-  for rpcs and actions
>    xi  for rpc or action input
>    xo  for rpc or action output
>    n-  for notifications
>    nt  for notification tree (this is I think the term 7950 uses)

Inside notifications and operations, "cf" carries no information and just clutters the output. My suggestion is to use "ct" or just "c" for config=true data and nothing elsewhere.

Lada

> 
> module: tree-sample
>    +--ct config-true-container
>    |  +--ct param?   string
>    +--cf config-false-container
>    |  +--cf value?   string
>    +--ct inline-action
>    |  +--x- action
>    |     +--xi input
>    |     |  +--xi in?   string
>    |     +--xo output
>    |        +--xo out?   string
>    +--ct inline-notification
>       +--n- notification
>          +--nt duration?   string
> 
>  rpcs:
>    +--x- rpc
>       +--xi input
>       |  +--xi in?   string
>       +--ro output
>          +--xo out?   string
> 
>  notifications:
>    +--n- notification
>       +--nt boom?   string
> 
> (And I think the oops leafs should have triggered an error.)
> 
> /js
> 
> -- 
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
> <tree-sample.yang>_______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67