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

Vladimir Vassilev <vladimir@transpacket.com> Wed, 31 August 2016 13:51 UTC

Return-Path: <vladimir@transpacket.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 AB71512DBE7 for <netmod@ietfa.amsl.com>; Wed, 31 Aug 2016 06:51:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 FCvqa-kKlLK7 for <netmod@ietfa.amsl.com>; Wed, 31 Aug 2016 06:51:27 -0700 (PDT)
Received: from mail.transpacket.com (s91205186171.blix.com [91.205.186.171]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EF42712DBAE for <netmod@ietf.org>; Wed, 31 Aug 2016 06:41:10 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id 00909142279B; Wed, 31 Aug 2016 15:41:09 +0200 (CEST)
Received: from mail.transpacket.com ([127.0.0.1]) by localhost (mail.transpacket.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ZVBRDVZKvuu2; Wed, 31 Aug 2016 15:41:08 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id CE6F3142279A; Wed, 31 Aug 2016 15:41:08 +0200 (CEST)
Received: from mail.transpacket.com ([127.0.0.1]) by localhost (mail.transpacket.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id iLrO1EjjUTiP; Wed, 31 Aug 2016 15:41:08 +0200 (CEST)
Received: from [192.168.209.141] (s1853520235.blix.com [185.35.202.35]) by mail.transpacket.com (Postfix) with ESMTPSA id AAE181422799; Wed, 31 Aug 2016 15:41:08 +0200 (CEST)
Message-ID: <57C6DE85.6070705@transpacket.com>
Date: Wed, 31 Aug 2016 15:41:25 +0200
From: Vladimir Vassilev <vladimir@transpacket.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0
MIME-Version: 1.0
To: Balazs Lengyel <balazs.lengyel@ericsson.com>, 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> <a64cf125-6c52-161f-7bc4-60fcdc42bb76@ericsson.com>
In-Reply-To: <a64cf125-6c52-161f-7bc4-60fcdc42bb76@ericsson.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/qIv-TSW5pFcisOCKpqtbeVZxxF0>
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: Wed, 31 Aug 2016 13:51:34 -0000

On 08/31/2016 01:10 PM, Balazs Lengyel wrote:
> Hello,
>
> The problem is not just about identities. It can be a value range.
If your example was about value range then a deviation would be a 
solution. Then we have the same case for modularization. YANG files 
defining deviations loaded when the deviation is relevant and not loaded 
otherwise.
> Sometimes we have a generic module like iana-interface type that list 
> a lot of identities, and I don't want to have one YAM file per 
> identity, to allow a fine control. Also sadly it is not possible to 
> have a deviation removing identities. IMHO would be needed.
Well the biggest problem modularizing your identity definitions is you 
will have more YANG files proportional to the flexibility you want. I 
would have chosen that in the example you provide.
>
> I would be more interested in having an extension saying static-data. 
> This would state that that part of config is set by the system, and 
> can not be modified by the user. So I could have conditions based on 
> it, but the user might not modify it.
That is still not as good as modularization of your model and using 
optionally loadable YANG 'deviation's and 'identity' definitions. Even 
if you have "static-data tree" you will be able to use must statements 
to not allow certain range based on that "static data tree" it will 
still be the range defined in the type from the model that will be shown 
to the user editing the configuration in YANG aware CLI or GUI. It is 
still a workaround even if the must statement will fail upon commit.