draft-ietf-netmod-yang-instance-file-format-06.txt   draft-ietf-netmod-yang-instance-file-format-07.txt 
Netmod B. Lengyel Netmod B. Lengyel
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Standards Track B. Claise Intended status: Standards Track B. Claise
Expires: June 5, 2020 Cisco Systems, Inc. Expires: August 16, 2020 Cisco Systems, Inc.
December 3, 2019 February 13, 2020
YANG Instance Data File Format YANG Instance Data File Format
draft-ietf-netmod-yang-instance-file-format-06 draft-ietf-netmod-yang-instance-file-format-07
Abstract Abstract
There is a need to document data defined in YANG models when a live There is a need to document data defined in YANG models when a live
server is not available. Data is often needed already at design or server is not available. Data is often needed already at design or
implementation time or needed by groups that do not have a live implementation time or needed by groups that do not have a live
running server available. This document specifies a standard file running server available. This document specifies a standard file
format for YANG instance data (which follows the syntax and semantic format for YANG instance data, which follows the syntax and semantics
from existing YANG models, re-using the same format as the reply to a of existing YANG models, and annotates it with metadata.
<get> operation/request) and annotates it with metadata.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on June 5, 2020. This Internet-Draft will expire on August 16, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 4 2.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 4
3. Instance Data File Format . . . . . . . . . . . . . . . . . . 4 2.2. Delivery of Instance Data . . . . . . . . . . . . . . . . 4
3.1. Specifying the Content Schema . . . . . . . . . . . . . . 6 2.3. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 5
3.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 7 3. Instance Data File Format . . . . . . . . . . . . . . . . . . 5
3.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 7 3.1. Specifying the Content Schema . . . . . . . . . . . . . . 7
3.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 8
3.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 8
3.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8 3.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8
3.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8
4. Data Life cycle . . . . . . . . . . . . . . . . . . . . . . . 12 4. Backwards Compatibility . . . . . . . . . . . . . . . . . . . 12
5. Delivery of Instance Data . . . . . . . . . . . . . . . . . . 13 5. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 13
6. Backwards Compatibility . . . . . . . . . . . . . . . . . . . 13 5.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 13
7. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 13 5.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 13
7.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 13 6. Security Considerations . . . . . . . . . . . . . . . . . . . 19
7.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 14 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
8. Security Considerations . . . . . . . . . . . . . . . . . . . 19 7.1. URI Registration . . . . . . . . . . . . . . . . . . . . 19
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 7.2. YANG Module Name Registration . . . . . . . . . . . . . . 19
9.1. URI Registration . . . . . . . . . . . . . . . . . . . . 20 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20
9.2. YANG Module Name Registration . . . . . . . . . . . . . . 20 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 20
10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20 9.1. Normative References . . . . . . . . . . . . . . . . . . 20
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 9.2. Informative References . . . . . . . . . . . . . . . . . 21
11.1. Normative References . . . . . . . . . . . . . . . . . . 20
11.2. Informative References . . . . . . . . . . . . . . . . . 22
Appendix A. Open Issues . . . . . . . . . . . . . . . . . . . . 22 Appendix A. Open Issues . . . . . . . . . . . . . . . . . . . . 22
Appendix B. Changes between revisions . . . . . . . . . . . . . 22 Appendix B. Changes between revisions . . . . . . . . . . . . . 22
Appendix C. Detailed Use Cases - Non-Normative . . . . . . . . . 24 Appendix C. Detailed Use Cases - Non-Normative . . . . . . . . . 24
C.1. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 24 C.1. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 24
C.1.1. Use Case 1: Early Documentation of Server C.1.1. Use Case 1: Early Documentation of Server
Capabilities . . . . . . . . . . . . . . . . . . . . 24 Capabilities . . . . . . . . . . . . . . . . . . . . 24
C.1.2. Use Case 2: Preloading Data . . . . . . . . . . . . . 25 C.1.2. Use Case 2: Preloading Data . . . . . . . . . . . . . 25
C.1.3. Use Case 3: Documenting Factory Default Settings . . 26 C.1.3. Use Case 3: Documenting Factory Default Settings . . 25
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26
1. Terminology 1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 RFC 2119 [RFC2119] RFC 8174 [RFC8174] when, and only when, they 14 RFC 2119 [RFC2119] RFC 8174 [RFC8174] when, and only when, they
appear in all capitals, as shown here. appear in all capitals, as shown here.
Instance Data: A collection of instantiated data nodes.
Instance Data Set: A named set of data items annotated with metadata Instance Data Set: A named set of data items annotated with metadata
that can be used as instance data in a YANG data tree. that can be used as instance data in a YANG data tree.
Instance Data File: A file containing an instance data set formatted Instance Data File: A file containing an instance data set formatted
according to the rules described in this document. according to the rules described in this document.
Content-schema: A set of YANG modules with their revision, supported Content-schema: A set of YANG modules with their revision, supported
features, and deviations for which the instance data set contains features, and deviations for which the instance data set contains
instance data instance data.
Content defining YANG module(s): YANG module(s) that make up the
content-schema
YANG Instance Data, or just instance data for short, is data that Content defining YANG module: an individual YANG module that is part
could be stored in a datastore and whose syntax and semantics is of the content-schema.
defined by YANG models.
The term Server is used as defined in [RFC8342] The term Server is used as defined in [RFC8342].
2. Introduction 2. Introduction
There is a need to document data defined in YANG models when a live There is a need to document data defined in YANG models when a live
server is not available. Data is often needed already at design or server is not available. Data is often needed already at design or
implementation time or needed by groups that do not have a live implementation time or needed by groups that do not have a live
running server available. To facilitate this offline delivery of running server available. To facilitate this offline delivery of
data, this document specifies a standard format for YANG instance data, this document specifies a standard format for YANG instance
data sets and YANG instance data files. data sets and YANG instance data files.
The following is a list of already implemented and potential use The following is a list of already implemented and potential use
cases. cases.
UC1 Documentation of server capabilities UC1 Documentation of server capabilities
UC2 Preloading default configuration data UC2 Preloading default configuration data
UC3 Documenting Factory Default Settings UC3 Documenting Factory Default Settings
UC4 Instance data used as backup UC4 Storing the configuration of a device, e.g., for backup, archive
or audit purposes
UC5 Storing the configuration of a device, e.g., for archive or
audit purposes
UC6 Storing diagnostics data UC5 Storing diagnostics data
UC7 Allowing YANG instance data to potentially be carried within UC6 Allowing YANG instance data to potentially be carried within
other IPC message formats other IPC message formats
UC8 Default instance data used as part of a templating solution UC7 Default instance data used as part of a templating solution
UC9 Providing data examples in RFCs or internet drafts
UC8 Providing data examples in RFCs or internet drafts
In Appendix C we describe the first three use cases in detail. In Appendix C we describe the first three use cases in detail.
There are many and varied use cases where YANG instance data could be There are many and varied use cases where YANG instance data could be
used. We do not want to limit future uses of instance data sets, so used. We do not want to limit future uses of instance data sets, so
specifying how and when to use YANG instance data is out of scope for specifying how and when to use YANG instance data is out of scope for
this document. It is anticipated that other documents will define this document. It is anticipated that other documents will define
specific use cases. Use cases are listed here only to indicate the specific use cases. Use cases are listed here only to indicate the
need for this work. need for this work.
2.1. Principles 2.1. Principles
The following is a list of the basic principles of the instance data The following is a list of the basic principles of the instance data
format: format:
P1 Two standard formats shall be defined based on the XML and JSON P1 Two standard formats shall be defined based on the XML and JSON
encodings. encodings.
P2 Instance data shall reuse existing formats similar to the P2 Instance data shall reuse existing encoding rules for YANG
response to a <get> operation/request. defined data. Its format will be similar to the response of a
NETCONF <get> operation or the RESTCONF response to a GET method
invocation on the (unified) datastore resource.
P3 Metadata about the instance data set (Section 3, Paragraph 9) P3 Metadata about the instance data set (Section 3, Paragraph 9)
shall be defined. shall be defined.
P4 A YANG instance data set shall be allowed to contain data for P4 A YANG instance data set shall be allowed to contain data for
many YANG modules. multiple YANG modules.
P5 Instance data shall be allowed to contain configuration data, P5 Instance data shall be allowed to contain configuration data,
state data, or a mix of the two. state data, or a mix of the two.
P6 Partial data sets shall be allowed. P6 Partial data sets shall be allowed.
P7 The YANG instance data format shall be usable for any data for P7 The YANG instance data format shall be usable for any data for
which YANG module(s) are defined and available to the reader, which YANG module(s) are defined and available to the reader,
independent of whether the module is actually implemented by a independent of whether the module is actually implemented by a
server. server.
2.2. Delivery of Instance Data
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.
Other instance data sets may be read from or produced by the YANG
server itself e.g., UC5 documenting diagnostic data.
2.3. Data Life cycle
YANG instance data is always a snapshot of information at a specific
point of time. If the data changes afterwards, this is not
represented in the instance data set anymore. The current values may
be retrieved at run-time via NETCONF/RESTCONF or received e.g., in
YANG-Push notifications.
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.
3. Instance Data File Format 3. Instance Data File Format
A YANG instance data file MUST contain a single instance data set and A YANG instance data file MUST contain a single instance data set and
no additional data. no additional data.
The format of the instance data set is defined by the ietf-yang- 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 instance-data YANG module. It is made up of a header part and
content-data. The header part carries metadata for the instance data content-data. The header part carries metadata for the instance data
set. The content-data, defined as an anydata data node, carries the set. The content-data, defined as an anydata data node, carries the
"real data" that we want to document/provide. The syntax and instance data that we want to document/provide. The syntax and
semantics of content-data is defined by the content-schema. semantics of content-data is defined by the content-schema.
Two formats are specified based on the XML and JSON YANG encodings. Two formats are specified based on the XML and JSON YANG encodings.
Later as other YANG encodings (e.g., CBOR) are defined, further Later as other YANG encodings (e.g., CBOR) are defined, further
instance data formats may be specified. instance data formats may be specified.
The content-data part SHALL follow the encoding rules defined in The content-data part MUST conform to the content-schema, while
[RFC7950] for XML and [RFC7951] for JSON and MUST use UTF-8 character allowing for the exceptions listed below. The content-data part
encoding. Content-data MAY include: SHALL follow the encoding rules defined in [RFC7950] for XML and
[RFC7951] for JSON and MUST use UTF-8 character encoding. Content-
data MAY include:
metadata as defined by [RFC7952]. metadata as defined by [RFC7952].
a default attribute as defined in [RFC6243] section 6. and in a default attribute as defined in [RFC6243] section 6. and in
[RFC8040] section 4.8.9. [RFC8040] section 4.8.9.
origin metadata as specified in [RFC8526] and [RFC8527] origin metadata as specified in [RFC8526] and [RFC8527]
implementation specific metadata. Unknown metadata MUST be implementation specific metadata relevant to individual data
ignored by users of YANG instance data, allowing it to be used nodes. Unknown metadata MUST be ignored by users of instance
later for other purposes. data, allowing it to be used later for other purposes.
in the XML format implementation specific XML attributes, unknown in the XML format implementation specific XML attributes, unknown
attributes MUST be ignored by users of YANG instance data, attributes MUST be ignored by users of instance data, allowing
allowing them to be used later for other purposes. them to be used later for other purposes.
The content-data part will be very similar to the result returned for
a NETCONF <get-data> or for a RESTCONF get operation.
The content-data part MUST conform to the content-schema. An An instance data set MAY contain data for any number of YANG modules;
instance data set MAY contain data for any number of YANG modules; if if needed it MAY carry the complete configuration and state data set
needed it MAY carry the complete configuration and state data set for for a server. Default values SHOULD NOT be included.
a server. Default values SHOULD NOT be included.
Config=true and config=false data MAY be mixed in the instance data Config=true and config=false data MAY be mixed in the instance data
file. file.
Instance data files MAY contain partial data sets. This means Instance data files MAY contain partial data sets. This means
mandatory, min-elements, require-instance=true, must and when mandatory, min-elements, require-instance=true, must and when
constrains MAY be violated. constrains MAY be violated.
The name of the instance data file SHOULD take one of the following The name of the instance data file SHOULD take one of the following
two forms: two forms:
skipping to change at page 7, line 16 skipping to change at page 7, line 32
instance data set. instance data set.
Simplified-Inline method: Include the needed information as part Simplified-Inline method: Include the needed information as part
of the instance data set; short specification. of the instance data set; short specification.
URI method: Include a URI that references another YANG instance URI method: Include a URI that references another YANG instance
data file. This instance data file will use the same content- data file. This instance data file will use the same content-
schema as the referenced YANG instance data file. (if you don't schema as the referenced YANG instance data file. (if you don't
want to repeat the info again and again) want to repeat the info again and again)
EXTERNAL Method: Do not include the content-schema as it is External Method: Do not include the content-schema, the user needs
already known, or the information is available through external to obtain the information through external documents.
documents.
Additional methods e.g., a YANG-package based solution may be added Additional methods e.g., a YANG-package based solution may be added
later. later.
Note, the specified content-schema only indicates the set of modules Note, the specified content-schema only indicates the set of modules
that were used to define this YANG instance data set. Sometimes that were used to define this YANG instance data set. Sometimes
instance data may be used for a server supporting a different YANG instance data may be used for a server supporting a different YANG
module set. (e.g., for "UC2 Preloading Data" the instance data set module set. (e.g., for "UC2 Preloading Data" the instance data set
may not be updated every time the YANG modules on the server are may not be updated every time the YANG modules on the server are
updated) Whether the instance data set is usable for a possibly updated) Whether an instance data set originally defined using a
different real-life YANG module set depends on many factors including specific content-schema is usable with a different other schema
the compatibility between the specified and the real-life YANG module depends on many factors including the amount of differences and the
set, considering modules, revisions, features, deviations, the scope compatibility between the original and the other schema, considering
of the instance data, etc. modules, revisions, features, deviations, the scope of the instance
data, etc.
3.1.1. Inline Method 3.1.1. Inline Method
One or more inline-module elements define YANG module(s) used to One or more inline-module elements define YANG module(s) used to
specify the content defining YANG modules. specify the content defining YANG modules.
E.g., ietf-yang-library@2016-06-21 E.g., ietf-yang-library@2016-06-21
The anydata inline-schema carries instance data (conforming to the The anydata inline-schema carries instance data (conforming to the
inline-modules) that actually specifies the content defining YANG inline-modules) that actually specifies the content defining YANG
modules including revision, supported features, deviations and any modules including revision, supported features, deviations and any
relevant additional data (e.g., version labels) relevant additional data (e.g., revision labels). See Section 3.2.
3.1.2. Simplified-Inline Method 3.1.2. Simplified-Inline Method
The instance data set contains a list of content defining YANG The instance data set contains a list of content defining YANG
modules including the revision date for each. Usage of this method modules including the revision date for each. Usage of this method
implies that the modules are used without any deviations and with all implies that the modules are used without any deviations and with all
features supported. features supported.
3.1.3. URI Method 3.1.3. URI Method
skipping to change at page 8, line 29 skipping to change at page 8, line 48
E.g., In Use Case 6, when the system creates a diagnostic file every E.g., In Use Case 6, when the system creates a diagnostic file every
minute to document the state of the server. minute to document the state of the server.
3.2. Examples 3.2. Examples
The following example is based on "UC1, Documenting Server The following example is based on "UC1, Documenting Server
Capabilities". It provides (a shortened) list of supported YANG Capabilities". It provides (a shortened) list of supported YANG
modules and NETCONF capabilities for a server. It uses the inline modules and NETCONF capabilities for a server. It uses the inline
method to specify the content-schema. method to specify the content-schema.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<instance-data-set xmlns= <instance-data-set xmlns=
"urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"> "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data">
<name>acme-router-modules</name> <name>acme-router-modules</name>
<yid-version>1</yid-version> <yid-version>1</yid-version>
<content-schema> <content-schema>
<inline-module> <inline-module>
ietf-yang-library@2016-06-21 ietf-yang-library@2016-06-21
</inline-module> </inline-module>
<inline-schema> <inline-schema>
<module-state <modules-state
xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"> xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
<module>
<name>ietf-yang-library</name>
<revision>2016-06-21</revision>
</module>
<module>
<name>ietf-netconf-monitoring</name>
<revision>2010-10-04</revision>
</module>
</modules-state>
</inline-schema>
<content-schema>
<revision>
<date>1956-10-23</date>
<description>Initial version</description>
</revision>
<description>Defines the minimal set of modules that any acme-router
will contain.</description>
<contact>info@acme.com</contact>
<content-data>
<!-- The example lists only 4 modules, but it could list the
full set of supported modules for a server, potentially many
dozens of modules -->
<modules-state
xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
<module> <module>
<name>ietf-yang-library</name> <name>ietf-yang-library</name>
<revision>2016-06-21</revision> <revision>2016-06-21</revision>
<namespace>
urn:ietf:params:xml:ns:yang:ietf-yang-library
</namespace>
<conformance-type>implement</conformance-type>
</module> </module>
<module> <module>
<name>ietf-netconf-monitoring</name> <name>ietf-system</name>
<revision>2010-10-04</revision> <revision>2014-08-06</revision>
<namespace>urn:ietf:params:xml:ns:yang:ietf-system</namespace>
<feature>sys:authentication</feature>
<feature>sys:local-users</feature>
<deviation>
<name>acme-system-ext</name>
<revision>2018-08-06</revision>
</deviation>
<conformance-type>implement</conformance-type>
</module> </module>
</module-state> <module>
</inline-schema> <name>ietf-yang-types</name>
<content-schema> <revision>2013-07-15</revision>
<revision> <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types
<date>1956-10-23</date> </namespace>
<description>Initial version</description> <conformance-type>import</conformance-type>
</revision> </module>
<description>Defines the minimal set of modules that any acme-router <module>
will contain.</description>
<contact>info@acme.com</contact>
<content-data>
<!-- The example lists only 4 modules, but it could list the
full set of supported modules for a server, potentially many
dozens of modules -->
<module-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
<module>
<name>ietf-yang-library</name>
<revision>2016-06-21</revision>
<namespace>
urn:ietf:params:xml:ns:yang:ietf-yang-library
</namespace>
<conformance-type>implement</conformance-type>
</module>
<module>
<name>ietf-system</name>
<revision>2014-08-06</revision>
<namespace>urn:ietf:params:xml:ns:yang:ietf-system</namespace>
<feature>sys:authentication</feature>
<feature>sys:local-users</feature>
<deviation>
<name>acme-system-ext</name> <name>acme-system-ext</name>
<revision>2018-08-06</revision> <revision>2018-08-06</revision>
</deviation> <namespace>urn:rdns:acme.com:oammodel:acme-system-ext
<conformance-type>implement</conformance-type> </namespace>
</module> <conformance-type>implement</conformance-type>
<module> </module>
<name>ietf-yang-types</name> </modules-state>
<revision>2013-07-15</revision> <netconf-state
<namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
</namespace> <capabilities>
<conformance-type>import</conformance-type> <capability>
</module> urn:ietf:params:netconf:capability:validate:1.1
<module> </capability>
<name>acme-system-ext</name> </capabilities>
<revision>2018-08-06</revision> </netconf-state>
<namespace>urn:rdns:acme.com:oammodel:acme-system-ext </content-data>
</namespace> </instance-data-set>
<conformance-type>implement</conformance-type>
</module>
</module-state>
<netconf-state
xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
<capabilities>
<capability>
urn:ietf:params:netconf:capability:validate:1.1
</capability>
</capabilities>
</netconf-state>
</content-data>
</instance-data-set>
Figure 1: XML Instance Data Set - Use case 1, Documenting server Figure 1: XML Instance Data Set - Use case 1, Documenting server
capabilities capabilities
The following example is based on "UC2, Preloading Default The following example is based on "UC2, Preloading Default
Configuration". It provides a (shortened) default rule set for a Configuration". It provides a (shortened) default rule set for a
read-only operator role. It uses the inline method for specifying read-only operator role. It uses the inline method for specifying
the content-schema. the content-schema.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
skipping to change at page 12, line 5 skipping to change at page 12, line 5
<action>permit</action> <action>permit</action>
</rule> </rule>
</rule-list> </rule-list>
</nacm> </nacm>
</content-data> </content-data>
</instance-data-set> </instance-data-set>
Figure 2: XML Instance Data Set - Use case 2, Preloading access Figure 2: XML Instance Data Set - Use case 2, Preloading access
control data control data
The following example is based on UC6 Storing diagnostics data. An The following example is based on UC5 Storing diagnostics data. An
instance data set is produced by the server every 15 minutes that instance data set is produced by the server every 15 minutes that
contains statistics about NETCONF. As a new set is produced contains statistics about NETCONF. As a new set is produced
periodically many times a day a revision-date would be useless; periodically many times a day a revision-date would be useless;
instead a timestamp is included. instead a timestamp is included.
{ {
"ietf-yang-instance-data:instance-data-set": { "ietf-yang-instance-data:instance-data-set": {
"name": "acme-router-netconf-diagnostics", "name": "acme-router-netconf-diagnostics",
"yid-version": "1", "yid-version": "1",
"content-schema": { "content-schema": {
skipping to change at page 12, line 38 skipping to change at page 12, line 38
"in-rpcs ": "8711", "in-rpcs ": "8711",
"in-bad-rpcs ": "408", "in-bad-rpcs ": "408",
"out-rpc-errors ": "408", "out-rpc-errors ": "408",
"out-notifications": "39007" "out-notifications": "39007"
} }
} }
} }
} }
} }
Figure 3: JSON Instance Data File example - UC6 Storing diagnostics Figure 3: JSON Instance Data File example - UC5 Storing diagnostics
data data
4. Data Life cycle 4. Backwards Compatibility
In UC2 "Preloading default configuration data", the loaded data may
be changed later e.g., by management operations. In UC6 "Storing
Diagnostics data", the diagnostics values may change on device every
second.
YANG instance data is a snapshot of information at a specific point
of time. If the data changes afterwards, this is not represented in
the instance data set anymore. The valid values can be retrieved at
run-time via NETCONF/RESTCONF or received e.g., in YANG-Push
notifications.
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.
5. Delivery of Instance Data
Instance data sets that are produced as a result of some sort of
specification or design effort SHOULD 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.
Other instance data sets may be read from or produced by the YANG
server itself e.g., UC6 documenting diagnostic data.
6. Backwards Compatibility
The concept of backwards compatibility and what changes are backwards The concept of backwards compatibility and what changes are backwards
compatible are not defined for instance data sets as it is highly compatible are not defined for instance data sets as it is highly
dependent on the specific use case and the content-schema. dependent on the specific use case and the content-schema.
For instance data that is the result of a design or specification For instance data that is the result of a design or specification
activity, some changes that may be good to avoid are listed. YANG activity, some changes that may be good to avoid are listed. YANG
uses the concept of managed entities identified by key values; if the uses the concept of managed entities identified by key values; if the
connection between the represented entity and the key value is not connection between the represented entity and the key value is not
preserved during an update, this may lead to problems. preserved during an update, this may lead to problems.
skipping to change at page 13, line 43 skipping to change at page 13, line 17
list entry as new. list entry as new.
o If the meaning of a list entry is changed, but the key values are o 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- not (e.g., redefining an alarm-type but not changing its alarm-
type-id) the change may not be noticed. type-id) the change may not be noticed.
o If the key value of a previously removed list entry is reused for o If the key value of a previously removed list entry is reused for
a different entity, the change may be misinterpreted as a different entity, the change may be misinterpreted as
reintroducing the previous entity. reintroducing the previous entity.
7. YANG Instance Data Model 5. YANG Instance Data Model
7.1. Tree Diagram 5.1. Tree Diagram
The following tree diagram [RFC8340] provides an overview of the data The following tree diagram [RFC8340] provides an overview of the data
model. model.
module: ietf-yang-instance-data module: ietf-yang-instance-data
structure instance-data-set: structure instance-data-set:
+--rw name? string +--rw name? string
+--rw yid-version uint8 +--rw yid-version uint8
+--rw content-schema +--rw content-schema
| +--rw (content-schema-spec)? | +--rw (content-schema-spec)?
skipping to change at page 14, line 28 skipping to change at page 13, line 47
+--rw description? string +--rw description? string
+--rw contact? string +--rw contact? string
+--rw organization? string +--rw organization? string
+--rw datastore? ds:datastore-ref +--rw datastore? ds:datastore-ref
+--rw revision* [date] +--rw revision* [date]
| +--rw date string | +--rw date string
| +--rw description? string | +--rw description? string
+--rw timestamp? yang:date-and-time +--rw timestamp? yang:date-and-time
+--rw content-data? <anydata> +--rw content-data? <anydata>
7.2. YANG Model 5.2. YANG Model
<CODE BEGINS> file "ietf-yang-instance-data@2019-11-17.yang" <CODE BEGINS> file "ietf-yang-instance-data@2019-11-17.yang"
module ietf-yang-instance-data { module ietf-yang-instance-data {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data";
prefix yid; prefix yid;
import ietf-yang-structure-ext { import ietf-yang-structure-ext {
prefix sx; prefix sx;
} }
skipping to change at page 17, line 27 skipping to change at page 16, line 45
deviations. deviations.
As some versions of ietf-yang-library MAY contain As some versions of ietf-yang-library MAY contain
different module-sets for different datastores, if different module-sets for different datastores, if
multiple module-sets are included, the instance data multiple module-sets are included, the instance data
set's meta-data MUST contain the datastore information set's meta-data MUST contain the datastore information
and instance data for the ietf-yang-library MUST also and instance data for the ietf-yang-library MUST also
contain information specifying the module-set for the contain information specifying the module-set for the
relevant datastore. relevant datastore.
Subsequent items MAY specify YANG modules augmenting the Subsequent items MAY specify YANG modules augmenting the
first module with useful data (e.g., a version label)."; first module with useful data (e.g., revision label).";
} }
anydata inline-schema { anydata inline-schema {
mandatory true; mandatory true;
description description
"Instance data corresponding to the YANG modules "Instance data corresponding to the YANG modules
specified in the inline-module nodes defining the set specified in the inline-module nodes defining the set
of content defining YANG modules for this of content defining YANG modules for this
instance-data-set."; instance-data-set.";
} }
} }
skipping to change at page 19, line 33 skipping to change at page 19, line 5
description description
"Contains the real instance data. "Contains the real instance data.
The data MUST conform to the relevant YANG Modules specified The data MUST conform to the relevant YANG Modules specified
either in the content-schema-spec or in some other either in the content-schema-spec or in some other
implementation specific manner."; implementation specific manner.";
} }
} }
} }
<CODE ENDS> <CODE ENDS>
8. Security Considerations 6. Security Considerations
The YANG module defined in this document is designed as a wrapper The YANG module defined in this document is designed as a wrapper
specifying a format and a metadata header for YANG instance data specifying a format and a metadata header for YANG instance data
defined by the content-schema. The data is designed to be accessed defined by the content-schema. The data is designed to be accessed
as a stored file or over any file access method or protocol. as a stored file or over any file access method or protocol.
The document does not specify any method to influence the behavior of The document does not specify any method to influence the behavior of
a server. a server.
Instance data files may contain sensitive data. Instance data files may contain sensitive data.
The header part is not security sensitive. The header part is not security sensitive.
The security sensitivity of the instance data in the content part is The security sensitivity of the instance data in the content part is
completely dependent on the content schema. Depending on the nature completely dependent on the content schema. Depending on the nature
of the instance data, instance data files MAY need to be handled in a of the instance data, instance data files MAY need to be handled in a
secure way. The same kind of handling should be applied, that would secure way. The same kind of handling should be applied, that would
be needed for the result of a <get> operation returning the same be needed for the result of a read operation returning the same data.
data.
Instance data files should be protected against modification or Instance data files should be protected against modification or
unauthorized access using normal file handling mechanisms. unauthorized access using normal file handling mechanisms. Care
should be taken, when copying the original files or providing file
access for additional users, not to reveal information
unintentionally.
9. IANA Considerations 7. IANA Considerations
This document registers one URI and one YANG module. This document registers one URI and one YANG module.
9.1. URI Registration 7.1. URI Registration
This document registers one URI in the IETF XML registry [RFC3688]. This document registers one URI in the IETF XML registry [RFC3688].
Following the format in RFC 3688, the following registration is Following the format in RFC 3688, the following registration is
requested to be made: requested to be made:
URI: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data URI: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data
Registrant Contact: The IESG. Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace. XML: N/A, the requested URI is an XML namespace.
9.2. YANG Module Name Registration 7.2. YANG Module Name Registration
This document registers one YANG module in the YANG Module Names This document registers one YANG module in the YANG Module Names
registry [RFC6020]. registry [RFC6020].
name: ietf-yang-instance-data name: ietf-yang-instance-data
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data namespace: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data
prefix: yid prefix: yid
reference: RFC XXXX reference: RFC XXXX
10. Acknowledgments 8. Acknowledgments
For their valuable comments, discussions, and feedback, we wish to For their valuable comments, discussions, and feedback, we wish to
acknowledge Andy Bierman, Juergen Schoenwaelder, Rob Wilton, Joe acknowledge Andy Bierman, Juergen Schoenwaelder, Rob Wilton, Joe
Clarke, Kent Watsen Martin Bjorklund, Ladislav Lhotka, Qin Wu and Clarke, Kent Watsen Martin Bjorklund, Ladislav Lhotka, Qin Wu and
other members of the Netmod WG. other members of the Netmod WG.
11. References 9. References
11.1. Normative References 9.1. Normative References
[I-D.ietf-netmod-yang-data-ext] [I-D.ietf-netmod-yang-data-ext]
Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data
Structure Extensions", draft-ietf-netmod-yang-data-ext-04 Structure Extensions", draft-ietf-netmod-yang-data-ext-05
(work in progress), July 2019. (work in progress), December 2019.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
DOI 10.17487/RFC3688, January 2004, DOI 10.17487/RFC3688, January 2004,
<https://www.rfc-editor.org/info/rfc3688>. <https://www.rfc-editor.org/info/rfc3688>.
[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for
the Network Configuration Protocol (NETCONF)", RFC 6020, the Network Configuration Protocol (NETCONF)", RFC 6020,
DOI 10.17487/RFC6020, October 2010, DOI 10.17487/RFC6020, October 2010,
<https://www.rfc-editor.org/info/rfc6020>. <https://www.rfc-editor.org/info/rfc6020>.
skipping to change at page 22, line 5 skipping to change at page 21, line 30
Management Datastore Architecture", RFC 8526, Management Datastore Architecture", RFC 8526,
DOI 10.17487/RFC8526, March 2019, DOI 10.17487/RFC8526, March 2019,
<https://www.rfc-editor.org/info/rfc8526>. <https://www.rfc-editor.org/info/rfc8526>.
[RFC8527] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., [RFC8527] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
and R. Wilton, "RESTCONF Extensions to Support the Network and R. Wilton, "RESTCONF Extensions to Support the Network
Management Datastore Architecture", RFC 8527, Management Datastore Architecture", RFC 8527,
DOI 10.17487/RFC8527, March 2019, DOI 10.17487/RFC8527, March 2019,
<https://www.rfc-editor.org/info/rfc8527>. <https://www.rfc-editor.org/info/rfc8527>.
11.2. Informative References 9.2. Informative References
[I-D.ietf-netmod-factory-default] [I-D.ietf-netmod-factory-default]
WU, Q., Lengyel, B., and Y. Niu, "Factory Default WU, Q., Lengyel, B., and Y. Niu, "Factory Default
Setting", draft-ietf-netmod-factory-default-07 (work in Setting", draft-ietf-netmod-factory-default-10 (work in
progress), November 2019. progress), February 2020.
[I-D.verdt-netmod-yang-module-versioning]
Claise, B., Clarke, J., Rahman, R., Wilton, R., Lengyel,
B., Sterne, J., and K. D'Souza, "Updated YANG Module
Revision Handling", draft-verdt-netmod-yang-module-
versioning-01 (work in progress), October 2019.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
skipping to change at page 22, line 40 skipping to change at page 22, line 24
[RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications [RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications
for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641,
September 2019, <https://www.rfc-editor.org/info/rfc8641>. September 2019, <https://www.rfc-editor.org/info/rfc8641>.
Appendix A. Open Issues Appendix A. Open Issues
o - o -
Appendix B. Changes between revisions Appendix B. Changes between revisions
v06 - v07
o Updated terminology, use-cases
o Many small changes based on WGLC
v05 - v06 v05 - v06
o Modified module name format, removed .yin or .yang extension o Modified module name format, removed .yin or .yang extension
o Removed pattern for module and inline-module. We want to allow o Removed pattern for module and inline-module. We want to allow
the usage of revision-label later the usage of revision-label later
v04 - v05 v04 - v05
o Updated according to YANG-Doctor review o Updated according to YANG-Doctor review
 End of changes. 52 change blocks. 
193 lines changed or deleted 199 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/