Subject: [netmod] YANG 1.1 inline notifications

From: "Bogaert, Bart (Nokia - BE/Antwerp)" <[email-masked]>
Date: Wed, 5 Sep 2018 11:21:12 +0000

Hi,

I'm trying to seek some clarification.

According to RFC7950 section 7.16.2:
When a notification node is defined as a child to a data node, the
<notification> element defined in [RFC5277] contains a hierarchy of
nodes that identifies the node in the datastore.

According to RFC6241 section 1.1:
datastore: A conceptual place to store and access information. A
datastore might be implemented, for example, using files, a
database, flash memory locations, or combinations thereof

When combining these two, the "hierarchy of nodes that identifies the node in the datastore" actually refers to resources that do exist (at least that is how I understand this).

Now consider the following model.

container state-data {
  config false;
  list elements {
    key name;
    leaf name {
      type string;
    }
    leaf status {
      type enumeration {
        enum up;
        enum down;
      }
    }
    notification inline-notification {
      description
        "An in-line notification";

        leaf result {
          type string;
          mandatory true;
        }
    }
  }
}

Can a device send the notification 'inline-notification' if the list /state-data/elements is empty?
My feeling is that this should not be possible as there is no "hierarchy of nodes that identifies the node in the datastore", so against what would that notification be sent in such case?

Best regards, Bart

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 10 Sep 2018 20:46:50 +0200 (CEST)

"Bogaert, Bart (Nokia - BE/Antwerp)" <[email-masked]> wrote:
> When combining these two, the "hierarchy of nodes that identifies the
> node in the datastore" actually refers to resources that do exist (at
> least that is how I understand this).
> 
> My feeling is that this should not be possible as there is no
> "hierarchy of nodes that identifies the node in the datastore", so
> against what would that notification be sent in such case?

Exactly.  The idea is that the notification is tied to some instance
in the data tree.  If no instances exist, there is nothing to tie the
notification to.  But this being operational state data there is
no guarantee that the instance still exists when the notification
arrives at the client.

/martin