netconfcentral logo

ietf-notification-messages@2017-10-03



  module ietf-notification-messages {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-notification-messages";

    prefix nm;

    import ietf-yang-types {
      prefix yang;
    }
    import ietf-restconf {
      prefix rc;
    }

    organization "IETF";

    contact
      "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>

     Editor:   Eric Voit
               <mailto:evoit@cisco.com>

     Editor:   Alexander Clemm
               <mailto:ludwig@clemm.org>

     Editor:   Andy Bierman
               <mailto:andy@yumaworks.com>

     Editor:   Tim Jenkins
               <mailto:timjenki@cisco.com>";

    description
      "This module contains conceptual YANG specifications for yang-data
    messages carrying notifications with well known header objects.";

    revision "2017-10-03" {
      description "Initial version.";
      reference
        "draft-ietf-netconf-notification-messages-02";

    }

    rc:yang-data "message";
    rc:yang-data "bundled-message";

    feature publisher {
      description
        "This feature indicates that support for both publisher and
      receiver of messages complying to the specification.";
    }

    identity common-header {
      base 
      description
        "A well known header which can be included somewhere within a
      message.";
    }

    identity notification-time {
      base common-header;
      description
        "Header information consisting of the time an originating process
      created the notification.";
    }

    identity notification-id {
      base common-header;
      description
        "Header information consisting of an identifier for an instance
      of a notification egressing a publisher. ";
    }

    identity subscription-id {
      base common-header;
      description
        "Header information consisting of the identifier of the
      subscription associated with the notification being
      encapsulated.";
    }

    identity observation-domain-id {
      base common-header;
      description
        "Header information identifying the software entity which created
      the notification (e.g., process id).";
    }

    identity message-id {
      base common-header;
      description
        "Header information that identifies a message to a specific
      receiver";
    }

    identity message-time {
      base common-header;
      description
        "Header information consisting of time the message headers were
      placed generated prior to being sent to transport";
    }

    identity previous-message-id {
      base common-header;
      description
        "Header information consisting of a message id previously sent by
      the publisher to a specific receiver (allows detection of
      loss/duplication).";
    }

    identity message-generator-id {
      base common-header;
      description
        "Header information consisting of an identifier for a software
      entity which created the message (e.g., linecard 1).";
    }

    identity signature {
      base common-header;
      description
        "Header information consisting of a signature on the contents of
      a message.  This can be useful for originating applications to
      verify record contents even when shipping over unsecure
      transport.";
    }

    identity notification-count {
      base common-header;
      description
        "Header information consisting of the quantity of notifications in
      a bundled-message for a specific receiver.";
    }

    typedef common-header {
      type identityref {
        base common-header;
      }
      description
        "Type of header object which may be included somewhere within a
      message.";
    }

    typedef notification-type {
      type string {
        pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
      }
      description
        "The name of a notification within a YANG module.";
      reference
        "RFC-7950 Section 7.16";

    }

    grouping notification-and-module {
      description
        "A location of a notification within a yang model.";
      leaf module {
        type yang:yang-identifier;
        description
          "Name of the YANG module supported by the publisher.";
      }

      leaf notification {
        type notification-type;
        description
          "The name of a notification within a YANG module.";
      }
    }  // grouping notification-and-module

    grouping message-header {
      description
        "Header information included with a message.";
      leaf message-id {
        type uint32;
        description
          "Unique id for a message going to a receiver.";
      }

      leaf message-time {
        type yang:date-and-time;
        description
          "time the message was generated prior to being sent to
        transport.";
      }

      leaf previous-message-id {
        type uint32;
        description
          "message id previously sent by publisher to a specific
        receiver (allows detection of loss/duplication).";
      }

      leaf message-generator-id {
        type string;
        description
          "Software entity which created the message (e.g., linecard 1).";
      }

      leaf signature {
        type string;
        description
          "Any originator signing of the contents of a message.  This can
        be useful for originating applications to verify record contents
        even when shipping over unsecure transport.";
      }
    }  // grouping message-header

    grouping notification-header {
      description
        "Common informational objects which might help a receiver
      interpret the meaning, details, or importance of a notification.";
      leaf notification-time {
        type yang:date-and-time;
        mandatory true;
        description
          "Time the system recognized the occurrence of an event.";
      }

      leaf-list subscription-id {
        type uint32;
        description
          "Id of the subscription which led to the notification being
        generated.";
      }

      leaf notification-id {
        type uint32;
        description
          "Identifier for the notification record.";
      }

      leaf observation-domain-id {
        type string;
        description
          "Software entity which created the notification record (e.g.,
        process id).";
      }

      uses notification-and-module;
    }  // grouping notification-header

    container message {
      presence
        "Indicates attempt to communicate notifications to a receiver.";
      description
        "Message to a receiver containing one notification";
      container message-header {
        description
          "delineates header info from content for easy parsing.";
        uses notification-header;

        uses message-header;
      }  // container message-header

      anydata notification-contents {
        description
          "Encapsultates objects following YANG's notification-stmt
          grammar of RFC-7950 section 14.  Within are the notified
          objects the publisher actually generated in order to be
          passed to a receiver after all filtering has completed.";
      }
    }  // container message

    container bundled-message {
      presence
        "Indicates attempt to communicate notifications to a receiver.";
      description
        "Message to a receiver containing many bundled notifications";
      container bundled-message-header {
        description
          "Header info for messages.";
        uses message-header {
          refine message-time {
            mandatory true;
          }
        }

        leaf notification-count {
          type uint16;
          description
            "Quantity of notification records in a bundled-message
                specific receiver.";
        }
      }  // container bundled-message-header

      list notifications {
        description
          "Set of notifications to a receiver.";
        container notification-header {
          description
            "Header info for each bundled notification.";
          uses notification-header;
        }  // container notification-header

        anydata notification-contents {
          description
            "Encapsultates objects following YANG's notification-stmt
            grammar of RFC-7950 section 14.  Within are the notified
            objects the publisher actually generated in order to be
            passed to a receiver after all filtering has completed.";
        }
      }  // list notifications
    }  // container bundled-message

    container additional-default-headers {
      if-feature publisher;
      description
        "This container maintains a list of which additional notifications
      should use which common headers if the receiver supports this
      specification.  The name starts with additional because there are
      some mandatory common headers not listed in the container.  These
      headers are (1) message-time and (2) subscription-id.";
      leaf-list additional-headers {
        type common-header;
        description
          "This list contains the additional default headers which are to
        be applied to each message from this publisher.";
      }

      list notification-specific-default {
        key "module notification";
        description
          "For any included notification, this list provides additional
        common headers.";
        uses notification-and-module;

        leaf-list per-notification-headers {
          type common-header;
          description
            "The set of additional default headers for a specific
           notification.";
        }
      }  // list notification-specific-default
    }  // container additional-default-headers
  }  // module ietf-notification-messages