Subject: [netmod] default guidelines

From: Andy Bierman <[email-masked]>
Date: Sat, 19 Sep 2009 01:57:14 -0700

Hi,

I am trying to formulate text on defaults for the YANG
Usage Guidelines, and it is difficult, since the definition
is not really agreed upon.  I plan to add these 2 sub-sections:

  - A default in a grouping MAY be over-ridden so the rules
    in sec. 10 (a default can just be added once) do not
    apply to groupings.

    Use case (hoping for something better than this):

       grouping Timer {
          leaf timer {
             type uint32;
             units seconds;
             default 60;
          }
       }

       uses Timer {
         refine timer {
            default 10;
         }
       }

  - Since defaults are very unpredictable, and can be overridden
    by the server with deviations, or cab be undetectable because of
    incomplete module capability information, a data modeler MAY prevent
    this behavior by using a leaf-list with max-elements = 1,
    instead of a leaf:

    leaf-list timer {
       type uint32;
       units seconds;
       max-elements 1;
    }

    Because the default-stmt has no effect on a leaf-list, this
    construct can never be modified by deviations,
    or omitted by any defaults-filtering scheme.

Andy