Defining and Using Metadata with YANG
RFC 7952

Document Type RFC - Proposed Standard (August 2016; No errata)
Updates RFC 6110
Last updated 2016-08-31
Replaces draft-lhotka-netmod-yang-metadata
Stream IETF
Formats plain text pdf html bibtex
Reviews
Stream WG state Submitted to IESG for Publication
Document shepherd Kent Watsen
Shepherd write-up Show (last changed 2016-02-23)
IESG IESG state RFC 7952 (Proposed Standard)
Consensus Boilerplate Yes
Telechat date
Responsible AD Benoit Claise
Send notices to (None)
IANA IANA review state Version Changed - Review Needed
IANA action state RFC-Ed-Ack
Internet Engineering Task Force (IETF)                         L. Lhotka
Request for Comments: 7952                                        CZ.NIC
Updates: 6110                                                August 2016
Category: Standards Track
ISSN: 2070-1721

                 Defining and Using Metadata with YANG

Abstract

   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.

Status of This Memo

   This is an Internet Standards Track document.

   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.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   http://www.rfc-editor.org/info/rfc7952.

Copyright Notice

   Copyright (c) 2016 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) 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 Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Lhotka                       Standards Track                    [Page 1]
RFC 7952                      YANG Metadata                  August 2016

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   5
     2.1.  Key Words . . . . . . . . . . . . . . . . . . . . . . . .   5
     2.2.  Terms Defined in Other Documents  . . . . . . . . . . . .   5
     2.3.  Namespaces and Prefixes . . . . . . . . . . . . . . . . .   7
     2.4.  Definitions of New Terms  . . . . . . . . . . . . . . . .   7
   3.  Defining Annotations in YANG  . . . . . . . . . . . . . . . .   8
     3.1.  Example Definition  . . . . . . . . . . . . . . . . . . .   9
   4.  Using Annotations . . . . . . . . . . . . . . . . . . . . . .   9
   5.  The Encoding of Annotations . . . . . . . . . . . . . . . . .  10
     5.1.  XML Encoding  . . . . . . . . . . . . . . . . . . . . . .  10
     5.2.  JSON Encoding . . . . . . . . . . . . . . . . . . . . . .  11
       5.2.1.  Metadata Object and Annotations . . . . . . . . . . .  11
       5.2.2.  Adding Annotations to anydata, container, and list
               Entries . . . . . . . . . . . . . . . . . . . . . . .  12
       5.2.3.  Adding Annotations to anyxml and leaf Instances . . .  12
       5.2.4.  Adding Annotations to leaf-list Entries . . . . . . .  13
   6.  Representing Annotations in DSDL Schemas  . . . . . . . . . .  14
   7.  Metadata YANG Module  . . . . . . . . . . . . . . . . . . . .  16
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  18
   9.  Security Considerations . . . . . . . . . . . . . . . . . . .  18
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  19
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  19
     10.2.  Informative References . . . . . . . . . . . . . . . . .  20
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  21
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  21

Lhotka                       Standards Track                    [Page 2]
RFC 7952                      YANG Metadata                  August 2016

1.  Introduction

   There is a need to be able to annotate instances of YANG [RFC7950]
   data nodes with metadata.  Typical use cases are as follows:

   o  Complementing regular data model information with
      instance-specific metadata, comments, etc.

   o  Providing information about the rendering of data in user
      interfaces.

   o  Deactivating a subtree in a configuration datastore while keeping
      the data in place.

   o  Network management protocols often use metadata annotations for
      various purposes in both operation requests and responses.  For
      example, the <edit-config> operation in the Network Configuration
      Protocol (NETCONF) (see Section 7.2 of [RFC6241]) uses annotations
Show full document text