Hi,

RFC 8407, section 4.10 says:

   A mandatory database data definition is defined as a node that a
   client must provide for the database to be valid.  The server is not
   required to provide a value.

   Top-level database data definitions MUST NOT be mandatory.

The objective for this rule is to avoid a situation where a module cannot
be loaded w/o providing additional config, or a situation where you
can't boot a server w/o additional config.


Consider this snippet:

  container top {
    leaf foo {
      type int32;
      default 0;
    }
    leaf bar {
      when '../foo = 42';
      mandatory true;
      type int32;
    }
  }


Is /top/bar considered a mandatory top level node?

IMO it doesn't violate the spirit of the rule.  So the question is; is
this allowed?


/martin

P.S. the real data model is a potential solution to a problem with
ietf-alarms from draft-ietf-ccamp-alarm-module:

      leaf notify-status-changes {
        type enumeration {
          enum all-state-changes {
            ...
          }
          enum raise-and-clear {
            ...
          }
          enum severity-level {
            ...
          }
        }
        default "all-state-changes";
        description
          ...
      }
      leaf notify-severity-level {
        when '../notify-status-changes = "severity-level"';
        type severity;
        mandatory true;
        ...
      }


pyang complains that this violates the cited rule.

D.S.

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to