Subject: [netmod] YAng-Tree for a YANG structure

From: Balázs Lengyel <[email-masked]>
Date: Wed, 3 Apr 2019 14:46:17 +0000

Hello,

In draft-ietf-netmod-yang-data-ext
the extension structure is defined. In my draft about instance
data format I plan to use this in a YANG model. Kent raised the
question about providing a YANG Tree description of the model.

Is there any idea how the data nodes inside a yang "structure"
should be represented in a tree? Any idea when pyang will be
prepared for that?

regards Balazs

--
Balazs Lengyel Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909 email: [email-masked]

---

From: Jan Lindblad <[email-masked]>
Date: Wed, 3 Apr 2019 17:30:31 +0200

Balazs,
> In draft-ietf-netmod-yang-data-ext <https://tools.ietf.org/wg/netmod/draft-ietf-netmod-yang-data-ext/> the extension structure is defined. In my draft about instance data format I plan to use this in a YANG model. Kent raised the question about providing a YANG Tree description of the model. 
> 
> Is there any idea how the data nodes inside a yang "structure" should be represented in a tree? Any idea when pyang will be prepared for that?
> 
FWIW, here is a format I have used:

Best Regards,
/jan

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 04 Apr 2019 10:38:59 +0200 (CEST)

Hi,

Balázs Lengyel <[email-masked]> wrote:
> Hello,
> 
> In draft-ietf-netmod-yang-data-ext the extension structure is
> defined. In my draft about
> instance data format I plan to use this in a YANG model. Kent raised
> the question about
> providing a YANG Tree description of the model.
> 
> Is there any idea how the data nodes inside a yang "structure" should
> be represented in a
> tree?

I suggest just like yang-data:

module: example-module

  structure address-book:
    +-- address* [last first]
       +-- last      string
       +-- first     string
       +-- street?   string
       +-- city?     string
       +-- state?    string

I will add text to the draft that defines this.

> Any idea when pyang will be prepared for that?

I have added support for this on the branch feature/yang-structure.
It verifies the grammar and adds the option --tree-print-structures.
It doesn't handle augment-structure yet.

/martin