<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="2"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std"
     docName="draft-ahuang-netconf-notif-yang-01"
     ipr="trust200902"
     updates="RFC5277">
  <front>
    <title abbrev="NETCONF Event Notification YANG">YANG model
    for NETCONF Event Notifications</title>

    <author fullname="Alex Huang Feng" initials="A." surname="Huang Feng">
      <organization>INSA-Lyon</organization>

      <address>
        <postal>
          <street/>

          <city>Lyon</city>

          <region/>

          <code/>

          <country>France</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>alex.huang-feng@insa-lyon.fr</email>

        <uri/>
      </address>
    </author>

    <author fullname="Pierre Francois" initials="P." surname="Francois">
      <organization>INSA-Lyon</organization>

      <address>
        <postal>
          <street/>

          <city>Lyon</city>

          <region/>

          <code/>

          <country>France</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>pierre.francois@insa-lyon.fr</email>

        <uri/>
      </address>
    </author>

    <author fullname="Thomas Graf" initials="T" surname="Graf">
      <organization>Swisscom</organization>

      <address>
        <postal>
          <street>Binzring 17</street>

          <city>Zurich</city>

          <code>8045</code>

          <country>Switzerland</country>
        </postal>

        <email>thomas.graf@swisscom.com</email>
      </address>
    </author>

    <author fullname="Benoit Claise" initials="B" surname="Claise">
      <organization>Huawei</organization>

      <address>
        <email>benoit.claise@huawei.com</email>
      </address>
    </author>

    <date day="03" month="March" year="2023"/>

    <abstract>
      <t>This document defines the YANG model for NETCONF Event Notifications.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in BCP 14
      <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
    </note>
  </front>

  <middle>
    <section anchor="introduction" title="Introduction">
      <t>This document defines a YANG data model for NETCONF Event Notifications
      <xref target="RFC5277"/>. The notification structure defined in 
      <xref target="RFC5277"/> uses a XML Schema <xref target="W3C.REC-xml-20001006"/>
      allowing to encode and validate the message in XML. Nevertheless,
      when the notification message is encoded using other encodings such as
      JSON <xref target="RFC8040"/> or CBOR <xref target="RFC9254"/>, a YANG model 
      to validate or encode the message is necessary. This document extends 
      <xref target="RFC5277"/>, defining the NETCONF Event Notification structure in a YANG module.
      </t>
    </section>

    <section anchor="yang-model" title="YANG Module">
    
      <section anchor="yang-tree" title="YANG Tree Diagram">
        <t>This YANG module adds a structure with one leaf for the datetime as defined in 
        section 2.2.1 of <xref target="RFC5277"/>.
        </t>

        <t><figure>
          <artwork align="left"><![CDATA[
module: ietf-notification

  structure notification:
    +-- eventTime    yang:date-and-time
]]></artwork>
        </figure></t>
      </section>

      <section anchor="yang-module" title="YANG Module">
      <t><figure>
          <artwork align="left"><![CDATA[
<CODE BEGINS> file "ietf-notification@2023-03-01.yang"
module ietf-notification {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:netconf:notification:1.0";
  prefix inotif;
  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-yang-structure-ext {
    prefix sx;
    reference
      "RFC 8791: YANG Data Structure Extensions";
  }

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

     Authors:  Alex Huang Feng
               <mailto:alex.huang-feng@insa-lyon.fr>
               Pierre Francois
               <mailto:pierre.francois@insa-lyon.fr>
               Thomas Graf
               <mailto:thomas.graf@swisscom.com>
               Benoit Claise
               <mailto:benoit.claise@huawei.com>";

  description
    "Defines NETCONF Event Notification structure as defined in RFC5277.

    Copyright (c) 2023 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 Revised 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 2023-03-01 {
    description
      "First revision";
    reference
      "RFC XXXX: NETCONF Event Notification YANG";
  }

  sx:structure notification {
    leaf eventTime {
      type yang:date-and-time;
      mandatory true;
      description
        "The time the event was generated by the event source.  This
         parameter is of type dateTime and compliant to [RFC3339].
         Implementations must support time zones.";
    }
  }
}
<CODE ENDS>]]></artwork>
        </figure></t>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The security considerations for the NETCONF Event notifications
      are described in <xref target="RFC5277"/>. This documents adds
      no additional security considerations.</t>
    </section>

    <section anchor="IANA_Considerations" title="IANA Considerations">

      <t>This document describes the URI used for the IETF XML Registry and
      registers a new YANG module name.</t>

      <section title="URI">
      <t>IANA is requested to add this document as a reference in the following
      URI in the <xref target="RFC3688">IETF XML Registry</xref>.</t>

      <t><figure>
          <artwork align="left"><![CDATA[
URI: urn:ietf:params:xml:ns:netconf:notification:1.0
Registrant Contact: The IESG.
XML: N/A; the requested URI is an XML namespace.
Reference: RFC5277; RFC-to-be]]></artwork>
        </figure></t>
      </section>

      <section title="YANG module name">

        <t>This document registers the following YANG module in the <xref
        target="RFC6020">YANG Module Names Registry</xref>, within the
        "YANG Parameters" registry:</t>

        <t><figure>
            <artwork align="left"><![CDATA[
name: ietf-notification
namespace: urn:ietf:params:xml:ns:netconf:notification:1.0
prefix: inotif
reference: RFC-to-be]]></artwork>
        </figure></t>
      </section>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank Andy Bierman and Jason Sterne for their review
      and valuable comments.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5277.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml"?>

      <reference anchor="W3C.REC-xml-20001006"
                 derivedAnchor="W3C.REC-xml-20001006" quoteTitle="true"
                 target="https://www.w3.org/TR/2000/REC-xml-20001006">
        <front>
          <title>Extensible Markup Language (XML) 1.0 (Second Edition)</title>

          <author fullname="Tim Bray" initials="T." surname="Bray">
            <organization showOnFrontPage="true"/>
          </author>

          <author fullname="Jean Paoli" initials="J." surname="Paoli">
            <organization showOnFrontPage="true"/>
          </author>

          <author fullname="Michael Sperberg-McQueen" initials="M."
                  surname="Sperberg-McQueen">
            <organization showOnFrontPage="true"/>
          </author>

          <author fullname="Eve Maler" initials="E." surname="Maler">
            <organization showOnFrontPage="true"/>
          </author>

          <date month="October" year="2000"/>
        </front>

        <refcontent>W3C</refcontent>
      </reference>
    </references>

    <references title="Informative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.8040.xml"?>
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.9254.xml"?>
    </references>
  </back>
</rfc>
