Re: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice? (was RE: YangPush now)

"Eric Voit (evoit)" <evoit@cisco.com> Fri, 27 July 2018 20:27 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 EFD0A130DF5; Fri, 27 Jul 2018 13:27:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.511
X-Spam-Level:
X-Spam-Status: No, score=-14.511 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, 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 tQ_ZrJleh8eV; Fri, 27 Jul 2018 13:27:30 -0700 (PDT)
Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5DCD2129385; Fri, 27 Jul 2018 13:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3896; q=dns/txt; s=iport; t=1532723250; x=1533932850; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zEIONhHP2H7JPuk99fnp+LRpz6WSUYYYBJMXpk1sTjQ=; b=GUwNWTvwYvdEaB2KNQR7jCLLhsY9FiECF0o0S/Bq16mzMHVNNkxcxJRP MmOQyvKzMWRK85OjZ2Rc+mOLYuPYz5kIbYHugm2JKGs0cSNXhgFD6HCQJ PR5sR3iFDKRzeNU0yvhNgPzzB3TMJMrf1gdx7NCEDtiP2b+MR+JrveWGZ w=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DzBAAtf1tb/49dJa1SCRkBAQEBAQE?= =?us-ascii?q?BAQEBAQEHAQEBAQGDToFiMoN0lEKCDIM7lBALhGwCF4JkITgUAQIBAQIBAQJ?= =?us-ascii?q?tKIU2AQEBAQIBIxFFBQsCAQYCDgcFAgkdAgICMBUQAgQBDQ2FEAiSBptHgS6?= =?us-ascii?q?KT4ELh3cXgUE/gRGDEoRTBBCDF4I1IAKMaI0jCQKPLI4Okg0CERSBJDQhgVJ?= =?us-ascii?q?wFTuCaoIkFxGOBo1+gS2BGwEB?=
X-IronPort-AV: E=Sophos;i="5.51,411,1526342400"; d="scan'208";a="419605532"
Received: from rcdn-core-7.cisco.com ([173.37.93.143]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2018 20:27:29 +0000
Received: from XCH-RTP-015.cisco.com (xch-rtp-015.cisco.com [64.101.220.155]) by rcdn-core-7.cisco.com (8.15.2/8.15.2) with ESMTPS id w6RKRTJQ019099 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 27 Jul 2018 20:27:29 GMT
Received: from xch-rtp-013.cisco.com (64.101.220.153) by XCH-RTP-015.cisco.com (64.101.220.155) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 27 Jul 2018 16:27:28 -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, 27 Jul 2018 16:27:28 -0400
From: "Eric Voit (evoit)" <evoit@cisco.com>
To: Kent Watsen <kwatsen@juniper.net>, "Andy Bierman (andy@yumaworks.com)" <andy@yumaworks.com>
CC: "yang-doctors@ietf.org" <yang-doctors@ietf.org>, "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice? (was RE: YangPush now)
Thread-Index: AQHUJd3mUJIkjRHDLUiZWlMutL6UIKSjn1YA///VOSCAAAA+MA==
Date: Fri, 27 Jul 2018 20:27:28 +0000
Message-ID: <2292ed599a8b45af99c29d8972854e04@XCH-RTP-013.cisco.com>
References: <727ae35abd394a85812168615acce2d3@XCH-RTP-013.cisco.com> <20180726221120.bv3mtlitoqqov2zm@anna.jacobs.jacobs-university.de> <1b58e76f527442c3a0fa34437b9f0cd4@XCH-RTP-013.cisco.com> <7a87a2c9-9af6-2555-e661-519e0352d1bf@cisco.com> <d88c590e29854474b3ca836c4d3c6853@XCH-RTP-013.cisco.com> <20180727161516.wnkkdpvm4smgtork@anna.jacobs.jacobs-university.de> <5ca9eb9cb9a34d819340374263ad696d@XCH-RTP-013.cisco.com> <CABCOCHRs=gbDByn_Me68j4JVE1UABPrYJ3-H2DSgRxzw41i_Pg@mail.gmail.com> <93889648-B180-49A2-9C8E-D2B0FAE127A9@juniper.net> <f33a115516854a7787388e8baf5aa364@XCH-RTP-013.cisco.com>
In-Reply-To: <f33a115516854a7787388e8baf5aa364@XCH-RTP-013.cisco.com>
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: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-Outbound-SMTP-Client: 64.101.220.155, xch-rtp-015.cisco.com
X-Outbound-Node: rcdn-core-7.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/F_GrBcsY58QMHl1kga3px2W2bSI>
Subject: Re: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice? (was RE: YangPush now)
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, 27 Jul 2018 20:27:32 -0000

> From: Kent Watsen, Friday, July 27, 2018 2:03 PM
> 
> > I would prefer to not add empty mandatory choices to any YANG module.
> > An empty choice is bad enough. In 2119 terms, using this container is
> > a SHOULD, not a MUST.
> 
> Moving past the syntax-level discussion:
> 
> 1) do you agree that a transport MUST be configured?
> 
>        - if not, then how is this a configuration model when half the config is
>          hidden behind vendor magic?  In my view, this pushes the limit of
>          reasonableness.

I think transport MUST be configured.   

But as today's transport configuration is vendor specific, I am not sure as to whether this is a requirement which the SN YANG model structure itself enforces.  (See next comment.)

>   2) do you agree that at most only one transport can be configured per
> "receiver"?

Yes.  

There are alternative ways to do this.  For example we could assert that when a "-notif" draft designer does a augmentation of transport specific objects, those augmentations MUST include XPATH constraint from those objects to a specific instance of "transport" under the subscription.   (E.g., you can only augment leafref instances pointing to ietf-netconf-server if the subscription's transport is "NETCONF".)  For example:


module ietf-netconf-subscribed-notifications {
 
  prefix nsn;
 
  import ietf-netconf-client { prefix ncc; }
  import ietf-subscribed-notifications { prefix sn; }

  identity netconf {
    base sn:transport;
    base sn:inline-address;
    description
      "NETCONF is used as a transport for notification messages and
       state change notifications.";
  }

  augment "/sn:subscriptions/sn:subscription/sn:receivers/sn:receiver" {
   when 'derived-from(../../../transport, "nsn:netconf")';   
   description
      "This augmentation allows NETCONF specific parameters to be exposed for a receiver.";
    leaf netconf-endpoint {
      type leafref {
        path "/ncc:netconf-client/ncc:initiate/ncc:netconf-server/ncc:endpoints/ncc:endpoint/ncc:name";
      }
      description
        "Remote client which need to initiate the NETCONF transport if an existing NETCONF session from that client is not available.";
    }
  }
  
}

With such models, one transport per receiver should result.

Eric

>         - this is perhaps arguable but, if needed, then I'd push for a list with
>           min-elements 1.   That said, why support multiple transports under
>           a single "receiver", when multiple "receiver" instances can be created,
>           one for each?   Additionally, it muddies what the text means by
>           "receiver state", as then there would have to be state per transport.
> 
> Kent // contributor