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

Andy Bierman <andy@yumaworks.com> Thu, 01 September 2016 16:41 UTC

Return-Path: <andy@yumaworks.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 E342712D158 for <netmod@ietfa.amsl.com>; Thu, 1 Sep 2016 09:41:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 vMsBlI9Ll6nG for <netmod@ietfa.amsl.com>; Thu, 1 Sep 2016 09:41:06 -0700 (PDT)
Received: from mail-ua0-x22c.google.com (mail-ua0-x22c.google.com [IPv6:2607:f8b0:400c:c08::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4FACA12B058 for <netmod@ietf.org>; Thu, 1 Sep 2016 09:41:06 -0700 (PDT)
Received: by mail-ua0-x22c.google.com with SMTP id q42so96798086uaq.1 for <netmod@ietf.org>; Thu, 01 Sep 2016 09:41:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=U9CzUoSX2wdKGLFNh/Fp8hbj4231xjtkivoMFssv9Q4=; b=rn1twxFtBVzhH4jFsMZLZ2TKyfnvNxPBWIswC4YS1eDGIwJ2baWkmecmhYsOyc5wrt +zMjlXQDrwzkbjJOBhWrPY2zdYrhZFNZxJukVNLGfkOi6DnV4PbjFT9xPQuvPaTn3hOV TT3JJsMC6D2f8C3I8skfkhGFMQMoYXaSU4iM+kFcAMN97Dps+hgfsc9lXoAvtEm8XBCf UmeQoOfqkFnt1gHZ7pOb8fXsFqAmsObOLgQFUSczkMGzWGwLMMtVgECnYZDI67z+1zeE J6mvLH1s3GXvzM+7yTw6oDjD7h7Zd6dB47xpE+CCoj6OJwJw3BqZj2bD4Vayyiskz4XQ cvIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=U9CzUoSX2wdKGLFNh/Fp8hbj4231xjtkivoMFssv9Q4=; b=fgUKyf6M9crZlDCrCkrPRatXGKKflgizXRwHG0gv/DBEao0Vb/iqn5MuiFJ0DYQOLo ouCLYbfybcQNKe4TGINhH1tdqw0T3TteqnKoKsVnxAv7bS4b6wlHckP0kaqEhKs5XXgo 98WpLZLRMFkyofD9mdYtuLvpKMTHG69CPfIh1qeVPw997xuWu7472OsGAyWwGHswArNr csGtG+QvR/eYqSyP3Rm4yiu+Y4mqCeqE7gNTKpJGZx3angRIA2Pmg6/lIJP1gFr29C3U 56kGZBZ+cs8Ku8nL2vBVn7Ro/6iZrUncY84mrAY6Yq8WlLIbqWyGKQ7RFfOKHKGBT6Uj LzyQ==
X-Gm-Message-State: AE9vXwNurIqFjiP+axfHDL0UQbIcE0VqfoDc/hWbyKkNwzYmP9JjmNNz8G7GiePmCWrNxb+CuPV8jssFm0G9Kg==
X-Received: by 10.176.6.33 with SMTP id f30mr1969048uaf.105.1472748065376; Thu, 01 Sep 2016 09:41:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.4.134 with HTTP; Thu, 1 Sep 2016 09:41:04 -0700 (PDT)
In-Reply-To: <c202b56c-3cb9-81bb-7897-88250eecc172@ericsson.com>
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> <c202b56c-3cb9-81bb-7897-88250eecc172@ericsson.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 01 Sep 2016 09:41:04 -0700
Message-ID: <CABCOCHS7CQmrBHDjJ2gdObYKPKi8CDQd1c+MPcv9i2reChRjdw@mail.gmail.com>
To: Balazs Lengyel <balazs.lengyel@ericsson.com>
Content-Type: multipart/alternative; boundary="94eb2c04347a47e7db053b74e1ab"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/kml_Ef13fmlRq-QoHtuXsL66W-g>
Cc: "netmod@ietf.org" <netmod@ietf.org>
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 16:41:09 -0000

Hi,

We keep having discussions about YANG conformance related issues.
The only unit of conformance is the YANG module, so it is possible to
think the way to solve the conformance/discovery problem is to put every
definition
in its own module. This is operationally absurd of course, so someday YANG
is going to need a real conformance model.


Andy


On Thu, Sep 1, 2016 at 12:48 AM, Balazs Lengyel <balazs.lengyel@ericsson.com
> wrote:

> 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
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>