Subject: [netmod] Y36: associate a notification with a data node

From: Martin Bjorklund <[email-masked]>
Date: Mon, 23 Mar 2015 17:24:12 -0500 (CDT)

Hi,

A few of us sat down and looked at the encoding options for inline
notifications.  As a result, we have updated Y36 and added solution
Y36-03, which is a variant of the second alternative in Y36-02.

The issues file is updated, and Y36-03 is included below:

** Solution Y36-03

  Allow "inline" notification definitions.

    #+BEGIN_EXAMPLE
    container interfaces {
      list interface {
        ...
        notification interface-enabled {
          ...
        }
      }
    }
    #+END_EXAMPLE

  Notifications are scoped like other data nodes, and are encoded as
  below:

    #+BEGIN_EXAMPLE
    <notification ...>
      <eventTime>2014-04-01T10:00:00Z</eventTime>
      <event xmlns="urn:ietf:params:xml:ns:yang:1">
        <interfaces ...>
          <interface>
            <name>eth1</name>
            <interface-enabled>
              ...
            </interface-enabled>
          </interface>
        </interfaces>
      </event>
    </notification>
    #+END_EXAMPLE

  This encoding is preferred over the first alternative in Y36-02
  because it is simpler to parse.  If the first alternative in Y36-02
  is parsed, the parser has to peek into the contents of the
  notification and parse the yang:data-node element before it can
  validate the notification name.  It also makes it more difficult to
  handle the case where there is a top-level notification and an
  inline notification with the same name.

/martin