[netmod] Proposal to enhance the YANG tree output

Joe Clarke <jclarke@cisco.com> Thu, 14 September 2017 15:33 UTC

Return-Path: <jclarke@cisco.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 8FF49132D67 for <netmod@ietfa.amsl.com>; Thu, 14 Sep 2017 08:33:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.521
X-Spam-Level:
X-Spam-Status: No, score=-14.521 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, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 EYWtgcGh9npn for <netmod@ietfa.amsl.com>; Thu, 14 Sep 2017 08:33:58 -0700 (PDT)
Received: from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 398DD124239 for <netmod@ietf.org>; Thu, 14 Sep 2017 08:33:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1240; q=dns/txt; s=iport; t=1505403238; x=1506612838; h=to:from:subject:message-id:date:mime-version: content-transfer-encoding; bh=QyGord9g/E4N8E9QMc4Cz5nwbTvPpy7U586F8Qss7V4=; b=iR8A51Ir1lid/m2Vu5Jko3e2EFtmg5gRW6ywjN/cjq/KMLKqVlAchjfb zUb7ugsRrWnaJC7ZDh534FDl/iWBxdJCKcNhlh3mDTtbMBpfaZU28dxzB ZrgHDMesisJ9RgXMzPOKrVrfy4+bG9Qz6U/p0BZVCnpZVbZw6J+CnafJ2 A=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AMAwBHoLpZ/4sNJK1dGwEBAQMBAQEJA?= =?us-ascii?q?QEBg1pkbieDd5tamGUKG4lHQxQBAgEBAQEBAQFrHQuFQgQLAXsCJgJfDQgBAYo?= =?us-ascii?q?urCKBbTqLMgEBCAImgQ6CHYICgVCCDosIgmAFjCeFB4cPiEWBbIVujHiCbohnh?= =?us-ascii?q?yGVMYE5NiGBDVMkFYgCJDaIbQEBAQ?=
X-IronPort-AV: E=Sophos;i="5.42,393,1500940800"; d="scan'208";a="77420358"
Received: from alln-core-6.cisco.com ([173.36.13.139]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2017 15:33:57 +0000
Received: from [10.118.87.94] (rtp-jclarke-nitro13.cisco.com [10.118.87.94]) by alln-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id v8EFXvMm002844 for <netmod@ietf.org>; Thu, 14 Sep 2017 15:33:57 GMT
To: "netmod@ietf.org" <netmod@ietf.org>
From: Joe Clarke <jclarke@cisco.com>
Organization: Cisco
Message-ID: <9d84d068-29ba-8e89-394f-b7f6a5272adc@cisco.com>
Date: Thu, 14 Sep 2017 11:33:56 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/bK-Pf8E8xclUQ78c9GMijTkgDNY>
Subject: [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: Thu, 14 Sep 2017 15:33:59 -0000

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