Re: [netmod] top-level mandatory nodes

Ladislav Lhotka <lhotka@nic.cz> Thu, 19 January 2017 12:57 UTC

Return-Path: <lhotka@nic.cz>
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 D45EA129478 for <netmod@ietfa.amsl.com>; Thu, 19 Jan 2017 04:57:55 -0800 (PST)
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] 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 hdpTdB9oPCqc for <netmod@ietfa.amsl.com>; Thu, 19 Jan 2017 04:57:54 -0800 (PST)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) by ietfa.amsl.com (Postfix) with ESMTP id A24D1129444 for <netmod@ietf.org>; Thu, 19 Jan 2017 04:57:54 -0800 (PST)
Received: from localhost (unknown [195.113.220.110]) by trail.lhotka.name (Postfix) with ESMTPSA id 5FC791CC0339; Thu, 19 Jan 2017 13:57:56 +0100 (CET)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Phil Shafer <phil@juniper.net>, Andy Bierman <andy@yumaworks.com>
In-Reply-To: <201701182353.v0INr1SU040570@idle.juniper.net>
References: <201701182353.v0INr1SU040570@idle.juniper.net>
Date: Thu, 19 Jan 2017 13:57:53 +0100
Message-ID: <m2lgu7tdf2.fsf@birdie.labs.nic.cz>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/iMVQuUW0WD5rqr4yN6BjvChnerk>
Cc: NETMOD WG <netmod@ietf.org>
Subject: Re: [netmod] top-level mandatory nodes
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, 19 Jan 2017 12:57:56 -0000

Phil Shafer <phil@juniper.net> writes:

> Andy Bierman writes:
>>mandatory for config=false means it must exist in an <rpc-reply> for a <get>
>>operation retrieval.  It is by definition "server-supplied", so there is no
>>server validation to worry about.
>>
>>YANG constraints are used on clients.
>>Not that we are super-server-centric here, but client software
>>uses YANG, not just server software.
>
> I must be missing your meaning here.  Can you please give a
> use case for when the data modeler would use "mandatory true"
> for a "config false" top-level node?

An existing use case is the NACM module in RFC 6536:

      +--rw nacm
         +--rw enable-nacm?            boolean
         +--rw read-default?           action-type
         +--rw write-default?          action-type
         +--rw exec-default?           action-type
         +--rw enable-external-groups? boolean
         +--ro denied-operations       yang:zero-based-counter32
         +--ro denied-data-writes      yang:zero-based-counter32
         +--ro denied-notifications    yang:zero-based-counter32
         ...

The top-level node "nacm" contains three mandatory counters, and this
makes it mandatory as well. My understanding is that if a client asks
for complete state data, these counters must always be present in the
reply.

The situation here is a bit trickier because "nacm" is configuration but
I guess it is just an artefact caused by putting configuration and state
data inside the same container.

Lada

>
> Thanks,
>  Phil

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67