Re: [netmod] How to constrain a leaf to a read-only list of supported values?
Vladimir Vassilev <vladimir@transpacket.com> Thu, 01 September 2016 11: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 EEB2912D964 for <netmod@ietfa.amsl.com>; Thu, 1 Sep 2016 04:51:23 -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 fMcy8-eA8glt for <netmod@ietfa.amsl.com>; Thu, 1 Sep 2016 04:51:22 -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 7C59612DA0D for <netmod@ietf.org>; Thu, 1 Sep 2016 04:47:41 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id 2F7811520308; Thu, 1 Sep 2016 13:47:39 +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 RwUWSyvmjkEs; Thu, 1 Sep 2016 13:47:39 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id 0C24D1520307; Thu, 1 Sep 2016 13:47:39 +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 nOev1LP7C_6V; Thu, 1 Sep 2016 13:47:38 +0200 (CEST)
Received: from [192.168.209.141] (s1853520235.blix.com [185.35.202.35]) by mail.transpacket.com (Postfix) with ESMTPSA id DCCE71520305; Thu, 1 Sep 2016 13:47:38 +0200 (CEST)
Message-ID: <57C8155A.40503@transpacket.com>
Date: Thu, 01 Sep 2016 13:47:38 +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>, 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> <c202b56c-3cb9-81bb-7897-88250eecc172@ericsson.com>
In-Reply-To: <c202b56c-3cb9-81bb-7897-88250eecc172@ericsson.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/fK5mwfXE3xr3MwWJK0wqiebkh3g>
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 11:51:24 -0000
One alternative for getting rid of unsupported "identity"-s is to use "if-feature" as sub-statement which is now supported in YANG 1.1. This would be an elegant solution for the example with the 3 compression methods. However for standard models one will either have to live with the many irrelevant options presented to the user or use some extension similar to https://tools.ietf.org/html/draft-vassilev-netmod-yang-direct-must-augment-ext-00 but for identities instead of "must" statements. Then clients and servers supporting it will be able to take the light out of the "identity"-s the implementation does not support by augmenting those with relevant if-feature statements. On 09/01/2016 09:48 AM, Balazs Lengyel 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 >> >
- [netmod] How to constrain a leaf to a read-only l… Balazs Lengyel
- Re: [netmod] How to constrain a leaf to a read-on… Jan Lindblad
- Re: [netmod] How to constrain a leaf to a read-on… Dale R. Worley
- Re: [netmod] How to constrain a leaf to a read-on… Balazs Lengyel
- Re: [netmod] How to constrain a leaf to a read-on… Martin Bjorklund
- Re: [netmod] How to constrain a leaf to a read-on… Vladimir Vassilev
- Re: [netmod] How to constrain a leaf to a read-on… Ladislav Lhotka
- Re: [netmod] How to constrain a leaf to a read-on… Balazs Lengyel
- Re: [netmod] How to constrain a leaf to a read-on… Balazs Lengyel
- Re: [netmod] How to constrain a leaf to a read-on… Ladislav Lhotka
- Re: [netmod] How to constrain a leaf to a read-on… Vladimir Vassilev
- Re: [netmod] How to constrain a leaf to a read-on… Vladimir Vassilev
- Re: [netmod] How to constrain a leaf to a read-on… Balazs Lengyel
- Re: [netmod] How to constrain a leaf to a read-on… Vladimir Vassilev
- Re: [netmod] How to constrain a leaf to a read-on… Andy Bierman
- Re: [netmod] How to constrain a leaf to a read-on… Juergen Schoenwaelder
- Re: [netmod] How to constrain a leaf to a read-on… Alex Campbell
- Re: [netmod] How to constrain a leaf to a read-on… Andy Bierman
- Re: [netmod] How to constrain a leaf to a read-on… Ladislav Lhotka
- Re: [netmod] How to constrain a leaf to a read-on… Dale R. Worley
- Re: [netmod] How to constrain a leaf to a read-on… Alex Campbell
- Re: [netmod] How to constrain a leaf to a read-on… Andy Bierman
- Re: [netmod] How to constrain a leaf to a read-on… Dale R. Worley
- Re: [netmod] How to constrain a leaf to a read-on… Andy Bierman
- Re: [netmod] How to constrain a leaf to a read-on… Balazs Lengyel
- Re: [netmod] How to constrain a leaf to a read-on… Andy Bierman