[netmod] How to grep through a YANG? With grepyang

otilibil@eurecom.fr Sat, 24 March 2018 23:54 UTC

Return-Path: <otilibil@eurecom.fr>
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 5E238127010 for <netmod@ietfa.amsl.com>; Sat, 24 Mar 2018 16:54:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.911
X-Spam-Level:
X-Spam-Status: No, score=-1.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 Vbibatb_pOA3 for <netmod@ietfa.amsl.com>; Sat, 24 Mar 2018 16:54:00 -0700 (PDT)
Received: from smtp2.eurecom.fr (smtp2.eurecom.fr [193.55.113.211]) by ietfa.amsl.com (Postfix) with ESMTP id 7831512025C for <netmod@ietf.org>; Sat, 24 Mar 2018 16:54:00 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.48,356,1517871600"; d="scan'208";a="7833765"
Received: from thorgal.eurecom.fr ([10.3.2.220]) by drago2i.eurecom.fr with ESMTP; 25 Mar 2018 00:53:44 +0100
Received: (from apache@localhost) by thorgal.eurecom.fr (8.14.4+Sun/8.14.4/Submit) id w2ONriIT014366 for netmod@ietf.org; Sun, 25 Mar 2018 00:53:44 +0100 (CET)
X-Authentication-Warning: thorgal.eurecom.fr: apache set sender to otilibil@eurecom.fr using -f
Received: from lam06-2-82-234-168-183.fbx.proxad.net (lam06-2-82-234-168-183.fbx.proxad.net [82.234.168.183]) by webmail.eurecom.fr (Horde MIME library) with HTTP; Sun, 25 Mar 2018 00:53:44 +0100
Message-ID: <20180325005344.oh7t0dutic440sc0@webmail.eurecom.fr>
Date: Sun, 25 Mar 2018 00:53:44 +0100
From: otilibil@eurecom.fr
To: netmod@ietf.org
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"; DelSp="Yes"; format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
User-Agent: Internet Messaging Program (IMP) H3 (4.1.4)
X-Originating-IP: 82.234.168.183
X-Remote-Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/gW4ixTmFFC7xT3gVi8xJV-eBrBI>
Subject: [netmod] How to grep through a YANG? With grepyang
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: Sat, 24 Mar 2018 23:54:02 -0000

Hello members,

I have put on Github 'grepyang'  
(https://github.com/ariel-anieli/grepyang.git), a script  that greps  
through a YANG, and extracts snippets matching a key, it seems 'pyang'  
does not have that feature; for example:

# ./grepyang cancel-commit ietf-netconf@2011-06-01.yang
853:  rpc cancel-commit {
854:    if-feature confirmed-commit;
855:    description
856:      "This operation is used to cancel an ongoing confirmed commit.
857:       If the confirmed commit is persistent, the parameter
858:       'persist-id' must be given, and it must match the value of the
859:       'persist' parameter.";
860:    reference "RFC 6241, Section 8.4.4.1";
861:
862:    input {
863:      leaf persist-id {
864:        type string;
865:        description
866:          "This parameter is given in order to cancel a persistent
867:           confirmed commit.  The value must be equal to the value
868:           given in the 'persist' parameter to the <commit> operation.
869:           If it does not match, the operation fails with an
870:          'invalid-value' error.";
871:      }
872:    }
873:  }

If you have any feedback, please, do so: I will improve the tool from it.

Regards,
Ariel

-------------------------------------------------------------------------------
This message was sent using EURECOM Webmail: http://webmail.eurecom.fr