module ietf-distributed-notif {
  yang-version 1.1;
  namespace
    "urn:ietf:params:xml:ns:yang:ietf-distributed-notif";
  prefix dn;

  import ietf-subscribed-notifications {
    prefix sn;
  }
  import ietf-yang-push {
    prefix yp;
    reference
      "RFC 8641: Subscription to YANG Notifications for Datastore Updates";
  }

  organization "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   <http:/tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>

     Authors:  Guangying Zheng
               <mailto:zhengguangying@huawei.com>
               Tianran Zhou
               <mailto:zhoutianran@huawei.com>
               Thomas Graf
               <mailto:thomas.graf@swisscom.com>
               Pierre Francois
               <mailto:pierre.francois@insa-lyon.fr>
               Eric Voit
               <mailto:evoit@cisco.com>";


  description
    "Defines augmentation for ietf-subscribed-notifications to
    enable the distributed publication with single subscription.

    Copyright (c) 2018 IETF Trust and the persons identified as
    authors of the code. All rights reserved.

    Redistribution and use in source and binary forms, with or
    without modification, is permitted pursuant to, and subject to
    the license terms contained in, the Simplified BSD License set
    forth in Section 4.c of the IETF Trust's Legal Provisions
    Relating to IETF Documents
    (https://trustee.ietf.org/license-info).

    This version of this YANG module is part of RFC XXXX; see the
    RFC itself for full legal notices.";

  revision 2024-04-21 {
    description
      "Initial version";
    reference
      "RFC XXXX: Subscription to Distributed Notifications";
  }

  grouping message-publisher-id {
    description
      "Provides a reusable leaf of te message-publisher-id.";

    leaf message-publisher-id {
      type uint32;
      config false;
      description
        "Identifies the software process which publishes the
        message (e.g., processor 1 on line card 1). This field
        is used to notify the receiver which publisher process
        published which message.";
    }
  }

  grouping message-publisher-ids {
    description
      "Provides a reusable leaf-list of message-publisher-id-list.";
    leaf-list message-publisher-ids {
      type uint32;
      config false;
      description
        "Identifies the software process which publishes the
        message (e.g., processor 1 on line card 1). This field
        is used to notify the receiver which publisher processes
        are going to publish.";
    }
  }

  augment "/sn:subscriptions/sn:subscription" {
    description
      "This augmentation allows the Message
      Publisher ID to be exposed for a subscription.";

    uses message-publisher-ids;
  }

  augment "/sn:subscription-started" {
    description
      "This augmentation adds the Message Publisher ID to the
       subscription-started subscription change notifications.";

    uses message-publisher-ids;
  }

  augment "/sn:subscription-modified" {
    description
      "This augmentation adds the Message Publisher ID to the
       subscription-modified subscription change notifications.";

    uses message-publisher-ids;
  }

  augment "/sn:establish-subscription/sn:output" {
    description
      "This augmentation adds the Message Publisher ID to the
       dynamic establish-subscription output.";

    uses message-publisher-ids;
  }
  augment "/yp:push-update" {
    description
      "This augmentation adds the Message Publisher ID in the
      push-update notification.";
    uses message-publisher-id;
  }
  augment "/yp:push-change-update" {
    description
      "This augmentation adds the Message Publisher ID in the
      push-change-update notification.";
      uses message-publisher-id;
  }
}
