[yang-doctors] choice entry, all operation

Christian Hopps <chopps@chopps.org> Tue, 21 April 2020 12:33 UTC

Return-Path: <chopps@chopps.org>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6B4703A0AC5 for <yang-doctors@ietfa.amsl.com>; Tue, 21 Apr 2020 05:33:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001] 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 XjJRXuHfwZqR for <yang-doctors@ietfa.amsl.com>; Tue, 21 Apr 2020 05:33:52 -0700 (PDT)
Received: from smtp.chopps.org (smtp.chopps.org [54.88.81.56]) by ietfa.amsl.com (Postfix) with ESMTP id DF7B93A0AC6 for <yang-doctors@ietf.org>; Tue, 21 Apr 2020 05:33:51 -0700 (PDT)
Received: from stubbs.int.chopps.org (047-050-069-038.biz.spectrum.com [47.50.69.38]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by smtp.chopps.org (Postfix) with ESMTPSA id 612186109B; Tue, 21 Apr 2020 12:33:51 +0000 (UTC)
From: Christian Hopps <chopps@chopps.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Message-Id: <0BB905FF-816C-4F3D-8718-754F87743464@chopps.org>
Date: Tue, 21 Apr 2020 08:33:50 -0400
To: YANG Doctors <yang-doctors@ietf.org>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/AJbquHkvZe0svzhbxwRold4OqJM>
Subject: [yang-doctors] choice entry, all operation
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Apr 2020 12:33:55 -0000

I'm wondering about the best way to model a particular pattern I have coming up multiple times with NMDA in mind. I want the user to enter a value using a single form of the value, but I want to report (operationally) multiple forms based on that value.

Here are a couple examples:

- A packet size :: 3 choices, either "discover", an "outer" tunnel packet size, or an "inner" payload size.
- A bit rate :: 2 choices, either "L2 bitrate" or "L3 bitrate"

So for the packet size the user might use "discover" (which would use PMTU discovery to discover the "outer" size to use). This is for an IPsec tunnel so the "inner" payload size will be determined based on the "outer" size and the IPsec algorithms in use (variable overhead). Point being all 3 values are useful to see operationally.

Bit rate is a bit more straight-forward, but still if the user configures 10G for l2-bitrate its useful to be able to operationally query the l3-bitrate which would remove the L2 overhead.

"choice" is obvious for "config true", but fails for reporting all the "config false" operational values, so I'm wondering what is a better way?

Should I just use sibling leafs and leave validation up to the server on config application, or is this a case where I'm trying to do too much with NMDA, and I should just split the operational values out (and have the "config true" choice node be a duplicate of the operational value when it's operational value is fetched?

Thanks,
Chris.