Re: [Netconf] YANG Doctor question: empty mandatory choice?

"Eric Voit (evoit)" <evoit@cisco.com> Fri, 03 August 2018 20:32 UTC

Return-Path: <evoit@cisco.com>
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 37E711310D8 for <netconf@ietfa.amsl.com>; Fri, 3 Aug 2018 13:32:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.509
X-Spam-Level:
X-Spam-Status: No, score=-14.509 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, 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
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 LiXC_LiGG3oY for <netconf@ietfa.amsl.com>; Fri, 3 Aug 2018 13:32:26 -0700 (PDT)
Received: from rcdn-iport-7.cisco.com (rcdn-iport-7.cisco.com [173.37.86.78]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2B662130F25 for <netconf@ietf.org>; Fri, 3 Aug 2018 13:32:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=10616; q=dns/txt; s=iport; t=1533328346; x=1534537946; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=nrDUqmd+A7q9Tr3w7uQFgiV488efFzPJTjoLvyTe8ak=; b=LCL0j0CRH3oi3I+M7hKoky91MBkr0VeK48wgAWiDZo78k4bmrC8A3iZF 3xESOl3Frbq18JUN2gTREP4nZZibMsG4gLAsD0qf3DV1UbjQ8iyFNcsdm 80o4+YMZWA9oznliMV/lAOBKWRZh/TLwdauTvZSqjlcmWli4HBRjlJ00f M=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CaAAB/u2Rb/4UNJK1cGQEBAQEBAQEBAQEBAQcBAQEBAYJXd2N/KAqDdIgJjlKQQ4UbgXoLJYRHAheCdyE0GAECAQECAQECbRwMhTYBAQEDASMKTAULAgEIDgctAgICMCUCBAENDRODBoEbXAgPsgyBLh+KMQWJCReBQT+EJIMbAoRigjUgApotCQKPOo4hki8CERSBJB04gVJwFYMkixWFPm8BjwiBGwEB
X-IronPort-AV: E=Sophos;i="5.51,439,1526342400"; d="scan'208,217";a="430154533"
Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 20:32:12 +0000
Received: from XCH-RTP-008.cisco.com (xch-rtp-008.cisco.com [64.101.220.148]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTPS id w73KWCPY006062 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 3 Aug 2018 20:32:12 GMT
Received: from xch-rtp-013.cisco.com (64.101.220.153) by XCH-RTP-008.cisco.com (64.101.220.148) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 3 Aug 2018 16:32:11 -0400
Received: from xch-rtp-013.cisco.com ([64.101.220.153]) by XCH-RTP-013.cisco.com ([64.101.220.153]) with mapi id 15.00.1320.000; Fri, 3 Aug 2018 16:32:11 -0400
From: "Eric Voit (evoit)" <evoit@cisco.com>
To: Kent Watsen <kwatsen@juniper.net>, "Einar Nilsen-Nygaard (einarnn)" <einarnn@cisco.com>
CC: Alexander Clemm <alexander.clemm@huawei.com>, Martin Bjorklund <mbj@tail-f.com>, "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [Netconf] YANG Doctor question: empty mandatory choice?
Thread-Index: AQHUKEYUmUSBX283/kCJ9HawSKyfbKSprlCAgABGJYCAAuRYAIAADsAAgAHA1QD//9W/MA==
Date: Fri, 03 Aug 2018 20:32:11 +0000
Message-ID: <4f18c865cc6345989cc8bca055871215@XCH-RTP-013.cisco.com>
References: <44B0A74E-CCF0-4E9B-846A-1F46E90AEB5E@juniper.net> <20180731.165103.950825344221422538.mbj@tail-f.com> <644DA50AFA8C314EA9BDDAC83BD38A2E0EB406AA@sjceml521-mbx.china.huawei.com> <024DE375-E3F0-4255-AC53-2D17C77D6E06@juniper.net> <78F7B695-FB2A-4308-B031-B7447596B04B@cisco.com> <31F13F58-7931-49B3-8874-D57FDE2F81C9@juniper.net>
In-Reply-To: <31F13F58-7931-49B3-8874-D57FDE2F81C9@juniper.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.118.56.234]
Content-Type: multipart/alternative; boundary="_000_4f18c865cc6345989cc8bca055871215XCHRTP013ciscocom_"
MIME-Version: 1.0
X-Outbound-SMTP-Client: 64.101.220.148, xch-rtp-008.cisco.com
X-Outbound-Node: alln-core-11.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/S9PCm7odXanSGsu9XvCnLieI7V4>
Subject: Re: [Netconf] YANG Doctor question: empty mandatory choice?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.27
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: Fri, 03 Aug 2018 20:32:28 -0000

From: Kent Watsen, August 3, 2018 2:51 PM


> Agreed. Let’s just move past this issue

But what about this comment?

What I object to is the way that this restriction is currently implemented using identities, which requires the "notif" models to do something right.  Better would be a "must" expression that says the count of the descendants is exactly one.  Can you do that?

I'm not that familiar with XPath expressions, but would something like this work?

            must "count(distinct-values(//sn:receivers/sn:receiver)) = 1"

I don’t know how this would work as what you would be checking to see is if the augmented transport choice case types are common across all receivers.

Based on empty mandatory choice being ok, I have posted a new –v15 of SN.

https://www.ietf.org/internet-drafts/draft-ietf-netconf-subscribed-notifications-15.txt


If someone figures the XPATH to do what Kent suggests above, it can be seamlessly added.   But if nothing comes up, we can still progress using the earlier proposed solution.

Eric


Kent // contributor