Re: [yang-doctors] choice entry, all operation

"Rob Wilton (rwilton)" <rwilton@cisco.com> Mon, 27 April 2020 10:25 UTC

Return-Path: <rwilton@cisco.com>
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 A95D43A0998 for <yang-doctors@ietfa.amsl.com>; Mon, 27 Apr 2020 03:25:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.598
X-Spam-Level:
X-Spam-Status: No, score=-9.598 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 header.b=em6+thZS; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=gJZrQZ1i
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 jB_962KjPpRI for <yang-doctors@ietfa.amsl.com>; Mon, 27 Apr 2020 03:25:34 -0700 (PDT)
Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DB2CD3A0995 for <yang-doctors@ietf.org>; Mon, 27 Apr 2020 03:25:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2683; q=dns/txt; s=iport; t=1587983133; x=1589192733; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=CZZrYLL3AzmYvgDYq7NQhQFjok04oOifrF8J4JLuTCk=; b=em6+thZShfVQP8LrS5dSLJu8bKDMMy1CIr5oNpMmi+0yUrXS614JtAsD NsrEBJ/4W+/NixN7QZ6oZm+vTLA66s8A+qDVskFPMb6uEGOsiQ5GnXOSK 1FCnHgZivJKWK+9Ejxbzo6OKwvyyZM4hUpqlMjJr2sQ6F1R/+p2O9izOa w=;
IronPort-PHdr: 9a23:/SdsXxTOye1n3wv/EdtCh5V7Gdpsv++ubAcI9poqja5Pea2//pPkeVbS/uhpkESXBdfA8/wRje3QvuigQmEG7Zub+FE6OJ1XH15g640NmhA4RsuMCEn1NvnvOjYlHcBeU1lN9HCgOk8TE8H7NBXf
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0DrBwBisqZe/4gNJK1mHAEBAQEBBwEBEQEEBAEBPIFHgVRRBWxYIAQLKgqHWwOKcU6CEZgvglIDVAsBAQEMAQEYCwoCBAEBhEQCgigkOBMCAwEBCwEBBQEBAQIBBQRthVYMhXEBAQEBAgEBARAoBgEBLAQICwQCAQgOAwQBAR8QJwsdCAIEARIIGoMFgksDDiABAwumQAKBOYhhdIE0gwABAQWFLxiCDgMGgTiCY4laGoFBP4ERQ4FPfj6CZwEBgU0ag0KCCyKyJgqCRZgdnHuPep0GAgQCBAUCDgEBBYFpIoFWcBU7gmlQGA2RNINyhRSFQnQ1AgYIAQEDCXyLXS2BBgGBDwEB
X-IronPort-AV: E=Sophos;i="5.73,323,1583193600"; d="scan'208";a="760585763"
Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 27 Apr 2020 10:25:32 +0000
Received: from XCH-ALN-004.cisco.com (xch-aln-004.cisco.com [173.36.7.14]) by alln-core-3.cisco.com (8.15.2/8.15.2) with ESMTPS id 03RAPWHF024999 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 27 Apr 2020 10:25:32 GMT
Received: from xhs-rcd-003.cisco.com (173.37.227.248) by XCH-ALN-004.cisco.com (173.36.7.14) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Apr 2020 05:25:32 -0500
Received: from xhs-rtp-002.cisco.com (64.101.210.229) by xhs-rcd-003.cisco.com (173.37.227.248) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Apr 2020 05:25:31 -0500
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (64.101.32.56) by xhs-rtp-002.cisco.com (64.101.210.229) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 27 Apr 2020 06:25:31 -0400
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FSSnMwP9qTn3s0QS1pSEcvSXpRfcMAnNEJW1pIgKraZAbX9q/tXqQQLJz17MoFtIQzuRixhTbJtqLgOOgjEI9XdvRBR1mqnYOV0UZMx6pSoO/8A6ZRTIl+Nf8sY0Pl9xorGR0yYGlgTrw63RsI4rWekPXGwgTtC7DUMFdU6phoLpBKzfH1AnyKia4XeJI3tz93IobNSl25b9/0mSGwXmXKipuW/Sn05zNa6EanvtH/LdZ8M/KI5B7P955GLTe64gJi0PRoVYoNzMlu0oHFgRDR8Rk62kY6+MfSTvDA0CYuqrqGG3BR7xILzNS8iTkfliPLrVt0c25HBlnXIai8apzg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2tHAePxbWp2zwZ551MMGfvppRxhvl6USFtBQDA4N5j8=; b=mjVw6OfJrbe5WL+AZTjaq7PmsZgUafxxY1ryQlWs2AHT2Q2dw088NWJJzKKp/EnOdUhwFzCeqAOXUiXEjZ42IHbKRRrvI1hOP9DXHxuUhRo6cfVAErBq9l14ZxUL871cj46yFkllHjTT0fq+4R2MHrJN2vIHGzsNKai/Dx+RPaAl9ZcjXwYftXN2+K0/P4+80ffxo0zrOVi57+KQoG5NIPcR25Nl/N0FsndXzF1MaTykbr4mqeX6C3nHO0xzn8BRmfW34fgm5atgXccrfXOu9ff8fSoYHql7ppDCDPafaxz4zxwYeLVltYvMhbv0D66H+82983und2wYQb7kpwTLRQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2tHAePxbWp2zwZ551MMGfvppRxhvl6USFtBQDA4N5j8=; b=gJZrQZ1iLQYK3c22rP8YGLFrkx8ovCILoLi38us63I3fbS8ZbALzzeFTUa5w7AudaPRfU6Gpdd8jT1b1AE0nuxkvKqh9HfCyKetcN8TH6lUz9uVxIPWu6m4tUNOO/H0Faq6SoWRsFOClFAguFtMaM5zZhV+t1zQxIMk8/70nKr4=
Received: from MN2PR11MB4366.namprd11.prod.outlook.com (2603:10b6:208:190::17) by MN2PR11MB3903.namprd11.prod.outlook.com (2603:10b6:208:136::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 10:25:30 +0000
Received: from MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::3:2164:a8e2:33b3]) by MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::3:2164:a8e2:33b3%5]) with mapi id 15.20.2937.023; Mon, 27 Apr 2020 10:25:30 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: Christian Hopps <chopps@chopps.org>, YANG Doctors <yang-doctors@ietf.org>
Thread-Topic: [yang-doctors] choice entry, all operation
Thread-Index: AQHWF9knUqeymLiWZEmD8In0TfspA6iMx1yw
Date: Mon, 27 Apr 2020 10:25:29 +0000
Message-ID: <MN2PR11MB4366151D3F311904151B8A32B5AF0@MN2PR11MB4366.namprd11.prod.outlook.com>
References: <0BB905FF-816C-4F3D-8718-754F87743464@chopps.org>
In-Reply-To: <0BB905FF-816C-4F3D-8718-754F87743464@chopps.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rwilton@cisco.com;
x-originating-ip: [82.15.79.32]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 8121c414-86c1-497a-e0d8-08d7ea954f7c
x-ms-traffictypediagnostic: MN2PR11MB3903:
x-microsoft-antispam-prvs: <MN2PR11MB3903DB2F80EE10EC194104CDB5AF0@MN2PR11MB3903.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0386B406AA
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4366.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(39860400002)(396003)(376002)(346002)(366004)(2906002)(5660300002)(110136005)(33656002)(8936002)(316002)(76116006)(186003)(52536014)(478600001)(81156014)(86362001)(8676002)(26005)(66446008)(64756008)(9686003)(66476007)(6506007)(71200400001)(53546011)(66556008)(966005)(66946007)(55016002)(7696005); DIR:OUT; SFP:1101;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 2ygUJvEEv6V7gV80jNePejzITyDllntP5s9EmGP9rdoEjrSBwmUuub4KHuEAU4tL4jPvJyuYawBSw3akQRddJ4IrH8Xzmf7MtacVvhRNI5u45AsDd/1/9ZSZSWjWX1XD1xBjrk5xmTiISkTpo7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PmjBDLJghZ5IjBIf7oAdJpiY1Wk7Zy93fa5h4INyhAZuw9rRVlb4OGCVHXzOnLHSD4FlTCD56eLn1YSmQWzCgnKZoeS50wbBOFEVhih5iykJP18nBSB5CHiRzj+DorA08yTFlYRE=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 8121c414-86c1-497a-e0d8-08d7ea954f7c
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2020 10:25:29.9386 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 0V1s5refAkRBsk2JxzdQiewQQKxdnp9anMF4AQ6xZUQRFDUBxze7Y4sFvf1Mu0r3kNOuLSAooSeyj8zvBxpa2Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3903
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.14, xch-aln-004.cisco.com
X-Outbound-Node: alln-core-3.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/jqqb9qevXnjIlJH6pqdNm4dRlo8>
Subject: Re: [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: Mon, 27 Apr 2020 10:25:36 -0000

Hi Chris,

> -----Original Message-----
> From: yang-doctors <yang-doctors-bounces@ietf.org> On Behalf Of Christian
> Hopps
> Sent: 21 April 2020 13:34
> To: YANG Doctors <yang-doctors@ietf.org>
> Subject: [yang-doctors] choice entry, all operation
> 
> 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?
[RW] 

Just considering the packet size example:

One option could be:
- Define 3 config true leaves, and put must constraints on two of them so that only one of the leaves can be configured, and then have a comment in the description to indicate that the must constraint isn't enforced in operational.  Possibly, we should consider for YANG.next whether there should be a keyword to mark some constraints as only applying to configuration, or operational data. 

The other option would be to split the operational values out, as you suggest, but that loses the config/state relationship.

Regards,
Rob

[As an individual contributor]

> 
> Thanks,
> Chris.
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors