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

Martin Bjorklund <mbj@tail-f.com> Thu, 17 August 2017 08:17 UTC

Return-Path: <mbj@tail-f.com>
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 B4C8A132386 for <yang-doctors@ietfa.amsl.com>; Thu, 17 Aug 2017 01:17:10 -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, SPF_PASS=-0.001, 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 5x6sX3hDdbvB for <yang-doctors@ietfa.amsl.com>; Thu, 17 Aug 2017 01:17:09 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id E6B37132646 for <yang-doctors@ietf.org>; Thu, 17 Aug 2017 01:17:08 -0700 (PDT)
Received: from localhost (unknown [173.38.220.57]) by mail.tail-f.com (Postfix) with ESMTPSA id A5F8D1AE01AA; Thu, 17 Aug 2017 10:17:07 +0200 (CEST)
Date: Thu, 17 Aug 2017 10:15:38 +0200
Message-Id: <20170817.101538.940975913472361160.mbj@tail-f.com>
To: janl@tail-f.com
Cc: Ing-Wher_Chen@jabil.com, j.schoenwaelder@jacobs-university.de, yang-doctors@ietf.org, nstrahle@juniper.net, asechoud@cisco.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <BCE95ECB-360D-46E0-B062-371931C0F46A@tail-f.com>
References: <BN1PR0201MB0833B05FB5307BDEF2E8E3F5C3820@BN1PR0201MB0833.namprd02.prod.outlook.com> <20170817050647.apfeuvfhfw23ws6n@elstar.local> <BCE95ECB-360D-46E0-B062-371931C0F46A@tail-f.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/aXgc2E6_4qCyHUHvda9KLBzR0BA>
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 08:17:11 -0000

Jan Lindblad <janl@tail-f.com> wrote:
> Option 5: Let each implementation return the data it supports without
> any content declaration
> 
> Since this is optional operational data, it's formally up to the
> application to simply return any collected data it has and skip any
> other leafs.

I was just going to suggest this as well.  I think the description
statement can make it clear that if the implementation doesn't have a
value for the counter, the node is not instantiated.  (note that this
is slightly different from saying that the node is not implemented;
the instrumentation code would know the names of all counters, but
not instantiate all of them, rather than just know the names of the
ones it "supports".)


/martin


> Advantage: Dead simple to understand for server and client alike, and
> zero complication on the YANG level. IMO cleaner and clearer than
> options 2, 3, 4. Even if any of the options 2-4 were implemented, the
> client would still have to be prepared to not receive any particular
> leaf since they are all optional. If I implemented the client, I
> probably wouldn't even bother to read that bit mask/whatever.
> 
> Disadvantage: Application developers will have no way of knowing a
> priori which data may arrive from a particular server. If this is
> important, option 1 would clearly be better.