Re: [netmod] How to constrain a leaf to a read-only list of supported values?

Balazs Lengyel <balazs.lengyel@ericsson.com> Thu, 01 September 2016 07:49 UTC

Return-Path: <balazs.lengyel@ericsson.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1850612D765 for <netmod@ietfa.amsl.com>; Thu, 1 Sep 2016 00:49:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.221
X-Spam-Level:
X-Spam-Status: No, score=-4.221 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-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 ujzxDWqvxoI9 for <netmod@ietfa.amsl.com>; Thu, 1 Sep 2016 00:49:05 -0700 (PDT)
Received: from sesbmg22.ericsson.net (sesbmg22.ericsson.net [193.180.251.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1E15112D14D for <netmod@ietf.org>; Thu, 1 Sep 2016 00:49:04 -0700 (PDT)
X-AuditID: c1b4fb30-ea88e980000009f9-47-57c7dd6e533d
Received: from ESESSHC014.ericsson.se (Unknown_Domain [153.88.183.60]) by (Symantec Mail Security) with SMTP id 1B.85.02553.E6DD7C75; Thu, 1 Sep 2016 09:49:03 +0200 (CEST)
Received: from [159.107.198.59] (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.62) with Microsoft SMTP Server id 14.3.301.0; Thu, 1 Sep 2016 09:48:50 +0200
To: Vladimir Vassilev <vladimir@transpacket.com>, Ladislav Lhotka <lhotka@nic.cz>, netmod@ietf.org
References: <dfae1556-110d-5c29-d556-5fdc391c1637@ericsson.com> <251BF209-A065-4208-8085-A2A1726FFB27@tail-f.com> <79de91b0-7084-401c-6967-23519b511c4a@ericsson.com> <57C69F18.7000006@transpacket.com> <D9BD63DB-4F89-4C2B-94D8-5E66ACAFBD9A@nic.cz> <57C6CA8E.4030101@transpacket.com>
From: Balazs Lengyel <balazs.lengyel@ericsson.com>
Message-ID: <c202b56c-3cb9-81bb-7897-88250eecc172@ericsson.com>
Date: Thu, 01 Sep 2016 09:48:50 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <57C6CA8E.4030101@transpacket.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrILMWRmVeSWpSXmKPExsUyM2K7jW7+3ePhBt9+c1lcWDWXzWL+xUZW i1Pzv7E6MHssWfKTyWPT5TuMHlc/nGQJYI7isklJzcksSy3St0vgyjg0ewlzwT/hiu0dz1ga GFsFuhg5OSQETCRWvvjF1MXIxSEksJ5R4vvtaWwQzmpGiRvvtjCDVAkLREisfLyDHcQWEUiT aGw6wwxRtJhJ4sqkj0wgCTYBI4mp/edZQGxeAXuJaTtBJnFysAioSPz7fxyomYNDVCBGYn1f AkSJoMTJmU/AyjkF9CVmzHrBClLCDNT6YGsZSJhZQF5i+9s5YCcICWhIPLzwl3UCI/8sJN2z EDpmIelYwMi8ilG0OLU4KTfdyEgvtSgzubg4P08vL7VkEyMwIA9u+W2wg/Hlc8dDjAIcjEo8 vArSx8OFWBPLiitzDzFKcDArifB23QYK8aYkVlalFuXHF5XmpBYfYpTmYFES5/V/qRguJJCe WJKanZpakFoEk2Xi4JRqYMxQ+b7Byme1xVanIqUN0r2HtR2nrFS5kKS4gmeXRfeUrWnbV3tJ 9Ob0Pfs15anBR43grSXXOw9+F5W9JMun5TwlyrxnisMBT252Jn+9c/5GLNWJelaPj3dXXM3T 42y3br6z6pfzu81374RMMElkY1sb+E/sQ+f8GbOnNLBohd4KujiPL+GuoRJLcUaioRZzUXEi ANTlkwpEAgAA
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/gRrWdsgHyhTUiZ_PAy9pZkL_9X4>
Subject: Re: [netmod] How to constrain a leaf to a read-only list of supported values?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 01 Sep 2016 07:49:07 -0000

Hello,

The proposed iana-entity.yang seems to take the same approach: one file 
defining 28 identities.

And I share all your concerns about iana-if-type.

Balazs


On 2016-08-31 14:16, Vladimir Vassilev wrote:
> On 08/31/2016 12:38 PM, Ladislav Lhotka wrote:
>>> On 31 Aug 2016, at 11:10, Vladimir Vassilev 
>>> <vladimir@transpacket.com> wrote:
>>>
>>> If you design your models using identityref and define the 
>>> identities in separate modules e.g. compression-zip.yang, 
>>> compression-gzip.yang, etc. you can just chose not to load the 
>>> particular YANG models containing the identities not supported when 
>>> your device starts.
>> Right, and I have proposed this approach several times in the past. 
>> However, some people prefer that the modules defining identities 
>> mirror IANA and similar registries. In the case of 
>> iana-interface-types it also means that implementations have to deal 
>> with obsolete, obscure and experimental interface types that happen 
>> to be in the IANA registry but nobody will ever want to use.
>>
>> Lada
> +1
>
> The 275 identities defined in iana-if-type.yang appearing as possible 
> /interfaces/interface/type tab completion options in a YANG aware cli 
> or drop-down menu in gui is annoying and stands out as an obvious 
> problem.
>
> It is not late to split the file. No standard RFC YANG model includes 
> iana-if-type.yang yet. The actually referenced identities in current 
> drafts is less then 16 (grep-ing in my known YANG model archive) 
> {ethernetCsmacd, l2vlan, ieee8023adLag, ifPwType, pos, atm, 
> atmSubInterface, sonet, otnOtu, frameRelay, bridge, 
> macSecControlledIF, fastdsl}
>
> If not single instance per file maybe dividing the file into 
> categories so if your device is atm aware you import 
> iana-if-type-atm.yang and get {atm, atmSubInterface}.
>
> However we can probably agree the iana-if-type.yang exception is not a 
> valid excuse for new models like the one in the example where there 
> are 3 compression methods to not modularize the identity definitions 
> into separate files and not load identities the implementation does 
> not support but instead resolve to workaround solutions.
>
> Vladimir
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909              email: Balazs.Lengyel@ericsson.com