<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-netmod-yang-instance-file-format-21" indexInclude="true" ipr="trust200902" number="9195" prepTime="2022-02-17T12:29:59" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="4" tocInclude="true" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-netmod-yang-instance-file-format-21" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9195" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="YANG Instance Data">A File Format for YANG Instance Data</title>
    <seriesInfo name="RFC" value="9195" stream="IETF"/>
    <author initials="B." surname="Lengyel" fullname="Balazs Lengyel">
      <organization abbrev="Ericsson" showOnFrontPage="true">Ericsson</organization>
      <address>
        <postal>
          <street>Magyar Tudosok korutja 11</street>
          <city>Budapest</city>
          <country>Hungary</country>
          <code>1117</code>
        </postal>
        <email>balazs.lengyel@ericsson.com</email>
      </address>
    </author>
    <author fullname="Benoit Claise" initials="B." surname="Claise">
      <organization showOnFrontPage="true">Huawei</organization>
      <address>
        <email>benoit.claise@huawei.com</email>
      </address>
    </author>
    <date month="02" year="2022"/>
    <area>OPS</area>
    <workgroup>Netmod</workgroup>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1"> 
        There is a need to document data defined in YANG models at design time, 
        implementation time, or when a live server is unavailable. 
        This document specifies a standard
        file format for YANG instance data, which follows the syntax and semantics 
        of existing YANG models and annotates it with metadata.
      </t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9195" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2022 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.1.2">
              <li pn="section-toc.1-1.1.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.1.1"><xref derivedContent="1.1" format="counter" sectionFormat="of" target="section-1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology">Terminology</xref></t>
              </li>
              <li pn="section-toc.1-1.1.2.2">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.2.1"><xref derivedContent="1.2" format="counter" sectionFormat="of" target="section-1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-principles">Principles</xref></t>
              </li>
              <li pn="section-toc.1-1.1.2.3">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.3.1"><xref derivedContent="1.3" format="counter" sectionFormat="of" target="section-1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-delivery-of-instance-data">Delivery of Instance Data</xref></t>
              </li>
              <li pn="section-toc.1-1.1.2.4">
                <t indent="0" pn="section-toc.1-1.1.2.4.1"><xref derivedContent="1.4" format="counter" sectionFormat="of" target="section-1.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-data-life-cycle">Data Life Cycle</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-instance-data-file-format">Instance Data File Format</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2">
              <li pn="section-toc.1-1.2.2.1">
                <t indent="0" pn="section-toc.1-1.2.2.1.1"><xref derivedContent="2.1" format="counter" sectionFormat="of" target="section-2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-specifying-the-content-sche">Specifying the Content Schema</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.1.2">
                  <li pn="section-toc.1-1.2.2.1.2.1">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.1.1"><xref derivedContent="2.1.1" format="counter" sectionFormat="of" target="section-2.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-inline-method">Inline Method</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.2.1"><xref derivedContent="2.1.2" format="counter" sectionFormat="of" target="section-2.1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-simplified-inline-method">Simplified-Inline Method</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.1.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.1.2.3.1"><xref derivedContent="2.1.3" format="counter" sectionFormat="of" target="section-2.1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-uri-method">URI Method</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.2.2.2">
                <t indent="0" pn="section-toc.1-1.2.2.2.1"><xref derivedContent="2.2" format="counter" sectionFormat="of" target="section-2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples">Examples</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.2.2">
                  <li pn="section-toc.1-1.2.2.2.2.1">
                    <t indent="0" pn="section-toc.1-1.2.2.2.2.1.1"><xref derivedContent="2.2.1" format="counter" sectionFormat="of" target="section-2.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-documentation-of-server-cap">Documentation of Server Capabilities</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.2.2.2">
                    <t indent="0" pn="section-toc.1-1.2.2.2.2.2.1"><xref derivedContent="2.2.2" format="counter" sectionFormat="of" target="section-2.2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-preloading-default-configur">Preloading Default Configuration Data</xref></t>
                  </li>
                  <li pn="section-toc.1-1.2.2.2.2.3">
                    <t indent="0" pn="section-toc.1-1.2.2.2.2.3.1"><xref derivedContent="2.2.3" format="counter" sectionFormat="of" target="section-2.2.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-storing-diagnostics-data">Storing Diagnostics Data</xref></t>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-yang-instance-data-model">YANG Instance Data Model</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-tree-diagram">Tree Diagram</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-yang-model">YANG Model</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2">
              <li pn="section-toc.1-1.5.2.1">
                <t indent="0" pn="section-toc.1-1.5.2.1.1"><xref derivedContent="5.1" format="counter" sectionFormat="of" target="section-5.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-uri-registration">URI Registration</xref></t>
              </li>
              <li pn="section-toc.1-1.5.2.2">
                <t indent="0" pn="section-toc.1-1.5.2.2.1"><xref derivedContent="5.2" format="counter" sectionFormat="of" target="section-5.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-yang-module-name-registrati">YANG Module Name Registration</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2">
              <li pn="section-toc.1-1.6.2.1">
                <t indent="0" pn="section-toc.1-1.6.2.1.1"><xref derivedContent="6.1" format="counter" sectionFormat="of" target="section-6.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.6.2.2">
                <t indent="0" pn="section-toc.1-1.6.2.2.1"><xref derivedContent="6.2" format="counter" sectionFormat="of" target="section-6.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-backwards-compatibility">Backwards Compatibility</xref></t>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="Appendix B" format="default" sectionFormat="of" target="section-appendix.b"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-detailed-use-cases">Detailed Use Cases</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2">
              <li pn="section-toc.1-1.8.2.1">
                <t indent="0" pn="section-toc.1-1.8.2.1.1"><xref derivedContent="B.1" format="counter" sectionFormat="of" target="section-appendix.b.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-use-case-1-early-documentat">Use Case 1: Early Documentation of Server Capabilities</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.2">
                <t indent="0" pn="section-toc.1-1.8.2.2.1"><xref derivedContent="B.2" format="counter" sectionFormat="of" target="section-appendix.b.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-use-case-2-preloading-data">Use Case 2: Preloading Data</xref></t>
              </li>
              <li pn="section-toc.1-1.8.2.3">
                <t indent="0" pn="section-toc.1-1.8.2.3.1"><xref derivedContent="B.3" format="counter" sectionFormat="of" target="section-appendix.b.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-use-case-3-documenting-fact">Use Case 3: Documenting Factory Default Settings</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgments">Acknowledgments</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.d"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="include" removeInRFC="false" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1">
        There is a need to document data defined in YANG models when a live server is unavailable. 
        Data is often needed at design time, implementation time, or even later   
        when a live running server is unavailable.  
        To facilitate this offline delivery of data, this document specifies a standard
        format for YANG instance data sets and YANG instance data files.
        The format of the instance data set is defined by the "ietf-yang-instance-data"
        YANG module; see <xref target="instance_data_yam" format="default" sectionFormat="of" derivedContent="Section 3"/>.
        The YANG data model in this document conforms to the Network
        Management Datastore Architecture (NMDA) defined in <xref target="RFC8342" format="default" sectionFormat="of" derivedContent="RFC8342"/>.
      </t>
      <t indent="0" pn="section-1-2">The following is a list of already-implemented and potential use cases.
      </t>
      <ol spacing="normal" type="UC%d" indent="adaptive" start="1" pn="section-1-3">
	<li anchor="uc1" pn="section-1-3.1" derivedCounter="UC1">Documentation of server capabilities</li>
        <li anchor="uc2" pn="section-1-3.2" derivedCounter="UC2">Preloading default configuration data</li>
        <li anchor="uc3" pn="section-1-3.3" derivedCounter="UC3">Documenting factory default settings</li>
        <li anchor="uc4" pn="section-1-3.4" derivedCounter="UC4">Storing the configuration of a device, e.g., for backup, archive, or 
            audit purposes</li>
        <li anchor="uc5" pn="section-1-3.5" derivedCounter="UC5">Storing diagnostics data</li>
        <li anchor="uc6" pn="section-1-3.6" derivedCounter="UC6">Allowing YANG instance data to potentially be carried within other inter-process communication (IPC) message formats</li>
        <li anchor="uc7" pn="section-1-3.7" derivedCounter="UC7">Default instance data used as part of a templating solution</li>
        <li anchor="uc8" pn="section-1-3.8" derivedCounter="UC8">Providing data examples in RFCs or internet drafts</li>
      </ol>
      <t indent="0" pn="section-1-4"><xref target="detailed_use_cases" format="default" sectionFormat="of" derivedContent="Appendix B"/> describes the first three use 
        cases in detail. 
      </t>
      <t indent="0" pn="section-1-5">
        There are  many and varied use cases where YANG instance data 
        could be used. This document does not limit future uses of instance data 
        sets, so specifying how and when to use YANG instance data 
        is out of scope for this document. It is anticipated that other
        documents will define specific use cases. Use cases are listed 
        only as examples.
      </t>
      <section anchor="terminology" numbered="true" toc="include" removeInRFC="false" pn="section-1.1">
        <name slugifiedName="name-terminology">Terminology</name>
        <t indent="0" pn="section-1.1-1">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
        <dl indent="3" newline="false" spacing="normal" pn="section-1.1-2">
          <dt pn="section-1.1-2.1">Instance Data:</dt>
          <dd pn="section-1.1-2.2">A collection of instantiated data nodes.</dd>
          <dt pn="section-1.1-2.3">Instance Data Set:</dt>
          <dd pn="section-1.1-2.4">A named set of data items annotated with metadata 
          that can be used as instance data in a YANG data tree.</dd>
          <dt pn="section-1.1-2.5">Instance Data File:</dt>
          <dd pn="section-1.1-2.6">A file containing an instance data set formatted 
          according to the rules described in this document.</dd>
          <dt pn="section-1.1-2.7">Content-schema:</dt>
          <dd pn="section-1.1-2.8">A set of YANG modules with their revision, supported 
          features, and deviations for which the instance data set contains instance data.</dd>
          <dt pn="section-1.1-2.9">Content-defining YANG Module:</dt>
          <dd pn="section-1.1-2.10">An individual YANG module that is part of the content-schema.</dd>
        </dl>
        <t indent="0" pn="section-1.1-3">The term "server" is used as defined in <xref target="RFC8342" format="default" sectionFormat="of" derivedContent="RFC8342"/>.</t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-1.2">
        <name slugifiedName="name-principles">Principles</name>
        <t indent="0" pn="section-1.2-1">The following is a list of the basic principles of the instance data format:
        </t>
        <ol spacing="normal" type="P%d" indent="adaptive" start="1" pn="section-1.2-2"><li pn="section-1.2-2.1" derivedCounter="P1">Two standard formats shall be defined based on the XML and 
              JSON encodings.</li>
          <li pn="section-1.2-2.2" derivedCounter="P2">Instance data shall reuse existing encoding rules for
              YANG-defined data.
            </li>
          <li pn="section-1.2-2.3" derivedCounter="P3">Metadata about the instance data set 
              (<xref target="instance_data_set_metadata" format="default" sectionFormat="of" derivedContent="Section 2, Paragraph 14"/>) shall be defined.</li>
          <li pn="section-1.2-2.4" derivedCounter="P4">A YANG instance data set shall be allowed to contain data 
              for multiple YANG modules.</li>
          <li pn="section-1.2-2.5" derivedCounter="P5">Instance data shall be allowed to contain configuration data, 
              state data, or a mix of the two.</li>
          <li pn="section-1.2-2.6" derivedCounter="P6">Partial data sets shall be allowed.</li>
          <li pn="section-1.2-2.7" derivedCounter="P7">The YANG instance data format shall be usable for any data for which   
              YANG module(s) are defined and available to the reader, independent 
              of whether the module is implemented by a server.</li>
          <li pn="section-1.2-2.8" derivedCounter="P8">It shall be possible to report the identity of the datastore with which the
            instance data set is associated.</li>
        </ol>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-1.3">
        <name slugifiedName="name-delivery-of-instance-data">Delivery of Instance Data</name>
        <t indent="0" pn="section-1.3-1">Instance data sets that are produced as 
            a result of some sort of specification or design effort
            may be available without the need for a live 
            server, e.g., via download from the vendor's website or in any other 
            way that product documentation is distributed.</t>
        <t indent="0" pn="section-1.3-2">Other instance data sets may be read from or produced by the YANG 
            server itself, e.g., <xref target="uc5" format="none" sectionFormat="of" derivedContent="">UC5</xref> documenting diagnostic data.</t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-1.4">
        <name slugifiedName="name-data-life-cycle">Data Life Cycle</name>
        <t indent="0" pn="section-1.4-1">
              A YANG instance data set is created at a specific  
              point of time. If the data changes afterwards, the instance data set 
              will no longer represent the current data unless it is updated. 
              The current values may be
              retrieved at runtime via NETCONF/RESTCONF or 
              received, e.g., in YANG-Push notifications.               
        </t>
        <t indent="0" pn="section-1.4-2">
              Whether the instance data changes and, if so, when and how
              should be described either in the instance data set's description
              statement or in some other implementation-specific manner.
        </t>
      </section>
    </section>
    <section anchor="instance_data_file_format" numbered="true" toc="include" removeInRFC="false" pn="section-2">
      <name slugifiedName="name-instance-data-file-format">Instance Data File Format</name>
      <t indent="0" pn="section-2-1">
        A YANG instance data file <bcp14>MUST</bcp14> contain a single instance data set and no
        additional data.
      </t>
      <t indent="0" pn="section-2-2">The format of the instance data set is defined  by the 
        "ietf-yang-instance-data" YANG module.
        It is made up of a header part and content-data. 
        The header part carries metadata for the instance data set.
        The content-data, defined as an anydata data node, carries
        the instance data that the user wants to document and/or provide. 
        The syntax and semantics of content-data are defined by the content-schema.    
      </t>
      <t indent="0" pn="section-2-3">Two formats are specified based on the XML and JSON YANG encodings. The 
        file formats are achieved by applying the respective XML and JSON 
        encoding rules for the YANG structure included in this document.
        Later, as other YANG encodings (e.g., CBOR) are defined, further 
        instance data formats may be specified.
      </t>
      <t indent="0" pn="section-2-4">The content-data part <bcp14>MUST</bcp14> conform to the content-schema while allowing for the 
        exceptions listed below. The content-data part <bcp14>SHALL</bcp14> follow the 
        encoding rules defined in  <xref target="RFC7950" format="default" sectionFormat="of" derivedContent="RFC7950"/> for XML and 
        <xref target="RFC7951" format="default" sectionFormat="of" derivedContent="RFC7951"/> for JSON and <bcp14>MUST</bcp14> use UTF-8 character encoding.
        Content-data <bcp14>MAY</bcp14> include:
      </t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-5">
        <li pn="section-2-5.1">metadata, as defined by <xref target="RFC7952" format="default" sectionFormat="of" derivedContent="RFC7952"/>.</li>
        <li pn="section-2-5.2">origin metadata, as specified in 
          <xref target="RFC8526" format="default" sectionFormat="of" derivedContent="RFC8526"/> and <xref target="RFC8527" format="default" sectionFormat="of" derivedContent="RFC8527"/>.</li>
        <li pn="section-2-5.3">implementation-specific metadata relevant to individual 
            data nodes. Unknown metadata <bcp14>MUST</bcp14> be ignored by users of 
            instance data, allowing it to be used 
            later for other purposes.</li>
      </ul>
      <t indent="0" pn="section-2-6">An instance data set <bcp14>MAY</bcp14> contain data for any number of 
        YANG modules; if needed, it <bcp14>MAY</bcp14> carry the complete configuration and state
        data for a server.
        Default values should be excluded where they do not provide 
        additional useful data.
      </t>
      <t indent="0" pn="section-2-7">
        Configuration ("config true") and operational state data ("config false") 
        <bcp14>MAY</bcp14> be mixed in the instance data file.        
      </t>
      <t indent="0" pn="section-2-8">
        Instance data files <bcp14>MAY</bcp14> contain partial data sets. This means "mandatory", 
        "min-elements", "require-instance true", "must", and "when" constraints <bcp14>MAY</bcp14> be violated.      
      </t>
      <t indent="0" pn="section-2-9">The name of the instance data file <bcp14>SHOULD</bcp14> be of the following form (using ABNF notation <xref target="RFC5234" format="default" sectionFormat="of" derivedContent="RFC5234"/>):
      </t>
      <sourcecode name="filename-abnf" type="abnf" markers="false" pn="section-2-10">
   instance-data-set-name ["@" ( revision-date / timestamp ) ]
                  ( ".xml" / ".json" )
</sourcecode>
      <t indent="0" pn="section-2-11">Examples include:</t>
      <artwork align="left" pn="section-2-12">
      acme-router-modules.xml
      acme-router-modules@2018-01-25.xml
      acme-router-modules@2018-01-25T15_06_34_3+01_00.json
</artwork>
      <t indent="0" pn="section-2-13">
        If the leaf "name" is present in the instance data header, 
        its value <bcp14>SHOULD</bcp14> be used for the "instance-data-set-name" in the filename.
        
        If the "revision-date" is present in the filename, it <bcp14>MUST</bcp14> conform to 
        the format of the revision-date leaf in the YANG model. 
        If the "revision-date" is present in both the filename and the
        instance data header, the revision date in the filename <bcp14>MUST</bcp14> be
        set to the latest revision date inside the instance data set.
        
        If the "timestamp" is present in the filename, it <bcp14>MUST</bcp14> conform to 
        the format of the timestamp leaf in the YANG model except for 
        replacing colons as described below. 
        If the "timestamp" is present in both the filename and the
        instance data header, the timestamp in the filename <bcp14>SHOULD</bcp14> be
        set to the timestamp inside the instance data set; any colons, 
        if present, shall be replaced by underscores.
      </t>
      <t anchor="instance_data_set_metadata" indent="0" pn="section-2-14">Metadata, information about the 
      data set itself, <bcp14>MUST</bcp14> be included. Some metadata items are 
      defined in the YANG module "ietf-yang-instance-data", but other items <bcp14>MAY</bcp14> 
      be used.</t>
      <t indent="0" pn="section-2-15"> 
      Metadata <bcp14>MUST</bcp14> include:
      </t>
      <ul empty="true" spacing="normal" bare="false" indent="3" pn="section-2-16">
        <li pn="section-2-16.1">
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-16.1.1">
            <li pn="section-2-16.1.1.1">Version of the YANG instance data format (if not explicitly present, the default value is used).</li>
          </ul>
        </li>
      </ul>
      <t indent="0" pn="section-2-17">
      Metadata <bcp14>SHOULD</bcp14> include:
      </t>
      <ul empty="true" spacing="normal" bare="false" indent="3" pn="section-2-18">
        <li pn="section-2-18.1">
          <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-2-18.1.1">
            <li pn="section-2-18.1.1.1">Name of the data set.</li>
            <li pn="section-2-18.1.1.2">Content-schema specification (i.e., the "content-schema" node).</li>
            <li pn="section-2-18.1.1.3">Description of the instance data set. The description <bcp14>SHOULD</bcp14> 
            contain information on whether and how the data can change during 
            the lifetime of the server.
          </li>
            <li pn="section-2-18.1.1.4">An indication of whether default values are included. 
            The default handling uses the concepts defined in <xref target="RFC6243" format="default" sectionFormat="of" derivedContent="RFC6243"/>;
            however, as only concepts are re-used, users of instance data sets
            do not need to support <xref target="RFC6243" format="default" sectionFormat="of" derivedContent="RFC6243"/>.
          </li>
          </ul>
        </li>
      </ul>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-2.1">
        <name slugifiedName="name-specifying-the-content-sche">Specifying the Content Schema</name>
        <t indent="0" pn="section-2.1-1">To properly understand and use an instance data set, the user needs to 
          know the content-schema. The content-schema can be specified either in external documents or within the instance data set. 
          In the latter case, one of the following methods <bcp14>MUST</bcp14> be used:
        </t>
        <dl spacing="normal" indent="3" newline="false" pn="section-2.1-2">
          <dt pn="section-2.1-2.1">Inline method:</dt>
          <dd pn="section-2.1-2.2">Include the needed information as part of the 
          instance data set.</dd>
          <dt pn="section-2.1-2.3">Simplified-inline method:</dt>
          <dd pn="section-2.1-2.4">Include the needed information as part of 
            the instance data set; only the modules' name and revision-date are used.</dd>
          <dt pn="section-2.1-2.5">URI method:</dt>
          <dd pn="section-2.1-2.6">Include a URI that references another YANG instance 
            data file. This instance data file will use the same content-schema
            as the referenced YANG instance data file (if you don't want to repeat the info again and again).</dd>
        </dl>
        <t indent="0" pn="section-2.1-3">
          Additional methods, e.g., a YANG-package-based solution may be added later.
        </t>
        <t indent="0" pn="section-2.1-4">Note that the specified content-schema only indicates the set of 
          modules that were used to define this YANG instance data set. 
          Sometimes instance data may be used for a server supporting a 
          different YANG module set (e.g., for the "Preloading default 
          configuration data" use case, <xref target="uc2" format="none" sectionFormat="of" derivedContent="">UC2</xref> in <xref target="intro" format="default" sectionFormat="of" derivedContent="Section 1"/>, the instance 
          data set may not be updated every time the YANG modules on the 
          server are updated).

          Whether an instance data set originally defined using a specific 
          content-schema is usable with another schema   
          depends on many factors, including the number of differences and the 
          compatibility between the original and the 
          other schema when considering modules, revisions, features, 
          deviations, the scope of the instance data, etc.  
        </t>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-2.1.1">
          <name slugifiedName="name-inline-method">Inline Method</name>
          <t indent="0" pn="section-2.1.1-1">The "inline-yang-library" anydata data node carries instance data (conforming to 
            "ietf-yang-library@2019-01-04") <xref target="RFC8525" format="default" sectionFormat="of" derivedContent="RFC8525"/> that specifies the content-defining YANG modules, including revision, 
            supported features, deviations, and any additional relevant data.   
            An example of the inline method is provided in <xref target="acme-router-modules-example" format="default" sectionFormat="of" derivedContent="Section 2.2.1"/>.
          </t>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-2.1.2">
          <name slugifiedName="name-simplified-inline-method">Simplified-Inline Method</name>
          <t indent="0" pn="section-2.1.2-1">The instance data set contains a list of content-defining YANG 
             modules, including the revision date for each. 
             Usage of this method implies that the modules are 
             used without any deviations and with all features 
             supported. YANG modules that are only required to satisfy 
             import-only dependencies <bcp14>MAY</bcp14> be excluded from the leaf-list.  
             If they are excluded, then the consumer of the instance data 
             set has to apply the YANG language rules to resolve the imports.
             An example of the simplified-inline method is provided in <xref target="read-only-acm-rules-example" format="default" sectionFormat="of" derivedContent="Section 2.2.2"/>.
          </t>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-2.1.3">
          <name slugifiedName="name-uri-method">URI Method</name>
          <t indent="0" pn="section-2.1.3-1">The "same-schema-as-file" leaf <bcp14>SHALL</bcp14> contain a URI that references another YANG 
            instance data file. The current instance data file will use the same  
            content-schema as the referenced file. 
          </t>
          <t indent="0" pn="section-2.1.3-2">
            The referenced instance data file <bcp14>MAY</bcp14> have no content-data if it is 
            used solely for specifying the content-schema.  
          </t>
          <t indent="0" pn="section-2.1.3-3">
            If a referenced instance data file is unavailable, the content-schema 
            is unknown.
          </t>
          <t indent="0" pn="section-2.1.3-4">
            The URI method is advantageous when the user wants to avoid the 
            overhead of specifying the content-schema in each instance data 
            file -- for example, in <xref target="uc6" format="none" sectionFormat="of" derivedContent="">UC6</xref>, when the system creates a diagnostic file every minute to document the state of the server.  
          </t>
          <t indent="0" pn="section-2.1.3-5">An example of the URI method is provided in <xref target="acme-router-netconf-diagnostics-example" format="default" sectionFormat="of" derivedContent="Section 2.2.3"/>.</t>
        </section>
      </section>
      <section anchor="examples" numbered="true" toc="include" removeInRFC="false" pn="section-2.2">
        <name slugifiedName="name-examples">Examples</name>
        <section anchor="acme-router-modules-example" numbered="true" toc="include" removeInRFC="false" pn="section-2.2.1">
          <name slugifiedName="name-documentation-of-server-cap">Documentation of Server Capabilities</name>
          <t indent="0" pn="section-2.2.1-1">The example file acme-router-modules@2022-01-20.xml reflects <xref target="uc1" format="none" sectionFormat="of" derivedContent="">UC1</xref> in <xref target="intro" format="default" sectionFormat="of" derivedContent="Section 1"/>. 
            It provides a list of supported YANG modules and NETCONF capabilities for a server. 
            It uses the inline method to specify the content-schema.</t>
          <t indent="0" pn="section-2.2.1-2">The example uses artwork folding <xref target="RFC8792" format="default" sectionFormat="of" derivedContent="RFC8792"/>.</t>
          <figure anchor="acme-router-modules" align="left" suppress-title="false" pn="figure-1">
            <sourcecode name="acme-router-modules@2022-01-20.xml" type="xml" markers="false" pn="section-2.2.1-3.1">
========== NOTE: '\' line wrapping per RFC 8792 ===========

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;instance-data-set xmlns=\
    "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"&gt;
  &lt;name&gt;acme-router-modules&lt;/name&gt;
  &lt;content-schema&gt;
    &lt;inline-yang-library&gt;
      &lt;modules-state \
        xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"&gt;
        &lt;module&gt;
          &lt;name&gt;ietf-yang-library&lt;/name&gt;
          &lt;revision&gt;2019-01-04&lt;/revision&gt;
        &lt;/module&gt;
        &lt;module&gt;
          &lt;name&gt;ietf-netconf-monitoring&lt;/name&gt;
          &lt;revision&gt;2010-10-04&lt;/revision&gt;
        &lt;/module&gt;
      &lt;/modules-state&gt;
    &lt;/inline-yang-library&gt;
  &lt;/content-schema&gt;
  &lt;revision&gt;
    &lt;date&gt;2020-10-23&lt;/date&gt;
    &lt;description&gt;Initial version&lt;/description&gt;
  &lt;/revision&gt;
  &lt;description&gt;Defines the minimal set of modules that any \
      acme-router will contain. This minimal set will \
      only change when a new software release is \
      introduced.&lt;/description&gt;
  &lt;contact&gt;info@acme.example.com&lt;/contact&gt;
  &lt;content-data&gt;
    &lt;modules-state \
        xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"&gt;
      &lt;module&gt;
        &lt;name&gt;ietf-yang-library&lt;/name&gt;
        &lt;revision&gt;2019-01-04&lt;/revision&gt;
        &lt;namespace&gt;\
          urn:ietf:params:xml:ns:yang:ietf-yang-library\
        &lt;/namespace&gt;
        &lt;conformance-type&gt;implement&lt;/conformance-type&gt;
      &lt;/module&gt;
      &lt;module&gt;
        &lt;name&gt;ietf-system&lt;/name&gt;
        &lt;revision&gt;2014-08-06&lt;/revision&gt;
       &lt;namespace&gt;urn:ietf:params:xml:ns:yang:ietf-system&lt;/namespace&gt;
        &lt;feature&gt;sys:authentication&lt;/feature&gt;
        &lt;feature&gt;sys:local-users&lt;/feature&gt;
        &lt;deviation&gt;
          &lt;name&gt;acme-system-ext&lt;/name&gt;
          &lt;revision&gt;2018-08-06&lt;/revision&gt;
        &lt;/deviation&gt;
        &lt;conformance-type&gt;implement&lt;/conformance-type&gt;
      &lt;/module&gt;
      &lt;module&gt;
        &lt;name&gt;ietf-netconf-monitoring&lt;/name&gt;
        &lt;revision&gt;2010-10-04&lt;/revision&gt;
        &lt;namespace&gt;\
          urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\
        &lt;/namespace&gt;
        &lt;conformance-type&gt;implement&lt;/conformance-type&gt;
      &lt;/module&gt;
      &lt;module&gt;
        &lt;name&gt;ietf-yang-types&lt;/name&gt;
        &lt;revision&gt;2013-07-15&lt;/revision&gt;
        &lt;namespace&gt;urn:ietf:params:xml:ns:yang:ietf-yang-types\
          &lt;/namespace&gt;
        &lt;conformance-type&gt;import&lt;/conformance-type&gt;
      &lt;/module&gt;
      &lt;module&gt;
        &lt;name&gt;acme-system-ext&lt;/name&gt;
        &lt;revision&gt;2018-08-06&lt;/revision&gt;
        &lt;namespace&gt;\
          urn:rdns:acme.example.com:oammodel:acme-system-ext\
        &lt;/namespace&gt;
        &lt;conformance-type&gt;implement&lt;/conformance-type&gt;
      &lt;/module&gt;
    &lt;/modules-state&gt;
    &lt;netconf-state \
        xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"&gt;
      &lt;capabilities&gt;
        &lt;capability&gt;\
          urn:ietf:params:netconf:capability:validate:1.1\
        &lt;/capability&gt;
      &lt;/capabilities&gt;
    &lt;/netconf-state&gt;
  &lt;/content-data&gt;
&lt;/instance-data-set&gt;
</sourcecode>
          </figure>
        </section>
        <section anchor="read-only-acm-rules-example" numbered="true" toc="include" removeInRFC="false" pn="section-2.2.2">
          <name slugifiedName="name-preloading-default-configur">Preloading Default Configuration Data</name>
          <t indent="0" pn="section-2.2.2-1">The example file read-only-acm-rules@2022-01-20.xml reflects <xref target="uc2" format="none" sectionFormat="of" derivedContent="">UC2</xref> in <xref target="intro" format="default" sectionFormat="of" derivedContent="Section 1"/>. 
            It provides a default rule set for a read-only operator role. 
            It uses the simplified-inline method for specifying the content-schema.</t>
          <figure anchor="read-only-acm-rules" align="left" suppress-title="false" pn="figure-2">
            <sourcecode name="read-only-acm-rules@2022-01-20.xml" type="xml" markers="false" pn="section-2.2.2-2.1">
========== NOTE: '\' line wrapping per RFC 8792 ===========

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;instance-data-set
    xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"&gt;
  &lt;name&gt;read-only-acm-rules&lt;/name&gt;
  &lt;content-schema&gt;
    &lt;module&gt;ietf-netconf-acm@2018-02-14&lt;/module&gt;
  &lt;/content-schema&gt;
  &lt;revision&gt;
    &lt;date&gt;2018-07-04&lt;/date&gt;
    &lt;description&gt;Initial version&lt;/description&gt;
  &lt;/revision&gt;
  &lt;description&gt;Default access control rules for a read-only \
      role. This set of rules will only change when a new  \
      software release is introduced.&lt;/description&gt;
  &lt;content-data&gt;
    &lt;nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm"&gt;
      &lt;enable-nacm&gt;true&lt;/enable-nacm&gt;
      &lt;read-default&gt;deny&lt;/read-default&gt;
      &lt;exec-default&gt;deny&lt;/exec-default&gt;
      &lt;rule-list&gt;
        &lt;name&gt;read-only-role&lt;/name&gt;
        &lt;group&gt;read-only-group&lt;/group&gt;
        &lt;rule&gt;
          &lt;name&gt;read-all&lt;/name&gt;
          &lt;module-name&gt;*&lt;/module-name&gt;
          &lt;access-operation&gt;read&lt;/access-operation&gt;
          &lt;action&gt;permit&lt;/action&gt;
        &lt;/rule&gt;
      &lt;/rule-list&gt;
    &lt;/nacm&gt;
  &lt;/content-data&gt;
&lt;/instance-data-set&gt;
</sourcecode>
          </figure>
        </section>
        <section anchor="acme-router-netconf-diagnostics-example" numbered="true" toc="include" removeInRFC="false" pn="section-2.2.3">
          <name slugifiedName="name-storing-diagnostics-data">Storing Diagnostics Data</name>
          <t indent="0" pn="section-2.2.3-1">The example file acme-router-netconf-diagnostics@2018-01-25T17_00_38Z.json 
            reflects <xref target="uc5" format="none" sectionFormat="of" derivedContent="">UC5</xref> in <xref target="intro" format="default" sectionFormat="of" derivedContent="Section 1"/>. 
            An instance data set that contains 
            statistics about the NETCONF server is produced by the server every 15 minutes. As a new set is produced periodically many times a day, a revision-date 
            would be useless; instead, a timestamp is included.</t>
          <figure anchor="acme-router-netconf-diagnostics" align="left" suppress-title="false" pn="figure-3">
            <sourcecode name="acme-router-netconf-diagnostics@2018-01-25T17_00_38Z.json" type="" markers="false" pn="section-2.2.3-2.1">
========== NOTE: '\' line wrapping per RFC 8792 ===========

{
  "ietf-yang-instance-data:instance-data-set": {
    "name": "acme-router-netconf-diagnostics",
    "content-schema": {
      "same-schema-as-file": "file:///acme-diagnostics-schema.json"
    },
    "timestamp": "2018-01-25T17:00:38Z",
    "description":  ["NETCONF statistics, \
        The data may change at any time."],
    "content-data": {
      "ietf-netconf-monitoring:netconf-state": {
        "statistics": {
          "netconf-start-time ": "2018-12-05T17:45:00Z",
          "in-bad-hellos ": "32",
          "in-sessions ": "397",
          "dropped-sessions ": "87",
          "in-rpcs ": "8711",
          "in-bad-rpcs ": "408",
          "out-rpc-errors ": "408",
          "out-notifications": "39007"
        }
      }
    }
  }
}
</sourcecode>
          </figure>
        </section>
      </section>
    </section>
    <section anchor="instance_data_yam" numbered="true" toc="include" removeInRFC="false" pn="section-3">
      <name slugifiedName="name-yang-instance-data-model">YANG Instance Data Model</name>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.1">
        <name slugifiedName="name-tree-diagram">Tree Diagram</name>
        <t indent="0" pn="section-3.1-1">
          The following tree diagram <xref target="RFC8340" format="default" sectionFormat="of" derivedContent="RFC8340"/>
          provides an overview of the data model.
        </t>
        <sourcecode name="" type="yangtree" markers="false" pn="section-3.1-2">
module: ietf-yang-instance-data
  structure instance-data-set:
    +--name?                string
    +--format-version?      string
    +--includes-defaults?   enumeration
    +--content-schema
    |  +--(content-schema-spec)?
    |     +--:(simplified-inline)
    |     |  +--module*                module-with-revision-date
    |     +--:(inline)
    |     |  +--inline-yang-library    &lt;anydata&gt;
    |     +--:(uri)
    |        +--same-schema-as-file?   inet:uri
    +--description*         string
    +--contact?             string
    +--organization?        string
    +--datastore?           ds:datastore-ref
    +--revision* [date]
    |  +--date           string
    |  +--description?   string
    +--timestamp?           yang:date-and-time
    +--content-data?        &lt;anydata&gt;
</sourcecode>
      </section>
      <section anchor="yang-model" numbered="true" toc="include" removeInRFC="false" pn="section-3.2">
        <name slugifiedName="name-yang-model">YANG Model</name>
        <t indent="0" pn="section-3.2-1">
             This YANG module imports typedefs from <xref target="RFC6991" format="default" sectionFormat="of" derivedContent="RFC6991"/>, 
             <xref target="RFC6243" format="default" sectionFormat="of" derivedContent="RFC6243"/>, 
             identities from <xref target="RFC8342" format="default" sectionFormat="of" derivedContent="RFC8342"/>, and 
             the "structure" extension from <xref target="RFC8791" format="default" sectionFormat="of" derivedContent="RFC8791"/>.
             It also references <xref target="RFC8525" format="default" sectionFormat="of" derivedContent="RFC8525"/>.
        </t>
        <sourcecode name="ietf-yang-instance-data@2022-02-17.yang" type="yang" markers="true" pn="section-3.2-2">
module ietf-yang-instance-data {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data";
  prefix yid;

  import ietf-yang-structure-ext {
    prefix sx;
    reference
      "RFC 8791: YANG Data Structure Extensions";
  }
  import ietf-datastores {
    prefix ds;
    reference
      "RFC 8342: Network Management Datastore Architecture (NMDA)";
  }
  import ietf-inet-types {
    prefix inet;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-netconf-with-defaults {
    prefix ncwd;
    reference
      "RFC 6243: With-defaults Capability for NETCONF";
  }

  organization
    "IETF NETMOD Working Group";
  contact
    "WG Web:   &lt;https://datatracker.ietf.org/wg/netmod/&gt;
     WG List:  &lt;mailto:netmod@ietf.org&gt;

     Author:  Balazs Lengyel
        &lt;mailto:balazs.lengyel@ericsson.com&gt;

     Author:  Benoit Claise
        &lt;mailto:benoit.claise@huawei.com&gt;";
  description
    "The module defines the structure and content of YANG
     instance data sets.

     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 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.

     Copyright (c) 2022 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 9195
     (https://www.rfc-editor.org/info/rfc9195); see the RFC itself
     for full legal notices.";

  revision 2022-02-17 {
    description
      "Initial revision.";
    reference
      "RFC 9195: YANG Instance Data File Format";
  }

  typedef module-with-revision-date {
    type string {
      pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'
            + '(@\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1]))?';
      pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
    }
    description
      "A type defining a module name and an optional revision
       date, e.g., ietf-yang-library@2019-01-04.";
  }

  sx:structure instance-data-set {
    description
      "A data structure to define a format for YANG instance
       data.  The majority of the YANG nodes provides metadata
       about the instance data; the instance data itself is
       contained only in the 'content-data' node.";
    leaf name {
      type string;
      description
        "An arbitrary name for the YANG instance data set.  This
         value is primarily used for descriptive purposes.  However,
         when the instance data set is saved to a file, then the
         filename MUST encode the name's value per Section 2
         of RFC 9195.";
    }
    leaf format-version {
      type string {
        pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])';
      }
      default "2022-01-20";
      description
        "The 'revision' of the 'ietf-yang-instance-data' module
         used to encode this 'instance-data-set'.";
    }
    leaf includes-defaults {
      type ncwd:with-defaults-mode;
      default "report-all";
      description
        "Indicates how data nodes with default values are
         represented for all data nodes contained in the
         instance-data-set.

         It uses the same definitions as per Section 3 of RFC 6243
         but applied in the context of an instance data file rather
         than a NETCONF request using the &lt;with-defaults&gt;
         parameter.

         For JSON files, the encoding of the 'report-all-tagged'
         option is as defined in Section 4.8.9 of RFC 8040.";
      reference
        "RFC 6243: With-defaults Capability for NETCONF";
    }
    container content-schema {
      description
        "The content schema (i.e., YANG modules) used to create
         the instance data set.
         If not present, the user needs to obtain the information
         through external documents.";
      choice content-schema-spec {
        description
          "Specification of the content-schema.";
        case simplified-inline {
          leaf-list module {
            type module-with-revision-date;
            min-elements 1;
            description
              "The list of content-defining YANG modules.

               The value SHALL start with the module name.
               If the module contains a revision statement, the
               revision date SHALL be included in the leaf-list
               entry, e.g., ietf-yang-library@2019-01-04.

               Usage of this leaf-list implies the modules are
               used without any deviations and with all features
               supported. Multiple revisions of the same module
               MUST NOT be specified.";
          }
        }
        case inline {
          anydata inline-yang-library {
            mandatory true;
            description
              "Instance data corresponding to the
               ietf-yang-library@2019-01-04 defining
               the set of content-defining YANG modules for
               this instance-data-set.";
          }
        }
        case uri {
          leaf same-schema-as-file {
            type inet:uri;
            description
              "A reference to another YANG instance data file.
               This instance data file uses the same
               content schema as the referenced file.

               Referenced files using the 'inline' or the
               'simplified-inline' methods MUST be supported.
               Referenced files using the 'URI method' MAY be
               supported.

               The URL schemes 'file://' and 'https://' MUST
               be supported; other schemes MAY also be
               supported.";
          }
        }
      }
    }
    leaf-list description {
      type string;
      description
        "Description of the instance data set.";
    }
    leaf contact {
      type string;
      description
        "Contact information for the person or
         organization to whom queries concerning this
         instance data set should be sent.";
    }
    leaf organization {
      type string;
      description
        "Organization responsible for the instance
         data set.";
    }
    leaf datastore {
      type ds:datastore-ref;
      description
        "The identity of the datastore with which the
         instance data set is associated, e.g., the datastore from
         where the data was read, the datastore into which the data
         may be loaded, or the datastore that is being documented.
         If a single specific datastore cannot be specified, the
         leaf MUST be absent.

         If this leaf is absent, then the datastore to which the
         instance data belongs is unspecified.";
    }
    list revision {
      key "date";
      description
        "Instance data sets that are produced as
         a result of some sort of specification or design effort
         SHOULD have at least one revision entry.  For every
         published editorial change, a new unique revision SHOULD
         be added in front of the revisions sequence so that all
         revisions are in reverse chronological order.

         In cases of instance data sets that are read from
         or produced by a server or otherwise subject to
         frequent updates or changes, revision
         SHOULD NOT be present.";
      leaf date {
        type string {
          pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])';
        }
        description
          "Specifies the date the instance data set
           was last modified. Formatted as YYYY-MM-DD.";
      }
      leaf description {
        type string;
        description
          "Description of this revision of the instance data set.";
      }
    }
    leaf timestamp {
      type yang:date-and-time;
      description
        "The date and time when the instance data set
         was last modified.

         In cases of instance data sets that are read from or
         produced by a server or otherwise subject to frequent
         updates or changes, the timestamp SHOULD be present.

         If both a revision list entry and timestamp are present,
         the timestamp SHOULD contain the same date as the
         latest revision statement.";
    }
    anydata content-data {
      description
        "Contains the real instance data.
         The data MUST conform to the relevant YANG modules
         specified either in the content-schema or in some other
         implementation-specific manner.";
    }
  }
}
</sourcecode>
      </section>
    </section>
    <section anchor="security" numbered="true" toc="include" removeInRFC="false" pn="section-4">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-4-1">The YANG module defined in this document only defines a wrapper structure
        specifying a format and a metadata header for YANG 
        instance data defined by the content-schema. Because of this,  
        the security considerations template for YANG models in 
        <xref target="RFC8407" sectionFormat="of" section="3.7.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8407#section-3.7.1" derivedContent="RFC8407"/> is not followed.        
        The instance data is designed to be accessed as a stored file or 
        over any file access method or protocol.
      </t>
      <t indent="0" pn="section-4-2">The document does not specify any method to influence the 
        behavior of a server.</t>
      <t indent="0" pn="section-4-3">
        The header part is usually not security sensitive; however, sensitive 
        information may be included, in which case it needs to be handled securely, 
        as mentioned below. Information to consider includes:
      </t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-4-4">
        <li pn="section-4-4.1">If the URI method is used for specification of the content-schema and 
            the URI includes a userinfo subcomponent</li>
        <li pn="section-4-4.2">Any description text</li>
      </ul>
      <t indent="0" pn="section-4-5">The content part may contain sensitive data.
        The security sensitivity of this data is completely dependent on 
        the content-schema.
        Depending on the nature of the instance data, instance data 
        files <bcp14>MAY</bcp14> need to be handled securely. 
        The same kind of handling should be applied to this file at rest and 
        in transit that would be needed for the result of a read operation 
        returning the same data.  These in-transit protection mechanisms will 
        also mitigate integrity issues when transporting the file.
      </t>
      <t indent="0" pn="section-4-6">Instance data files should be protected against modification or 
        unauthorized access using normal file-handling mechanisms. 
        When copying the original files or providing file access for
	additional users, care should be taken not to reveal information
	unintentionally.
      </t>
      <t indent="0" pn="section-4-7">If the URI method is used for specification of the content-schema, 
        there is a risk that the config schema section in the referenced YANG 
        instance data file may be altered maliciously or even as part of its normal 
        handling. In this case, the content-schema might differ from the one 
        expected. Protecting the integrity and stability of the referenced 
        file should be ensured.
      </t>
    </section>
    <section anchor="iana" numbered="true" toc="include" removeInRFC="false" pn="section-5">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-5-1">This document registers one URI and one YANG module.</t>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-5.1">
        <name slugifiedName="name-uri-registration">URI Registration</name>
        <t indent="0" pn="section-5.1-1">This document registers the following URI in the <xref target="RFC3688" format="default" sectionFormat="of" derivedContent="RFC3688">
          "IETF XML Registry"</xref>:</t>
        <dl spacing="compact" indent="3" newline="false" pn="section-5.1-2">
          <dt pn="section-5.1-2.1">URI:</dt>
          <dd pn="section-5.1-2.2">urn:ietf:params:xml:ns:yang:ietf-yang-instance-data</dd>
          <dt pn="section-5.1-2.3">Registrant Contact:</dt>
          <dd pn="section-5.1-2.4">The IESG.</dd>
          <dt pn="section-5.1-2.5">XML:</dt>
          <dd pn="section-5.1-2.6">N/A, the requested URI is an XML namespace.</dd>
        </dl>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-5.2">
        <name slugifiedName="name-yang-module-name-registrati">YANG Module Name Registration</name>
        <t indent="0" pn="section-5.2-1">This document registers the following YANG module in the "YANG Module Names"
          registry <xref target="RFC6020" format="default" sectionFormat="of" derivedContent="RFC6020"/>:</t>
        <dl spacing="compact" indent="3" newline="false" pn="section-5.2-2">
          <dt pn="section-5.2-2.1">Name:</dt>
          <dd pn="section-5.2-2.2">ietf-yang-instance-data</dd>
          <dt pn="section-5.2-2.3">Namespace:</dt>
          <dd pn="section-5.2-2.4">urn:ietf:params:xml:ns:yang:ietf-yang-instance-data</dd>
          <dt pn="section-5.2-2.5">Prefix:</dt>
          <dd pn="section-5.2-2.6">yid</dd>
          <dt pn="section-5.2-2.7">Reference:</dt>
          <dd pn="section-5.2-2.8">RFC 9195</dd>
        </dl>
      </section>
    </section>
  </middle>
  <back>
    <references pn="section-6">
      <name slugifiedName="name-references">References</name>
      <references pn="section-6.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234" quoteTitle="true" derivedAnchor="RFC5234">
          <front>
            <title>Augmented BNF for Syntax Specifications: ABNF</title>
            <author initials="D." surname="Crocker" fullname="D. Crocker" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Overell" fullname="P. Overell">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2008" month="January"/>
            <abstract>
              <t indent="0">Internet technical specifications often need to define a formal syntax.  Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications.  The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power.  The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges.  This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="68"/>
          <seriesInfo name="RFC" value="5234"/>
          <seriesInfo name="DOI" value="10.17487/RFC5234"/>
        </reference>
        <reference anchor="RFC6020" target="https://www.rfc-editor.org/info/rfc6020" quoteTitle="true" derivedAnchor="RFC6020">
          <front>
            <title>YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2010" month="October"/>
            <abstract>
              <t indent="0">YANG is a data modeling language used to model configuration and state data manipulated by the Network Configuration Protocol (NETCONF), NETCONF remote procedure calls, and NETCONF notifications. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6020"/>
          <seriesInfo name="DOI" value="10.17487/RFC6020"/>
        </reference>
        <reference anchor="RFC6243" target="https://www.rfc-editor.org/info/rfc6243" quoteTitle="true" derivedAnchor="RFC6243">
          <front>
            <title>With-defaults Capability for NETCONF</title>
            <author initials="A." surname="Bierman" fullname="A. Bierman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="B." surname="Lengyel" fullname="B. Lengyel">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2011" month="June"/>
            <abstract>
              <t indent="0">The Network Configuration Protocol (NETCONF) defines ways to read and edit configuration data from a NETCONF server.  In some cases, part of this data may not be set by the NETCONF client, but rather a default value known to the server is used instead.  In many situations the NETCONF client has a priori knowledge about default data, so the NETCONF server does not need to save it in a NETCONF configuration datastore or send it to the client in a retrieval operation reply.  In other situations the NETCONF client will need this data from the server.  Not all server implementations treat this default data the same way.  This document defines a capability-based extension to the NETCONF protocol that allows the NETCONF client to identify how defaults are processed by the server, and also defines new mechanisms for client control of server processing of default data.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6243"/>
          <seriesInfo name="DOI" value="10.17487/RFC6243"/>
        </reference>
        <reference anchor="RFC6991" target="https://www.rfc-editor.org/info/rfc6991" quoteTitle="true" derivedAnchor="RFC6991">
          <front>
            <title>Common YANG Data Types</title>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2013" month="July"/>
            <abstract>
              <t indent="0">This document introduces a collection of common data types to be used with the YANG data modeling language.  This document obsoletes RFC 6021.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6991"/>
          <seriesInfo name="DOI" value="10.17487/RFC6991"/>
        </reference>
        <reference anchor="RFC7950" target="https://www.rfc-editor.org/info/rfc7950" quoteTitle="true" derivedAnchor="RFC7950">
          <front>
            <title>The YANG 1.1 Data Modeling Language</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2016" month="August"/>
            <abstract>
              <t indent="0">YANG is a data modeling language used to model configuration data, state data, Remote Procedure Calls, and notifications for network management protocols.  This document describes the syntax and semantics of version 1.1 of the YANG language.  YANG version 1.1 is a maintenance release of the YANG language, addressing ambiguities and defects in the original specification.  There are a small number of backward incompatibilities from YANG version 1.  This document also specifies the YANG mappings to the Network Configuration Protocol (NETCONF).</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7950"/>
          <seriesInfo name="DOI" value="10.17487/RFC7950"/>
        </reference>
        <reference anchor="RFC7951" target="https://www.rfc-editor.org/info/rfc7951" quoteTitle="true" derivedAnchor="RFC7951">
          <front>
            <title>JSON Encoding of Data Modeled with YANG</title>
            <author initials="L." surname="Lhotka" fullname="L. Lhotka">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2016" month="August"/>
            <abstract>
              <t indent="0">This document defines encoding rules for representing configuration data, state data, parameters of Remote Procedure Call (RPC) operations or actions, and notifications defined using YANG as JavaScript Object Notation (JSON) text.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7951"/>
          <seriesInfo name="DOI" value="10.17487/RFC7951"/>
        </reference>
        <reference anchor="RFC7952" target="https://www.rfc-editor.org/info/rfc7952" quoteTitle="true" derivedAnchor="RFC7952">
          <front>
            <title>Defining and Using Metadata with YANG</title>
            <author initials="L." surname="Lhotka" fullname="L. Lhotka">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2016" month="August"/>
            <abstract>
              <t indent="0">This document defines a YANG extension that allows for defining metadata annotations in YANG modules.  The document also specifies XML and JSON encoding of annotations and other rules for annotating instances of YANG data nodes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7952"/>
          <seriesInfo name="DOI" value="10.17487/RFC7952"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="May"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC8342" target="https://www.rfc-editor.org/info/rfc8342" quoteTitle="true" derivedAnchor="RFC8342">
          <front>
            <title>Network Management Datastore Architecture (NMDA)</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Shafer" fullname="P. Shafer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Wilton" fullname="R. Wilton">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="March"/>
            <abstract>
              <t indent="0">Datastores are a fundamental concept binding the data models written in the YANG data modeling language to network management protocols such as the Network Configuration Protocol (NETCONF) and RESTCONF. This document defines an architectural framework for datastores based on the experience gained with the initial simpler model, addressing requirements that were not well supported in the initial model.  This document updates RFC 7950.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8342"/>
          <seriesInfo name="DOI" value="10.17487/RFC8342"/>
        </reference>
        <reference anchor="RFC8525" target="https://www.rfc-editor.org/info/rfc8525" quoteTitle="true" derivedAnchor="RFC8525">
          <front>
            <title>YANG Library</title>
            <author initials="A." surname="Bierman" fullname="A. Bierman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Wilton" fullname="R. Wilton">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="March"/>
            <abstract>
              <t indent="0">This document describes a YANG library that provides information about the YANG modules, datastores, and datastore schemas used by a network management server.  Simple caching mechanisms are provided to allow clients to minimize retrieval of this information.  This version of the YANG library supports the Network Management Datastore Architecture (NMDA) by listing all datastores supported by a network management server and the schema that is used by each of these datastores.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8525"/>
          <seriesInfo name="DOI" value="10.17487/RFC8525"/>
        </reference>
        <reference anchor="RFC8526" target="https://www.rfc-editor.org/info/rfc8526" quoteTitle="true" derivedAnchor="RFC8526">
          <front>
            <title>NETCONF Extensions to Support the Network Management Datastore Architecture</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Shafer" fullname="P. Shafer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Wilton" fullname="R. Wilton">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="March"/>
            <abstract>
              <t indent="0">This document extends the Network Configuration Protocol (NETCONF) defined in RFC 6241 in order to support the Network Management Datastore Architecture (NMDA) defined in RFC 8342.</t>
              <t indent="0">This document updates RFCs 6241 and 7950.  The update to RFC 6241 adds new &lt;get-data&gt; and &lt;edit-data&gt; operations and augments existing &lt;lock&gt;, &lt;unlock&gt;, and &lt;validate&gt; operations.  The update to RFC 7950 requires the usage of the YANG library (described in RFC 8525) by NETCONF servers implementing the NMDA.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8526"/>
          <seriesInfo name="DOI" value="10.17487/RFC8526"/>
        </reference>
        <reference anchor="RFC8527" target="https://www.rfc-editor.org/info/rfc8527" quoteTitle="true" derivedAnchor="RFC8527">
          <front>
            <title>RESTCONF Extensions to Support the Network Management Datastore Architecture</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Shafer" fullname="P. Shafer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Wilton" fullname="R. Wilton">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="March"/>
            <abstract>
              <t indent="0">This document extends the RESTCONF protocol defined in RFC 8040 in order to support the Network Management Datastore Architecture (NMDA) defined in RFC 8342.</t>
              <t indent="0">This document updates RFC 8040 by introducing new datastore resources, adding a new query parameter, and requiring the usage of the YANG library (described in RFC 8525) by RESTCONF servers implementing the NMDA.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8527"/>
          <seriesInfo name="DOI" value="10.17487/RFC8527"/>
        </reference>
        <reference anchor="RFC8791" target="https://www.rfc-editor.org/info/rfc8791" quoteTitle="true" derivedAnchor="RFC8791">
          <front>
            <title>YANG Data Structure Extensions</title>
            <author initials="A." surname="Bierman" fullname="A. Bierman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Björklund" fullname="M. Björklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2020" month="June"/>
            <abstract>
              <t indent="0">This document describes YANG mechanisms for defining abstract data structures with YANG.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8791"/>
          <seriesInfo name="DOI" value="10.17487/RFC8791"/>
        </reference>
      </references>
      <references pn="section-6.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC3688" target="https://www.rfc-editor.org/info/rfc3688" quoteTitle="true" derivedAnchor="RFC3688">
          <front>
            <title>The IETF XML Registry</title>
            <author initials="M." surname="Mealling" fullname="M. Mealling">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2004" month="January"/>
            <abstract>
              <t indent="0">This document describes an IANA maintained registry for IETF standards which use Extensible Markup Language (XML) related items such as Namespaces, Document Type Declarations (DTDs), Schemas, and Resource Description Framework (RDF) Schemas.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="81"/>
          <seriesInfo name="RFC" value="3688"/>
          <seriesInfo name="DOI" value="10.17487/RFC3688"/>
        </reference>
        <reference anchor="RFC8340" target="https://www.rfc-editor.org/info/rfc8340" quoteTitle="true" derivedAnchor="RFC8340">
          <front>
            <title>YANG Tree Diagrams</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="L." surname="Berger" fullname="L. Berger" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="March"/>
            <abstract>
              <t indent="0">This document captures the current syntax used in YANG module tree diagrams.  The purpose of this document is to provide a single location for this definition.  This syntax may be updated from time to time based on the evolution of the YANG language.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="215"/>
          <seriesInfo name="RFC" value="8340"/>
          <seriesInfo name="DOI" value="10.17487/RFC8340"/>
        </reference>
        <reference anchor="RFC8407" target="https://www.rfc-editor.org/info/rfc8407" quoteTitle="true" derivedAnchor="RFC8407">
          <front>
            <title>Guidelines for Authors and Reviewers of Documents Containing YANG Data Models</title>
            <author initials="A." surname="Bierman" fullname="A. Bierman">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="October"/>
            <abstract>
              <t indent="0">This memo provides guidelines for authors and reviewers of specifications containing YANG modules.  Recommendations and procedures are defined, which are intended to increase interoperability and usability of Network Configuration Protocol (NETCONF) and RESTCONF protocol implementations that utilize YANG modules.  This document obsoletes RFC 6087.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="216"/>
          <seriesInfo name="RFC" value="8407"/>
          <seriesInfo name="DOI" value="10.17487/RFC8407"/>
        </reference>
        <reference anchor="RFC8632" target="https://www.rfc-editor.org/info/rfc8632" quoteTitle="true" derivedAnchor="RFC8632">
          <front>
            <title>A YANG Data Model for Alarm Management</title>
            <author initials="S." surname="Vallin" fullname="S. Vallin">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="September"/>
            <abstract>
              <t indent="0">This document defines a YANG module for alarm management.  It includes functions for alarm-list management, alarm shelving, and notifications to inform management systems.  There are also operations to manage the operator state of an alarm and administrative alarm procedures.  The module carefully maps to relevant alarm standards.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8632"/>
          <seriesInfo name="DOI" value="10.17487/RFC8632"/>
        </reference>
        <reference anchor="RFC8641" target="https://www.rfc-editor.org/info/rfc8641" quoteTitle="true" derivedAnchor="RFC8641">
          <front>
            <title>Subscription to YANG Notifications for Datastore Updates</title>
            <author initials="A." surname="Clemm" fullname="A. Clemm">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="E." surname="Voit" fullname="E. Voit">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="September"/>
            <abstract>
              <t indent="0">This document describes a mechanism that allows subscriber applications to request a continuous and customized stream of updates from a YANG datastore.  Providing such visibility into updates enables new capabilities based on the remote mirroring and monitoring of configuration and operational state.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8641"/>
          <seriesInfo name="DOI" value="10.17487/RFC8641"/>
        </reference>
        <reference anchor="RFC8792" target="https://www.rfc-editor.org/info/rfc8792" quoteTitle="true" derivedAnchor="RFC8792">
          <front>
            <title>Handling Long Lines in Content of Internet-Drafts and RFCs</title>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="E." surname="Auerswald" fullname="E. Auerswald">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Farrel" fullname="A. Farrel">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="Q." surname="Wu" fullname="Q. Wu">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2020" month="June"/>
            <abstract>
              <t indent="0">This document defines two strategies for handling long lines in width-bounded text content.  One strategy, called the "single backslash" strategy, is based on the historical use of a single backslash ('\') character to indicate where line-folding has occurred, with the continuation occurring with the first character that is not a space character (' ') on the next line.  The second strategy, called the "double backslash" strategy, extends the first strategy by adding a second backslash character to identify where the continuation begins and is thereby able to handle cases not supported by the first strategy.  Both strategies use a self-describing header enabling automated reconstitution of the original content.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8792"/>
          <seriesInfo name="DOI" value="10.17487/RFC8792"/>
        </reference>
        <reference anchor="RFC8808" target="https://www.rfc-editor.org/info/rfc8808" quoteTitle="true" derivedAnchor="RFC8808">
          <front>
            <title>A YANG Data Model for Factory Default Settings</title>
            <author initials="Q." surname="Wu" fullname="Q. Wu">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="B." surname="Lengyel" fullname="B. Lengyel">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="Y." surname="Niu" fullname="Y. Niu">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2020" month="August"/>
            <abstract>
              <t indent="0">This document defines a YANG data model with the "factory-reset" RPC to allow clients to reset a server back to its factory default condition. It also defines an optional "factory-default" datastore to allow clients to read the factory default configuration for the device.</t>
              <t indent="0">The YANG data model in this document conforms to the Network Management Datastore Architecture (NMDA) defined in RFC 8342.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8808"/>
          <seriesInfo name="DOI" value="10.17487/RFC8808"/>
        </reference>
      </references>
    </references>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-backwards-compatibility">Backwards Compatibility</name>
      <t indent="0" pn="section-appendix.a-1">The concept of "backwards compatibility" and what changes are backwards 
      compatible are not defined for instance data sets as they are highly 
      dependent on the specific use case and the content-schema. 
      </t>
      <t indent="0" pn="section-appendix.a-2">
      In case of "instance data sets" that are the result of design or specification 
      activity, some changes that may be good to avoid are listed below. 
      </t>
      <t indent="0" pn="section-appendix.a-3">
      YANG uses the concept of managed entities identified by key 
      values; if the connection between the represented entity and the key 
      value is not preserved during an update, this may lead to the following problems.      
      </t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-appendix.a-4">
        <li pn="section-appendix.a-4.1">If the key value of a list entry that represents the same 
            managed entity as before is changed, the user may mistakenly 
            identify the list entry as new.</li>
        <li pn="section-appendix.a-4.2">If the meaning of a list entry is changed but the key values 
            are not (e.g., redefining an alarm-type but not changing its 
            alarm-type-id), the change may not be noticed.</li>
        <li pn="section-appendix.a-4.3">If the key value of a previously removed list entry is reused 
            for a different entity, the change may be misinterpreted as 
            reintroducing the previous entity.</li>
      </ul>
    </section>
    <section anchor="detailed_use_cases" numbered="true" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-detailed-use-cases">Detailed Use Cases</name>
      <t indent="0" pn="section-appendix.b-1">This section is non-normative.</t>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-appendix.b.1">
        <name slugifiedName="name-use-case-1-early-documentat">Use Case 1: Early Documentation of Server Capabilities</name>
        <t indent="0" pn="section-appendix.b.1-1"> A server has a number of server capabilities that are defined 
          in YANG modules and can be retrieved from the server
          using protocols like NETCONF or RESTCONF. Server capabilities include:   
        </t>
        <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-appendix.b.1-2">
          <li pn="section-appendix.b.1-2.1"> data defined in "ietf-yang-library": YANG modules, submodules, 
              features, deviations, schema-mounts, and datastores 
              supported (<xref target="RFC8525" format="default" sectionFormat="of" derivedContent="RFC8525"/>).</li>
          <li pn="section-appendix.b.1-2.2">alarms supported (<xref target="RFC8632" format="default" sectionFormat="of" derivedContent="RFC8632"/>).</li>
          <li pn="section-appendix.b.1-2.3">data nodes and subtrees that support or do not support on-change 
            notifications (<xref target="RFC8641" format="default" sectionFormat="of" derivedContent="RFC8641"/>).</li>
          <li pn="section-appendix.b.1-2.4">netconf-capabilities in ietf-netconf-monitoring.</li>
        </ul>
        <t indent="0" pn="section-appendix.b.1-3">
          While it is good practice to allow a client to query these capabilities 
          from the live server, that is often not possible. 
        </t>
        <t indent="0" pn="section-appendix.b.1-4">
          Often when a network node is released, an associated Network Management System (NMS)
          is also released with it. The NMS depends on the capabilities of the server.          
          During NMS implementation, information about server capabilities is needed.
          If the information is unavailable early in some offline  
          document but only as instance data from the live network node, the NMS implementation will be
          delayed because it has to wait until the network node is ready. Also, assuming
          that all NMS implementors will have correctly configured network nodes 
          from which data can be retrieved is a very expensive proposition. (An NMS may handle dozens
          of node types.)
        </t>
        <t indent="0" pn="section-appendix.b.1-5">
          Network operators often build their own homegrown NMS systems that 
          need to be integrated with a vendor's network node.  The operator
          needs to know the network node's server capabilities in order to do 
          this. Moreover, the network operator's decision to buy a vendor's 
          product may even be influenced by the network node's Operations, Administration, and Maintenance (OAM) feature set 
          documented as the server's capabilities.
        </t>
        <t indent="0" pn="section-appendix.b.1-6">
          Beside NMS implementors, system integrators and many others also need the same
          information early.  Examples could be model-driven testing, generating documentation, etc.
        </t>
        <t indent="0" pn="section-appendix.b.1-7">
          Most server capabilities are relatively stable and change only during 
          upgrade or due to licensing or the addition or removal of hardware. They are 
          usually defined by a vendor at design time, before the product is released.

          It is feasible and advantageous to define and document them early, 
          e.g., in a YANG instance data file.     
        </t>
        <t indent="0" pn="section-appendix.b.1-8">It is anticipated that a separate IETF document will define in
          detail how and which set of server capabilities should be documented.
        </t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-appendix.b.2">
        <name slugifiedName="name-use-case-2-preloading-data">Use Case 2: Preloading Data</name>
        <t indent="0" pn="section-appendix.b.2-1">
          There are parts of the configuration that must be fully configurable 
          by the operator. However, a simple default configuration often will
          be sufficient.
        </t>
        <t indent="0" pn="section-appendix.b.2-2">
          One example is access control groups/roles and related rules. 
          While a sophisticated operator may define dozens of different groups, 
          often a basic (read-only operator, read-write system administrator, 
          security-administrator) triplet will be enough.
          Vendors will often provide such default configuration data to make 
          device configuration easier for an operator.
        </t>
        <t indent="0" pn="section-appendix.b.2-3">
          The device vendor may define a set of default groups (/nacm:nacm/groups) and rules 
          for these groups to access specific parts of the common models (/nacm:nacm/rule-list/rule).
        </t>
        <t indent="0" pn="section-appendix.b.2-4">
          YANG instance data files can be used to document and/or preload the 
          default configuration.                             
        </t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-appendix.b.3">
        <name slugifiedName="name-use-case-3-documenting-fact">Use Case 3: Documenting Factory Default Settings</name>
        <t indent="0" pn="section-appendix.b.3-1">
          Nearly every server has a factory default configuration. If the 
          system is really badly misconfigured or if the current configuration 
          is to be abandoned, the system can be reset to the default factory 
          configuration.
        </t>
        <t indent="0" pn="section-appendix.b.3-2">
          YANG instance data can be used to document the factory default
          configuration. See <xref target="RFC8808" format="default" sectionFormat="of" derivedContent="RFC8808"/>.               
        </t>
      </section>
    </section>
    <section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.c">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t indent="0" pn="section-appendix.c-1">For their valuable comments, discussions, and feedback, we wish to 
        acknowledge <contact fullname="Andy Bierman"/>, <contact fullname="Juergen Schoenwaelder"/>, <contact fullname="Rob Wilton"/>,  <contact fullname="Joe Clarke"/>, <contact fullname="Kent Watsen"/>,     <contact fullname="Martin Bjorklund"/>, <contact fullname="Ladislav Lhotka"/>, <contact fullname="Qin Wu"/>, and other members of the Netmod Working Group.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.d">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author initials="B." surname="Lengyel" fullname="Balazs Lengyel">
        <organization abbrev="Ericsson" showOnFrontPage="true">Ericsson</organization>
        <address>
          <postal>
            <street>Magyar Tudosok korutja 11</street>
            <city>Budapest</city>
            <country>Hungary</country>
            <code>1117</code>
          </postal>
          <email>balazs.lengyel@ericsson.com</email>
        </address>
      </author>
      <author fullname="Benoit Claise" initials="B." surname="Claise">
        <organization showOnFrontPage="true">Huawei</organization>
        <address>
          <email>benoit.claise@huawei.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
