Re: [yang-doctors] Consistency for naming lists and leaf-lists

"Acee Lindem (acee)" <acee@cisco.com> Fri, 29 November 2019 16:12 UTC

Return-Path: <acee@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 498B512099C for <yang-doctors@ietfa.amsl.com>; Fri, 29 Nov 2019 08:12:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 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, 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=RPG6qlX6; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=TN3vEOx5
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 BdD1tagw88D3 for <yang-doctors@ietfa.amsl.com>; Fri, 29 Nov 2019 08:12:03 -0800 (PST)
Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6CEE112098B for <yang-doctors@ietf.org>; Fri, 29 Nov 2019 08:12:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=19477; q=dns/txt; s=iport; t=1575043923; x=1576253523; h=from:to:subject:date:message-id:mime-version; bh=vytnufXvKJkM0Y8v/YIhquDYlSbIzHHImddHVDM1250=; b=RPG6qlX6+Z6hp1fUX4uzlgaFqpfJHsEmWFK3ultPdJITrkshXXqbOYOW wAA2EZycgngY0N9Gwj4bZrL6gMjcQ1WHK9Ao7nuytCKdEzikmVVgZ5hDx 1uOXgm3/q7H+bXABUoXVLKFzdpLWxMDAwcmIF4yjHKC0ABGX+OGXHcMe2 U=;
IronPort-PHdr: 9a23:JGYjvRd6YSoch4UPoHeSGWdZlGMj4e+mNxMJ6pchl7NFe7ii+JKnJkHE+PFxlwKUD57D5adCjOzb++D7VGoM7IzJkUhKcYcEFlcejNkO2QkpAcqLE0r+effhYiESF8VZX1gj9Ha+YgBY
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0ClEQA+QuFd/5FdJa1mHQEBAQkBEQUFAYF+gRwvUAVsWCAECyqEK4NGA4pxToIRkyKEYoJSA1QJAQEBDAEBLQIBAYRAGYFzJDgTAgMNAQEEAQEBAgEFBG2FNwyFUgEDAxIRChMBATgRAQgRAwECKwIEMB0KBAESIoMAAYF5TQMuAQKoBwKBOIhgdYEygn4BAQWCSoJWGIIXCYE2jBYaggCBOCCCHi4+hGmCcDKCCiKQGoVMJJdIcAqCLpVZG4JBl2KOSoFCmFUCBAIEBQIOAQEFgWkiKoEucBU7KgGCQVARFIhUDBeDUIpTdIEojUYBAQ
X-IronPort-AV: E=Sophos;i="5.69,257,1571702400"; d="scan'208,217";a="383598011"
Received: from rcdn-core-9.cisco.com ([173.37.93.145]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 29 Nov 2019 16:12:02 +0000
Received: from XCH-ALN-010.cisco.com (xch-aln-010.cisco.com [173.36.7.20]) by rcdn-core-9.cisco.com (8.15.2/8.15.2) with ESMTPS id xATGC1RH012898 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL) for <yang-doctors@ietf.org>; Fri, 29 Nov 2019 16:12:01 GMT
Received: from xhs-aln-001.cisco.com (173.37.135.118) by XCH-ALN-010.cisco.com (173.36.7.20) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 29 Nov 2019 10:12:01 -0600
Received: from xhs-aln-002.cisco.com (173.37.135.119) by xhs-aln-001.cisco.com (173.37.135.118) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 29 Nov 2019 10:12:00 -0600
Received: from NAM01-SN1-obe.outbound.protection.outlook.com (173.37.151.57) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 29 Nov 2019 10:12:00 -0600
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CnaxlOWaSHRIp9FI2qdfxREtvKWe5Du5WyI3Sdff5nwPidZz6r+x9ndaCQb8BI0ULDX2VheV5W71NFqka4xc/HxqIvkUsQ1hYadeqMVmqITVIZHeKokfpxta522ekT4InF0gSyhbZ6g4YNclQGVT54/w3hLWfXycDmtyTY3HWC33dyhtuBAd5pPQWi0mraYqWQp0eaYwAqfRGazBnYzguIXFc3p0yp4/6iAYgm8zyeVLrK6bTRHcOT89nleyvaJ3JaczmnLCEapkctHcZXFd8oLhr20vi6NpIsqsJkWH8oNgovlyXNJLCv2BPKMDTFfl6qTr7kK+65izAqwGZGOczQ==
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=vytnufXvKJkM0Y8v/YIhquDYlSbIzHHImddHVDM1250=; b=i6pfJr2z4V1wzvrj1tSVjxxCOf4fUu7V+zdHOHveYA4PyUgWTnIjZuWukKQLrrTozpJSsMF78cykGW9vHD9J/FF9S81nn14cKEQmCIX8t08OM44HYKo9UCehboiczM961eIKfN8XHcMQu08gwd83POWPRNnrGcUkv/Gggs9E9MLxJ3jHVT+jE4gmNwDt6YsAtVcTFRvLkojVF9Xk6hSjUna+YjqtOf5TpOZJ51J3CelVBeeKcc1fChHTtwH9QZig7dMIfZ2aGcdiFNvkSrPsEbtqTuunDd2XkJSiUtlV/7GJa5WpA0RwpFzpWxDoo0fD0aNJ47bx4IswxeY4YYLdDQ==
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=vytnufXvKJkM0Y8v/YIhquDYlSbIzHHImddHVDM1250=; b=TN3vEOx5PPm8QE0sYo3ZfGbsRarClr1rXcWq0ngi85mCbm6MAQU/JAQe1piEa7syo1H3E2ibaQuFNVshQ0Zey4IMu4hA4gHY6/3GiPWtco5fr1GhRrQlggaGna/PDlbmyuqi7Op8k60hQHeNPrIj1q9Mco2GRNShrroC0iJTuZQ=
Received: from MN2PR11MB4221.namprd11.prod.outlook.com (52.135.38.14) by MN2PR11MB3789.namprd11.prod.outlook.com (20.178.252.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20; Fri, 29 Nov 2019 16:11:56 +0000
Received: from MN2PR11MB4221.namprd11.prod.outlook.com ([fe80::218b:2d04:e653:105]) by MN2PR11MB4221.namprd11.prod.outlook.com ([fe80::218b:2d04:e653:105%7]) with mapi id 15.20.2474.023; Fri, 29 Nov 2019 16:11:56 +0000
From: "Acee Lindem (acee)" <acee@cisco.com>
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>
Thread-Topic: [yang-doctors] Consistency for naming lists and leaf-lists
Thread-Index: AQHVps+4EuwjnKUOGEWGmujBRU//Sg==
Date: Fri, 29 Nov 2019 16:11:56 +0000
Message-ID: <19B68566-741D-408A-871D-4C99E09643FB@cisco.com>
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=acee@cisco.com;
x-originating-ip: [2001:420:c0c4:1004::238]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: eebf60a1-b951-498e-11ed-08d774e6db1f
x-ms-traffictypediagnostic: MN2PR11MB3789:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <MN2PR11MB3789D5F561B3112809C326F7C2460@MN2PR11MB3789.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0236114672
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(376002)(136003)(396003)(39860400002)(189003)(199004)(51444003)(33656002)(8936002)(7736002)(5660300002)(81166006)(256004)(8676002)(14444005)(81156014)(6506007)(36756003)(25786009)(53546011)(64756008)(66946007)(99286004)(14454004)(66446008)(478600001)(2501003)(76116006)(86362001)(66476007)(66556008)(6116002)(229853002)(6436002)(110136005)(6512007)(71190400001)(6246003)(54896002)(2616005)(2906002)(71200400001)(316002)(46003)(186003)(102836004)(9326002)(6486002)(6306002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3789; H:MN2PR11MB4221.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
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: rw75VaVGJNUZTJpeean5qEx30vwPJQKkv3JorParWMCXjweyNXivVN6BWAU3EIjdHxEQFgMFUmBSQUMTzVYnSgcGPDmglw7Q7WiKdSwv2nqm7p+O2apsmdFKLNAqtcMj2Mb2MdgrBVQZ3qV9QOAjiKPpGB70XyLe6hVJZgqAKi9DSKhTMW5ipeJbcndaBbfet/dK5EY6PPBIlTrxuP8rIypHdMt9b92Wm6JazSHIY5xyojzHBjAlPudCfOv79pgUd/g4TDyPG6WelF4XqjT3/i5UyVqcT8QtK/28xqxb0ecHXSIT8pI+yz+6FZZmk/Bp0bk0gSr/hHMsV9w5GsCrct+sXXPgDH8ivYiMPmEbidqIkSmhxXRlsfmCHvRm8nTxCQHreompp0XGTFKsebbYTNhFZWhPsIEc5SzDoAQcCFaU+wOupYnRCQFQxZh3G9/D
Content-Type: multipart/alternative; boundary="_000_19B68566741D408A871D4C99E09643FBciscocom_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: eebf60a1-b951-498e-11ed-08d774e6db1f
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2019 16:11:56.2072 (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: Pkqc9bU9ogZ+LqGif/ZjPt9qrrJ7Q3gLYKfVZiCztCw6BzSGhQ0ywjSNIhnj4TFB
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3789
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.20, xch-aln-010.cisco.com
X-Outbound-Node: rcdn-core-9.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/BikB13-zok-ygCePNURWX1ABIPY>
Subject: Re: [yang-doctors] Consistency for naming lists and leaf-lists
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: Fri, 29 Nov 2019 16:12:06 -0000

Hi Rob,
In ietf-ospf.yang and ietf-isis.yang, we did define an enclosing container for many of the lists. The impetus was that this would allow it to be retrieved with a single query. I do agree that we should have a guideline for this as we went back and forth. For example:

        container interfaces {
            description "All interfaces.";
            list interface {
              key "name";
              description
                "List of OSPF interfaces.";
              leaf name {
                type if:interface-ref;
                description
                  "Interface name reference.";
              }
              uses interface-config;
              uses interface-state;
            }

Thanks,
Acee


From: yang-doctors <yang-doctors-bounces@ietf.org> on behalf of "Rob Wilton (rwilton)" <rwilton@cisco.com>
Date: Friday, November 29, 2019 at 5:53 AM
To: YANG Doctors <yang-doctors@ietf.org>
Subject: [yang-doctors] Consistency for naming lists and leaf-lists

Hi,

Perhaps this has been debated to death, or there is already an agreement, but do we have an agreed consistent approach for naming/containing lists in YANG?

In particular:

1)      Should the list be enclosed in its own container (e.g. interfaces/interface)?

2)      Should the name of the list be singular or plural?

3)      Should leaf-lists be treated similarly?

4)      What if the list is a top level YANG node, does it get put into a container in that scenario (e.g. network-instances/network-instance)?

I think that it would be good if we can have a consistent approach during reviews, perhaps folding into a future update of RFC 8407.

Looking at a couple of the recent models in RFCs, would seem to suggest:

1)      Top-level data nodes should probably always be containers

2)      Lists don’t need to be enclosed in a container (and should not be top-level data-nodes).

3)      Names of lists and leaf-lists should be singular not plural.

Does that align with other folk’s opinions?

Thanks,
Rob