JSON Encoding of Data Modeled with YANG
draft-ietf-netmod-yang-json-04

The information below is for an old version of the document
Document Type Active Internet-Draft (netmod WG)
Last updated 2015-06-12
Stream IETF
Intended RFC status (None)
Formats pdf htmlized bibtex
Reviews
Stream WG state WG Document
Document shepherd Kent Watsen
IESG IESG state I-D Exists
Consensus Boilerplate Unknown
Telechat date
Responsible AD (None)
Send notices to "Thomas Nadeau" <tnadeau@lucidvision.com>, "Kent Watsen" <kwatsen@juniper.net>
NETMOD Working Group                                           L. Lhotka
Internet-Draft                                                    CZ.NIC
Intended status: Standards Track                           June 12, 2015
Expires: December 14, 2015

                JSON Encoding of Data Modeled with YANG
                     draft-ietf-netmod-yang-json-04

Abstract

   This document defines encoding rules for representing configuration,
   state data, RPC input and output parameters, and notifications
   defined using YANG as JavaScript Object Notation (JSON) text.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on December 14, 2015.

Copyright Notice

   Copyright (c) 2015 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                  Expires December 14, 2015               [Page 1]
Internet-Draft         JSON Encoding of YANG Data              June 2015

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Terminology and Notation  . . . . . . . . . . . . . . . . . .   3
   3.  Validation of JSON-encoded
       Instance Data . . . . . . . . . . . . . . . . . . . . . . . .   4
   4.  Names and Namespaces  . . . . . . . . . . . . . . . . . . . .   4
   5.  Encoding of YANG Data Node Instances  . . . . . . . . . . . .   6
     5.1.  The "leaf" Data Node  . . . . . . . . . . . . . . . . . .   7
     5.2.  The "container" Data Node . . . . . . . . . . . . . . . .   7
     5.3.  The "leaf-list" Data Node . . . . . . . . . . . . . . . .   7
     5.4.  The "list" Data Node  . . . . . . . . . . . . . . . . . .   8
     5.5.  The "anydata" Data Node . . . . . . . . . . . . . . . . .   9
     5.6.  The "anyxml" Data Node  . . . . . . . . . . . . . . . . .  10
   6.  The Mapping of YANG Data Types to JSON Values . . . . . . . .  10
     6.1.  Numeric Types . . . . . . . . . . . . . . . . . . . . . .  10
     6.2.  The "string" Type . . . . . . . . . . . . . . . . . . . .  11
     6.3.  The "boolean" Type  . . . . . . . . . . . . . . . . . . .  11
     6.4.  The "enumeration" Type  . . . . . . . . . . . . . . . . .  11
     6.5.  The "bits" Type . . . . . . . . . . . . . . . . . . . . .  11
     6.6.  The "binary" Type . . . . . . . . . . . . . . . . . . . .  11
     6.7.  The "leafref" Type  . . . . . . . . . . . . . . . . . . .  11
     6.8.  The "identityref" Type  . . . . . . . . . . . . . . . . .  11
     6.9.  The "empty" Type  . . . . . . . . . . . . . . . . . . . .  12
     6.10. The "union" Type  . . . . . . . . . . . . . . . . . . . .  13
     6.11. The "instance-identifier" Type  . . . . . . . . . . . . .  13
   7.  I-JSON Compliance . . . . . . . . . . . . . . . . . . . . . .  14
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  15
   9.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  15
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  15
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  15
     10.2.  Informative References . . . . . . . . . . . . . . . . .  16
   Appendix A.  A Complete Example . . . . . . . . . . . . . . . . .  16
   Appendix B.  Change Log . . . . . . . . . . . . . . . . . . . . .  18
     B.1.  Changes Between Revisions -03 and -04 . . . . . . . . . .  18
     B.2.  Changes Between Revisions -02 and -03 . . . . . . . . . .  19
     B.3.  Changes Between Revisions -01 and -02 . . . . . . . . . .  19
     B.4.  Changes Between Revisions -00 and -01 . . . . . . . . . .  19
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  19

1.  Introduction

   The NETCONF protocol [RFC6241] uses XML [W3C.REC-xml-20081126] for
   encoding data in its Content Layer.  Other management protocols might
   want to use other encodings while still benefiting from using YANG
Show full document text