Re: [Netconf] How to grep through a YANG? With grepyang

"Bert Wijnen (IETF)" <bwietf@bwijnen.net> Mon, 26 March 2018 09:18 UTC

Return-Path: <bwietf@bwijnen.net>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5BC8A1205F0 for <netconf@ietfa.amsl.com>; Mon, 26 Mar 2018 02:18:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] 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 qa4sG5p1Iygs for <netconf@ietfa.amsl.com>; Mon, 26 Mar 2018 02:18:19 -0700 (PDT)
Received: from lb1-smtp-cloud7.xs4all.net (lb1-smtp-cloud7.xs4all.net [194.109.24.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 483551241FC for <netconf@ietf.org>; Mon, 26 Mar 2018 02:18:18 -0700 (PDT)
Received: from Macintosh-4.fritz.box ([IPv6:2001:981:602b:1:103f:fa93:72a4:ce22]) by smtp-cloud7.xs4all.net with ESMTPSA id 0OGcfaaF48U070OGdfnmUn; Mon, 26 Mar 2018 11:18:17 +0200
To: otilibil@eurecom.fr, netconf@ietf.org
References: <20180325005541.sueg54vjhss0ssgs@webmail.eurecom.fr>
From: "Bert Wijnen (IETF)" <bwietf@bwijnen.net>
Message-ID: <ffa6678f-071a-7670-93fa-5669cbcada36@bwijnen.net>
Date: Mon, 26 Mar 2018 11:18:14 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <20180325005541.sueg54vjhss0ssgs@webmail.eurecom.fr>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
X-CMAE-Envelope: MS4wfFl/U90LlAxG9Qq+50rvnjLmT+uiVCNfyKEVc8zTWAMW5G8gQ4CpJkwAh3pIr5yRGMDK0HqknU7K3Lgde5wcp1TrH8nfWjS7sXoZ/f3Sym87xkvsXUw4 /0OAfufANLFdcQPTAbArMz1pPoEdpRCHLF6yPpPM/W+2q424u+Nb5k00Jp169iDTIQ0KsaspVO8j+IvascPoMJjPfYrjjX652rzwL4bcwWxlcmcqrhKtktze dIx9Br/qT2jpNCW7dEV7uUKRSfV7RHyjQ15z5l6RFWU=
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/iGWdsBRLFmHA9dC9yAEaOG45H3Y>
Subject: Re: [Netconf] How to grep through a YANG? With grepyang
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 26 Mar 2018 09:18:21 -0000

Looks like an interesting too.

Bert

On 25/03/2018 00:55, otilibil@eurecom.fr wrote:
> 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
>
> _______________________________________________
> Netconf mailing list
> Netconf@ietf.org
> https://www.ietf.org/mailman/listinfo/netconf
>