Subject: [netmod] YANG 1.1 issue: notification reuse

From: Andy Bierman <[email-masked]>
Date: Fri, 11 Apr 2014 10:20:22 -0700

Hi,

Problem:

  YANG notficaition-stmt allows other modules to augment an event
  with data but there is no common way to derive new event types
  from existing event types.

Solution:

  A mechanism is needed in YANG to allow new notifications to be
  defined that extend existing notifications. Conceptually, the contents
  of a base notification are added the new notification

Possible implementation:

   * Add a base-notification statement as a sub-statement of
notification-stmt

  notification interface-event {
      path "/if:interfaces/if:interface";
      leaf name {
        type leafref {
           path "/if:interfaces/if:interface/if:name";
        }
     }
  }

  notification interface-enabled {
     base-notification "if:interface-event";
     // new objects can be added here
  }

  notification interface-disabled {
     base-notification "if:interface-event";
     // new objects can be added here
  }

The YANG compiler treats the base-notification-stmt as a conceptual
"uses" statement and the base notification is treated like a grouping,
except the entire contents are used, not just data-def-stmts.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 16 Apr 2014 15:39:00 +0200 (CEST)

Hi,

Added as Y37.

/martin