Re: [yang-doctors] question regarding conditional/optional statements

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 17 August 2017 05:06 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 1989C124E15 for <yang-doctors@ietfa.amsl.com>; Wed, 16 Aug 2017 22:06:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=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 syLsJBMmFVSz for <yang-doctors@ietfa.amsl.com>; Wed, 16 Aug 2017 22:06:50 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 71A001201F8 for <yang-doctors@ietf.org>; Wed, 16 Aug 2017 22:06:50 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id EB9EC375; Thu, 17 Aug 2017 07:06:48 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id NhIy_YsOeswJ; Thu, 17 Aug 2017 07:06:47 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Thu, 17 Aug 2017 07:06:48 +0200 (CEST)
Received: from localhost (demetrius4.jacobs-university.de [212.201.44.49]) by hermes.jacobs-university.de (Postfix) with ESMTP id CBD13200C5; Thu, 17 Aug 2017 07:06:48 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius4.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id LOpHmMNubAdF; Thu, 17 Aug 2017 07:06:48 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 7026E200C3; Thu, 17 Aug 2017 07:06:48 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 2EA064040F34; Thu, 17 Aug 2017 07:06:48 +0200 (CEST)
Date: Thu, 17 Aug 2017 07:06:48 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Ing-Wher Chen <Ing-Wher_Chen@jabil.com>
Cc: "yang-doctors@ietf.org" <yang-doctors@ietf.org>, Norm Strahle <nstrahle@juniper.net>, "Aseem Choudhary (asechoud)" <asechoud@cisco.com>
Message-ID: <20170817050647.apfeuvfhfw23ws6n@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Ing-Wher Chen <Ing-Wher_Chen@jabil.com>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>, Norm Strahle <nstrahle@juniper.net>, "Aseem Choudhary (asechoud)" <asechoud@cisco.com>
References: <BN1PR0201MB0833B05FB5307BDEF2E8E3F5C3820@BN1PR0201MB0833.namprd02.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <BN1PR0201MB0833B05FB5307BDEF2E8E3F5C3820@BN1PR0201MB0833.namprd02.prod.outlook.com>
User-Agent: NeoMutt/20170714 (1.8.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/g5X5iD5Ttt1V7R7mJgjzo8dPRdg>
Subject: Re: [yang-doctors] question regarding conditional/optional statements
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
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: Thu, 17 Aug 2017 05:06:53 -0000

On Wed, Aug 16, 2017 at 06:09:27PM +0000, Ing-Wher Chen wrote:
> Hello YANG doctors,
> 
> We wish to define a YANG model with several counters.  The counters that we wish to model are the union of all the counters supported by our sample of vendors.  This means that the model will define some counters supported by both vendor_1 and vendor_2 (or more), but some counters will be supported only by one of the vendors.  We would like the model to allow each vendor to indicate the counters it supports.
> 
> We can think of 3 approaches below, and would like your feedback regarding which approach we should choose.  We're also open to suggestions of other approaches.
> 
> Option 1: Define an optional feature (if-feature) for each counter.
> 
> Option 2: Define a leaf of the type bits, where each bit indicates that a particular counter is supported.
> 
> Option 3: Define a leaf of the type integer, where each bit in the integer indicates that a particular counter is supported.
> 

Let me add:

Option 4: Vendors publish deviations that document how they deviate from
the standard.

Advantage: This is the standard approach built into the language to document
how an implementation deviates from a standard.

Disadvantage: Vendors do not like to document deviations, hence they
like to see every little counter as a feature.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>