Re: [YANG] mandatory & default

Martin Bjorklund <mbj@tail-f.com> Sat, 26 January 2008 10:22 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JIiBN-0002wN-7u; Sat, 26 Jan 2008 05:22:41 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JIiBM-0002kv-Dn for yang-confirm+ok@megatron.ietf.org; Sat, 26 Jan 2008 05:22:40 -0500
Received: from [10.90.34.44] (helo=chiedprmail1.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JIiBE-00027P-Fs for yang@ietf.org; Sat, 26 Jan 2008 05:22:32 -0500
Received: from [213.180.94.162] (helo=mail.tail-f.com) by chiedprmail1.ietf.org with esmtp (Exim 4.43) id 1JIiBD-00060A-VL for yang@ietf.org; Sat, 26 Jan 2008 05:22:32 -0500
Received: from localhost (c213-100-166-13.swipnet.se [213.100.166.13]) by mail.tail-f.com (Postfix) with ESMTP id 3CDD01B80CB; Sat, 26 Jan 2008 11:22:29 +0100 (CET)
Date: Sat, 26 Jan 2008 11:20:45 +0100 (CET)
Message-Id: <20080126.112045.214588980.mbj@tail-f.com>
To: ietf@andybierman.com
Subject: Re: [YANG] mandatory & default
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <479A799D.1060003@andybierman.com>
References: <479A6CDF.5030304@andybierman.com> <20080126.002618.144263975.mbj@tail-f.com> <479A799D.1060003@andybierman.com>
X-Mailer: Mew version 5.1.51 on Emacs 22.1 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-Scan-Signature: 6cca30437e2d04f45110f2ff8dc1b1d5
Cc: yang@ietf.org
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Hi,


Andy Bierman <ietf@andybierman.com> wrote:
>
>    container interfaces {
>      list interface {
>        key name;
> 
>        leaf name { type InterfaceName; }
> 
>        leaf mtu {
>          type uint32;
>          default 1500;
>        }
>      }
>    }
> 
> I start out with a get-config, and mtu is not there:
> 
>   <interfaces>
>     <interface>
>       <name>eth0</name>
>       <mtu>1600</mtu>
>     </interface>
>     <interface>
>       <name>eth1</name>
>     </interface>
>   </interfaces>
> 
> Does /interfaces/interface[name=eth1]/mtu exist or not?

Not in the config datastore, no.

> If not, then I can do an edit-config to create it:
> 
>    <config>
>      <interfaces>
>        <interface>
>          <name>eth1</eth1>
>          <mtu nc:operation='create'>1500</mtu>
>        </interface>
>      </interfaces>
>    </config>
> 
> Does this succeed? 

Yes.

> NETCONF says it should, because the
> leaf did not get returned in the previous <get-config>.
> 
> Now I do a get-config again and get back:
> 
>   <interfaces>
>     <interface>
>       <name>eth0</name>
>       <mtu>1600</mtu>
>     </interface>
>     <interface>
>       <name>eth1</name>
>       <mtu>1500</mtu>
>     </interface>
>   </interfaces>
> 
> The leaf never really changed value, but you would never know
> that from the NETCONF PDU responses.
> 
> After a system reboot, does the agent 'remember' that mtu
> was set to 1500 by the manager, so the initial <running/>
> config from NV-storage after the next reboot has an mtu leaf
> for eth1?

The value is stored in NV-storage, just like all other values set by
the manager.


/martin


_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang