Re: [netmod] [Anima] mcr's YANG question raised during the ANIMA WG session

Michael Richardson <mcr+ietf@sandelman.ca> Thu, 24 November 2022 00:35 UTC

Return-Path: <mcr+ietf@sandelman.ca>
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 1A649C14CEE0; Wed, 23 Nov 2022 16:35:07 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=sandelman.ca
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R-wT-OHV2mqz; Wed, 23 Nov 2022 16:35:01 -0800 (PST)
Received: from tuna.sandelman.ca (tuna.sandelman.ca [209.87.249.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 087EEC14F74F; Wed, 23 Nov 2022 16:35:00 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by tuna.sandelman.ca (Postfix) with ESMTP id 1AB8B18010; Wed, 23 Nov 2022 20:00:41 -0500 (EST)
Received: from tuna.sandelman.ca ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sb1f_8CHG0Yr; Wed, 23 Nov 2022 20:00:40 -0500 (EST)
Received: from sandelman.ca (unknown [IPv6:2607:f0b0:f:2:56b2:3ff:fe0b:d84]) by tuna.sandelman.ca (Postfix) with ESMTP id 9588E1800C; Wed, 23 Nov 2022 20:00:40 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandelman.ca; s=mail; t=1669251640; bh=bAaevAhkBYi5ZfCo2eGx5Z4PbMWLPgqTWW3e/g7oeO0=; h=From:to:Subject:In-Reply-To:References:Date:From; b=dLBHGvwb4RnGHk+NwG88D+1yief61imHdxm2NHAhxf1Q3HYKxTnkZ4X1i/ZO2ggMC hWfbrBlw8RI3BHJmW7NQoIrulLKS/bYwbsp6juEbs68Ta//mttD84pHy6VNC/xuPnT 5puCkhLiMVuDfwSexxpNIc6Ucg9SLXB86hfbUQT9Ica7uD0fZFTDT6XVZiRJUkadja yGhPe28nS3OLPNE/kOpDWaurqJyX6sAkST8grjKBEdVm0Y4lJQhpKJ58+gs4kQJyUt grkA4Cay5TPplFZgZV3L9TauGeUjtbHu3hPfPN9UK7zAlw5WkL2XLrdQuAGog03XGJ vlXLm89GDF1Uw==
Received: from localhost (localhost [IPv6:::1]) by sandelman.ca (Postfix) with ESMTP id 2A0273C3; Wed, 23 Nov 2022 19:34:59 -0500 (EST)
From: Michael Richardson <mcr+ietf@sandelman.ca>
to: Jan Lindblad <janl@tail-f.com>, "Anima@ietf.org" <anima@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
In-Reply-To: <809554.1668382696@dyas>
References: <DU0PR10MB5196F26C92DD2F266A4FAC28F3949@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <365823.1658933390@dooku> <DU0PR10MB5196ADB3702B7417B0589555F3979@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <446675.1659033968@dooku> <DU0PR10MB51966008D0EA49AC6FCD3FB9F3999@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <539974.1659103385@dooku> <YuhrI/iINFJxPOC7@faui48e.informatik.uni-erlangen.de> <32336.1659550668@localhost> <58217DD1-D5C2-4C99-BDF9-5BA5B252AE56@tail-f.com> <809554.1668382696@dyas>
X-Mailer: MH-E 8.6+git; nmh 1.7+dev; GNU Emacs 27.1
X-Face: $\n1pF)h^`}$H>Hk{L"x@)JS7<%Az}5RyS@k9X%29-lHB$Ti.V>2bi.~ehC0; <'$9xN5Ub# z!G,p`nR&p7Fz@^UXIn156S8.~^@MJ*mMsD7=QFeq%AL4m<nPbLgmtKK-5dC@#:k
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha512"; protocol="application/pgp-signature"
Date: Wed, 23 Nov 2022 19:34:59 -0500
Message-ID: <15063.1669250099@localhost>
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/UW37PKzYycxmeJrnKE1gweYWUGU>
Subject: Re: [netmod] [Anima] mcr's YANG question raised during the ANIMA WG session
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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, 24 Nov 2022 00:35:07 -0000

I have taken a third pass at getting the extension of yang modules done.
This time, I am using RFC8791 (Structure), rather than YANG-DATA.
I do not use Augment (or structure-augment).  Not sure how I would.

My module D, which wants to inherit from A, B and C, even though B and C also
inherit from A, looks like this:

  sx:structure module-D-things {
    uses module-D;
  }

  grouping module-D {
    description "A module D structure";
    container module-D {
      description "A wrapper container for the module-D things";
      uses vA3:module-A-contents;
      uses vB3:module-B-contents;
      uses vC3:module-C-contents;
      uses module-D-contents;
    }
  }

  grouping module-D-contents {
    leaf attribute-D-Delta {
      type binary;
      description "DeltaThree";
    }
  }

This produces a tree printout of:

module: module-D3

  grouping module-D:
    +-- module-D
       +-- attribute-A-Alpha?   binary
       +-- attribute-B-Beta?    binary
       +-- attribute-C-Gamma?   binary
       +-- attribute-D-Delta?   binary
  grouping module-D-contents:
    +-- attribute-D-Delta?   binary

This is not great, but better than before.
The results are still at:

    https://github.com/mcr/yang-augment-test
    look at module-?3.yang and practice3.sh.

Please tell me/us (ANIMA WG) if we can do better.
We have revisions to RFC8366 that we'd like to go forward with, but we need
to make sure that we accomodate the extensions that are planned.
Probably converting to RFC8791 is also a good thing.

--
Michael Richardson <mcr+IETF@sandelman.ca>   . o O ( IPv6 IøT consulting )
           Sandelman Software Works Inc, Ottawa and Worldwide