One document matched: draft-lhotka-netmod-yang-annotations-00.xml


<?xml version="1.0"?>
<?rfc strict="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="3"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc docName="draft-lhotka-netmod-yang-annotations-00" ipr="trust200902" category="std" obsoletes="" updates="" submissionType="IETF" xml:lang="en">
  <front>
    <title abbrev="Common Annotations for YANG">Common Metadata
    Annotations for Data Modelled with YANG</title>
    <author fullname="Ladislav Lhotka" initials="L." surname="Lhotka">
      <organization>CZ.NIC</organization>
      <address>
        <email>lhotka@nic.cz</email>
      </address>
    </author>
    <date day="28" month="November" year="2014"/>
    <area/>
    
<area>Operations and Management</area>
<workgroup>NETMOD Working Group</workgroup>


    <abstract>
      <t>This document introduces a collection of common metadata
      annotations intended for use in data modeled with the YANG
      language.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="sec.introduction" title="Introduction" toc="default">
      <t>This document introduces a collection of metadata annotations
      that are intended for general use in data modeled with the YANG
      data modeling language <xref target="RFC6020" pageno="false" format="default"/>. YANG module
      "ietf-yang-annotations" (<xref target="sec.module" pageno="false" format="default"/>) defines
      these annotations using the extension statement "annotation"
      that is defined in the "ietf-yang-metadata" module <xref target="I-D.lhotka-netmod-yang-metadata" pageno="false" format="default"/>.
      </t>
    </section>

    <section anchor="sec.terminology" title="Terminology" toc="default">
      
      
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"
in this document are to be interpreted as described in <xref target="RFC2119" pageno="false" format="default"/>.</t>

      
      <t>The following terms are defined in <xref target="RFC6241" pageno="false" format="default"/>:
      <list style="symbols">
	<t>client,</t>
	<t>configuration data,</t>
	<t>configuration datastore,</t>
	<t>notification,</t>
	<t>operation,</t>
	<t>RPC method,</t>
	<t>server,</t>
	<t>state data.</t>
      </list>
      </t>
    </section>

    <section anchor="sec.annots" title="Common Metadata Annotations" toc="default">
      <t>YANG module "ietf-yang-annotations" (<xref target="sec.module" pageno="false" format="default"/>) contains normative definitions of the
      following metadata annotations:
      <list style="symbols">
	<t>inactive - deactivates a subtree in a configuration
	datastore,</t>
	<t>type - indicates the actual type for a leaf instance with
	the "union" type".</t>
      </list></t>
      <t>The following subsections provide an informal explanation and
      examples showing typical use of these annotations. The examples
      are based on YANG modules "ietf-interfaces" <xref target="RFC7223" pageno="false" format="default"/> and "ietf-system" <xref target="RFC7317" pageno="false" format="default"/>.</t>
      <section anchor="sec.inactive" title="The "inactive" Annotation" toc="default">
	<t>A client uses the "inactive" annotation for deactivating a
	subtree in a configuration datastore while keeping the subtree
	in place.</t>
	<t>For example, a NETCONF client can use the following
	<edit-config> operation to deactivate the configuration
	of an interface in the "running" datastore:</t>
	<figure title="" suppress-title="false" align="left" alt="" width="" height="">
	  <artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
<nc:rpc message-id="101"
     xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <nc:edit-config>
    <nc:target>
      <nc:running/>
    </nc:target>
    <nc:config>
      <interfaces
        xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
        xmlns:yan="urn:ietf:params:xml:ns:yang:ietf-yang-annotations">
        <interface yann:inactive="true">
          <name>eth0</name>
        </interface>
      </interfaces>
    </nc:config>
  </nc:edit-config>
</nc:rpc>
	  </artwork>
	</figure>
	<t>A RESTCONF client can achieve the same effect with the
	following HTTP request:</t>
	<figure title="" suppress-title="false" align="left" alt="" width="" height="">
	  <artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
PATCH /restconf/data/ietf-interfaces:interfaces/
   interface/name=eth0 HTTP/1.1
Host: example.com
Content-Type: application/yang.data+json

{
  "@": {
    "ietf-yang-annotations:inactive": true
  }
}	    
	  </artwork>
	</figure>
      </section>

      <section anchor="sec.type" title="The "type" Annotation" toc="default">
	<t>Clients and servers use the "type" annotation to specify
	the actual type for an instance of a leaf that has the "union"
	type (or a type derived from "union"). The value of this
	annotation has to be one of the member types appearing in the
	specification of the "union" type.</t>
	<t>For example, a NETCONF client can use the following
	<edit-config> operation to set an IPv6 address of a name
	server in DNS resolver configuration:</t>
	<figure title="" suppress-title="false" align="left" alt="" width="" height="">
	  <artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
<nc:rpc message-id="101"
     xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <nc:edit-config>
    <nc:target>
      <nc:running/>
    </nc:target>
    <nc:config>
      <system
        xmlns="urn:ietf:params:xml:ns:yang:ietf-system"
        xmlns:yan="urn:ietf:params:xml:ns:yang:ietf-yang-annotations">
        <dns-resolver>
	  <server>
            <name>primary</name>
	    <udp-and-tcp>
	      <address yann:type="ietf-inet-types:ipv6-address">
	        2001:db8:0:2::1
	      </address>
	    </udp-and-tcp>
	  </server>
	</dns-resolver>
      </system>
    </nc:config>
  </nc:edit-config>
</nc:rpc>
	  </artwork>
	</figure>
	<t>A RESTCONF client can perform the same configuration with
	the following HTTP request:</t>
	<figure title="" suppress-title="false" align="left" alt="" width="" height="">
	  <artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
PUT /restconf/data/ietf-system:system/
   dns-resolver/server/name=eth0/udp-and-tcp/address HTTP/1.1
Host: example.com
Content-Type: application/yang.data+json

{
  "@address": {
    "ietf-yang-annotations:type": "ietf-inet-types:ipv6-address"
  },
  "address": "2001:db8:0:2::1"
}	    
	  </artwork>
	</figure>
      </section>
    </section>
    
    <section anchor="sec.module" title="YANG Annotations Module" toc="default">

      
<t>RFC Editor: In this section, replace all occurrences of 'XXXX'
with the actual RFC number and all occurrences of the revision date
below with the date of RFC publication (and remove this note).</t>

      
      <figure title="" suppress-title="false" align="left" alt="" width="" height="">
	<artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
<CODE BEGINS> file "yang-annotations@2014-11-28.yang"

module ietf-yang-annotations {

  namespace "urn:ietf:params:xml:ns:yang:ietf-yang-annotations";

  prefix "yann";

  import ietf-yang-metadata {
    prefix "md";
  }

  organization
    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

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

     WG Chair: Thomas Nadeau
               <mailto:tnadeau@lucidvision.com>

     WG Chair: Juergen Schoenwaelder
               <mailto:j.schoenwaelder@jacobs-university.de>

     Editor:   Ladislav Lhotka
               <mailto:lhotka@nic.cz>";

  description
    "This module defines generally useful metadata annotations for
     data modelled with YANG.

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

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

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

  revision 2014-11-28 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: Common Metadata Annotations for Data Modelled with
       YANG.";
  }

  md:annotation "inactive" {
    type boolean;
    description
      "A client uses this annotation for deactivating a subtree in a
       configuration datastore.

       If a server advertises support for this annotation, then a
       client MAY attach it to any data node instance in any
       configuration datastore via standard editing methods. If its
       value is 'true', then the server MUST behave as if the subtree
       rooted at this data node was not present. If its value is
       'false' the server MUST behave as if the annotation is not
       present.";
  }

  md:annotation "type" {
    description
      "This annotation is used for indicating the actual type for a
       value of a leaf with the 'union' type, or a type derived from
       'union' (henceforth denoted as 'a union type').

       The value of this annotation can be

       - the name of a YANG built-in type,

       - the name of a derived type prepended with the name of the
         YANG module where the type is defined and the colon
         character (':').

       If a server advertises support for this annotation, then:

       - A client MAY attach this annotation to a leaf of a union
         type when creating or modifying the value of this leaf in a
         configuration datastore, or when such a leaf is contained in
         RPC request parameters. The server MUST take this
         information into account when interpreting the type of the
         received value.

       - If a client doesn't do so, the server SHOULD attach this
         annotation to a leaf of a union type upon its creation or
         modification in a configuration datastore.

       - The server SHOULD attach this annotation to all leafs of a
         union type that are sent to a client as state data, in an
         RPC reply, or in a notification.

       In all cases mentioned above, the receiving party SHALL ignore
       this annotation if it is attached to an instance of a data
       node that is not a leaf of a union type.

       A server supporting this annotation SHALL report an error if

       - the type specified in the annotation is not among member
         types of the annotated leaf's type,

       - the value of the annotated leaf is not valid for the type
         specified by the annotation.";
  }
}

<CODE ENDS></artwork>

      </figure>

    </section>

    <section anchor="iana" title="IANA Considerations" toc="default">
      <t>RFC Ed.: In this section, replace all occurrences of 'XXXX'
      with the actual RFC number (and remove this note).</t>

      <t>This document registers the following namespace URI in the
      IETF XML registry <xref target="RFC3688" pageno="false" format="default"/>:</t>
      <figure title="" suppress-title="false" align="left" alt="" width="" height="">
	<artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
----------------------------------------------------------
URI: urn:ietf:params:xml:ns:yang:ietf-yang-annotations

Registrant Contact: The IESG.

XML: N/A, the requested URI is an XML namespace.
----------------------------------------------------------
	</artwork>
      </figure>

      <t>This document registers the following YANG modules in the
      YANG Module Names registry <xref target="RFC6020" pageno="false" format="default"/>:</t>
      <figure title="" suppress-title="false" align="left" alt="" width="" height="">
	<artwork xml:space="preserve" name="" type="" align="left" alt="" width="" height="">
-------------------------------------------------------------------
name:         ietf-yang-annotations
namespace:    urn:ietf:params:xml:ns:yang:ietf-yang-annotations
prefix:       yann
reference:    RFC XXXX
-------------------------------------------------------------------
	</artwork>
      </figure>
    </section>

    <section anchor="security" title="Security Considerations" toc="default">
      <t>TBD</t>
    </section>

  </middle>

  <back>
    <references title="Normative References">
      

<reference anchor="RFC2119">

<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date year="1997" month="March"/>
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   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.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<t>
      The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
      NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
<format type="TXT" octets="4723" target="http://www.rfc-editor.org/rfc/rfc2119.txt"/>
<format type="HTML" octets="17970" target="http://xml.resource.org/public/rfc/html/rfc2119.html"/>
<format type="XML" octets="5777" target="http://xml.resource.org/public/rfc/xml/rfc2119.xml"/>
</reference>

      

<reference anchor="RFC3688">

<front>
<title>The IETF XML Registry</title>
<author initials="M." surname="Mealling" fullname="M. Mealling">
<organization/></author>
<date year="2004" month="January"/>
<abstract>
<t>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"/>
<format type="TXT" octets="17325" target="http://www.rfc-editor.org/rfc/rfc3688.txt"/>
</reference>

      

<reference anchor="RFC6020">

<front>
<title>YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</title>
<author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
<organization/></author>
<date year="2010" month="October"/>
<abstract>
<t>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"/>
<format type="TXT" octets="324178" target="http://www.rfc-editor.org/rfc/rfc6020.txt"/>
</reference>

      

<reference anchor="RFC6241">

<front>
<title>Network Configuration Protocol (NETCONF)</title>
<author initials="R." surname="Enns" fullname="R. Enns">
<organization/></author>
<author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
<organization/></author>
<author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
<organization/></author>
<author initials="A." surname="Bierman" fullname="A. Bierman">
<organization/></author>
<date year="2011" month="June"/>
<abstract>
<t>The Network Configuration Protocol (NETCONF) defined in this document provides mechanisms to install, manipulate, and delete the configuration of network devices.  It uses an Extensible Markup Language (XML)-based data encoding for the configuration data as well as the protocol messages.  The NETCONF protocol operations are realized as remote procedure calls (RPCs).  This document obsoletes RFC 4741. [STANDARDS-TRACK]</t></abstract></front>

<seriesInfo name="RFC" value="6241"/>
<format type="TXT" octets="209465" target="http://www.rfc-editor.org/rfc/rfc6241.txt"/>
</reference>

      

<reference anchor="I-D.lhotka-netmod-yang-metadata">
<front>
<title>Defining and Using Metadata with YANG</title>

<author initials="L" surname="Lhotka" fullname="Ladislav Lhotka">
    <organization/>
</author>

<date month="September" day="11" year="2014"/>

<abstract><t>This document defines a YANG extension statement that allows for defining metadata annotions in YANG modules.  The document also specifies the encoding of annotations and rules for annotating instances of YANG data nodes.</t></abstract>

</front>

<seriesInfo name="Internet-Draft" value="draft-lhotka-netmod-yang-metadata-00"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-lhotka-netmod-yang-metadata-00.txt"/>
</reference>

    </references>

    <references title="Informative References">
      

<reference anchor="RFC7223">

<front>
<title>A YANG Data Model for Interface Management</title>
<author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
<organization/></author>
<date year="2014" month="May"/>
<abstract>
<t>This document defines a YANG data model for the management of network interfaces.  It is expected that interface-type-specific data models augment the generic interfaces data model defined in this document.  The data model includes configuration data and state data (status information and counters for the collection of statistics).</t></abstract></front>

<seriesInfo name="RFC" value="7223"/>
<format type="TXT" octets="70537" target="http://www.rfc-editor.org/rfc/rfc7223.txt"/>
</reference>

      

<reference anchor="RFC7317">

<front>
<title>A YANG Data Model for System Management</title>
<author initials="A." surname="Bierman" fullname="A. Bierman">
<organization/></author>
<author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
<organization/></author>
<date year="2014" month="August"/>
<abstract>
<t>This document defines a YANG data model for the configuration and identification of some common system properties within a device containing a Network Configuration Protocol (NETCONF) server.  This document also includes data node definitions for system identification, time-of-day management, user management, DNS resolver configuration, and some protocol operations for system management.</t></abstract></front>

<seriesInfo name="RFC" value="7317"/>
<format type="TXT" octets="60119" target="http://www.rfc-editor.org/rfc/rfc7317.txt"/>
</reference>

    </references>

  </back>
</rfc>

PAFTECH AB 2003-20262026-04-24 00:52:25