Re: [netmod] Questions about how to assign default values with YANG

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Wed, 20 January 2021 11:44 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 5219E3A114A for <netmod@ietfa.amsl.com>; Wed, 20 Jan 2021 03:44:52 -0800 (PST)
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, SPF_HELO_NONE=0.001, 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 20Ra06dKhbiY for <netmod@ietfa.amsl.com>; Wed, 20 Jan 2021 03:44:50 -0800 (PST)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6009F3A1149 for <netmod@ietf.org>; Wed, 20 Jan 2021 03:44:50 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 3636182F; Wed, 20 Jan 2021 12:44:48 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.198]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id 9qiBwKmTf1PE; Wed, 20 Jan 2021 12:44:47 +0100 (CET)
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 "DFN-Verein Global Issuing CA" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Wed, 20 Jan 2021 12:44:47 +0100 (CET)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by hermes.jacobs-university.de (Postfix) with ESMTP id CBD7820156; Wed, 20 Jan 2021 12:44:47 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10028) with ESMTP id o4o-dz-FSp_h; Wed, 20 Jan 2021 12:44:47 +0100 (CET)
Received: from localhost (anna.jacobs.jacobs-university.de [10.50.218.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by hermes.jacobs-university.de (Postfix) with ESMTPS id 31C5320154; Wed, 20 Jan 2021 12:44:46 +0100 (CET)
Date: Wed, 20 Jan 2021 12:44:46 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Italo Busi <Italo.Busi@huawei.com>
Cc: "'netmod@ietf.org'" <netmod@ietf.org>
Message-ID: <20210120114446.ovih63db7vmv7c7s@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Italo Busi <Italo.Busi@huawei.com>, "'netmod@ietf.org'" <netmod@ietf.org>
References: <a0c43ab5c3c1463a97a1aa594a80ceee@huawei.com> <20210120094737.g5l5pvfzligahrj6@anna.jacobs.jacobs-university.de> <2384a8f549c94ea0ac46d6c772fbca43@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <2384a8f549c94ea0ac46d6c772fbca43@huawei.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/MoZZofgoOHqqCiG7G0Em7c3oGFA>
Subject: Re: [netmod] Questions about how to assign default values with YANG
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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, 20 Jan 2021 11:44:52 -0000

On Wed, Jan 20, 2021 at 10:51:09AM +0000, Italo Busi wrote:
> 
> Does it mean that a server may not use/implement in the operational datastore a leaf for which a YANG default statement has been defined?
>

RFC 7950 section 7.6.1 mentions describes situations where a leaf is
conditional, i.e., there is when condition or an if-feature expression
or the leaf is a case node.

> What would be the value of defining a YANG default statement for  config false leaf?
>

Technically, this can happen because a type has a defined default
value and this type may be used by config false leafs.

An example is the zero-based-counter32 typedef in RFC 6991. However,
this style may be debated since it (mis)uses a default statement to
define an initial value. I am not sure whether the pattern of using
default statements for specifying intial values is a good one.

/js

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