Re: [netmod] tree diagrams - flags

Martin Bjorklund <mbj@tail-f.com> Tue, 21 March 2017 10:36 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 2D7BB129445 for <netmod@ietfa.amsl.com>; Tue, 21 Mar 2017 03:36:28 -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, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 vNjhp0Js5PwM for <netmod@ietfa.amsl.com>; Tue, 21 Mar 2017 03:36:26 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 8685B129483 for <netmod@ietf.org>; Tue, 21 Mar 2017 03:36:26 -0700 (PDT)
Received: from localhost (unknown [173.38.220.40]) by mail.tail-f.com (Postfix) with ESMTPSA id 328D61AE0310; Tue, 21 Mar 2017 11:36:24 +0100 (CET)
Date: Tue, 21 Mar 2017 11:36:29 +0100
Message-Id: <20170321.113629.1388013607646336532.mbj@tail-f.com>
To: j.schoenwaelder@jacobs-university.de
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <20170321102533.GC35449@elstar.local>
References: <20170321102533.GC35449@elstar.local>
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/fZ1ek-i8Ci7rmusKUckBZBWE72c>
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:36:28 -0000

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)

I'm fine with this, but perhaps use "no" for notification data - "t"
means "true" in "ct".

Also, in a grouping like this:

 grouping my-grouping {
    leaf param { type string; }
  }

pyang prints this as:

  my-grouping
      +---- param?   string

i.e., w/o any flags.


> (And I think the oops leafs should have triggered an error.)

They did.  To stderr.


/martin