--- 1/draft-ietf-netmod-yang-instance-file-format-10.txt 2020-04-08 05:13:12.091126648 -0700
+++ 2/draft-ietf-netmod-yang-instance-file-format-11.txt 2020-04-08 05:13:12.127127154 -0700
@@ -1,131 +1,108 @@
Netmod B. Lengyel
Internet-Draft Ericsson
Intended status: Standards Track B. Claise
-Expires: September 21, 2020 Cisco Systems, Inc.
- March 20, 2020
+Expires: October 10, 2020 Cisco Systems, Inc.
+ April 8, 2020
YANG Instance Data File Format
- draft-ietf-netmod-yang-instance-file-format-10
+ draft-ietf-netmod-yang-instance-file-format-11
Abstract
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
- implementation time or needed by groups that do not have a live
- running server available. 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.
+ server is unavailable. Data is often needed at design or
+ implementation time or needed when a live running 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.
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 https://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 September 21, 2020.
+ This Internet-Draft will expire on October 10, 2020.
Copyright Notice
Copyright (c) 2020 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
(https://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.
Table of Contents
- 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2
- 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
- 2.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 4
- 2.2. Delivery of Instance Data . . . . . . . . . . . . . . . . 4
- 2.3. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 5
- 3. Instance Data File Format . . . . . . . . . . . . . . . . . . 5
- 3.1. Specifying the Content Schema . . . . . . . . . . . . . . 7
- 3.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 7
- 3.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 8
- 3.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8
- 3.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8
- 4. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 12
- 4.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 12
- 4.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 13
- 5. Security Considerations . . . . . . . . . . . . . . . . . . . 19
- 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
- 6.1. URI Registration . . . . . . . . . . . . . . . . . . . . 19
- 6.2. YANG Module Name Registration . . . . . . . . . . . . . . 20
- 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20
- 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 20
- 8.1. Normative References . . . . . . . . . . . . . . . . . . 20
- 8.2. Informative References . . . . . . . . . . . . . . . . . 21
+ 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
+ 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
+ 1.2. Principles . . . . . . . . . . . . . . . . . . . . . . . 4
+ 1.3. Delivery of Instance Data . . . . . . . . . . . . . . . . 4
+ 1.4. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 5
+ 2. Instance Data File Format . . . . . . . . . . . . . . . . . . 5
+ 2.1. Specifying the Content Schema . . . . . . . . . . . . . . 7
+ 2.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 7
+ 2.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 8
+ 2.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8
+ 2.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8
+ 2.2.1. UC1, Documenting Server Capabilities . . . . . . . . 8
+ 2.2.2. UC2, Preloading Default Configuration . . . . . . . . 10
+ 2.2.3. UC5, Storing diagnostics data . . . . . . . . . . . . 11
+ 3. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 12
+ 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 12
+ 3.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 13
+ 4. Security Considerations . . . . . . . . . . . . . . . . . . . 19
+ 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
+ 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 20
+ 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 20
+ 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20
+ 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 20
+ 7.1. Normative References . . . . . . . . . . . . . . . . . . 20
+ 7.2. Informative References . . . . . . . . . . . . . . . . . 21
Appendix A. Changes between revisions . . . . . . . . . . . . . 22
- Appendix B. Backwards Compatibility . . . . . . . . . . . . . . 24
- Appendix C. Detailed Use Cases - Non-Normative . . . . . . . . . 25
- C.1. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 25
- C.1.1. Use Case 1: Early Documentation of Server
- Capabilities . . . . . . . . . . . . . . . . . . . . 25
- C.1.2. Use Case 2: Preloading Data . . . . . . . . . . . . . 26
- C.1.3. Use Case 3: Documenting Factory Default Settings . . 27
+ Appendix B. Backwards Compatibility . . . . . . . . . . . . . . 25
+ Appendix C. Detailed Use Cases . . . . . . . . . . . . . . . . . 25
+ C.1. Use Case 1: Early Documentation of Server Capabilities . 25
+ C.2. Use Case 2: Preloading Data . . . . . . . . . . . . . . . 26
+ C.3. Use Case 3: Documenting Factory Default Settings . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27
-1. Terminology
-
- 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 [RFC2119] [RFC8174] when, and only when, they 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
- that can be used as instance data in a YANG data tree.
-
- Instance Data File: A file containing an instance data set formatted
- according to the rules described in this document.
-
- Content-schema: A set of YANG modules with their revision, supported
- features, and deviations for which the instance data set contains
- instance data.
-
- Content defining YANG module: an individual YANG module that is part
- of the content-schema.
-
- The term Server is used as defined in [RFC8342].
-
-2. Introduction
+1. Introduction
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
- implementation time or needed by groups that do not have a live
- running server available. 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
- Section 4. The YANG data model in this document conforms to the
- Network Management Datastore Architecture (NMDA) defined in [RFC8342]
+ server is unavailable. Data is often needed at design or
+ implementation time or needed 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 Section 3.
+
+ The YANG data model in this document conforms to the Network
+ Management Datastore Architecture (NMDA) defined in [RFC8342]
The following is a list of already implemented and potential use
cases.
UC1 Documentation of server capabilities
UC2 Preloading default configuration data
UC3 Documenting Factory Default Settings
@@ -133,258 +110,286 @@
or audit purposes
UC5 Storing diagnostics data
UC6 Allowing YANG instance data to potentially be carried within
other IPC message formats
UC7 Default instance data used as part of a templating solution
UC8 Providing data examples in RFCs or internet drafts
- In Appendix C we describe the first three use cases in detail.
+
+ In Appendix C describes the first three use cases in detail.
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
- 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 here only to indicate the
- need for this work.
+ 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.
-2.1. Principles
+1.1. Terminology
+
+ 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 [RFC2119] [RFC8174] when, and only when, they 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
+ that can be used as instance data in a YANG data tree.
+
+ Instance Data File: A file containing an instance data set formatted
+ according to the rules described in this document.
+
+ Content-schema: A set of YANG modules with their revision, supported
+ features, and deviations for which the instance data set contains
+ instance data.
+
+ Content defining YANG module: an individual YANG module that is part
+ of the content-schema.
+
+ The term "server" is used as defined in [RFC8342].
+
+1.2. Principles
The following is a list of the basic principles of the instance data
format:
P1 Two standard formats shall be defined based on the XML and JSON
encodings.
P2 Instance data shall reuse existing encoding rules for YANG
defined data.
- P3 Metadata about the instance data set (Section 3, Paragraph 9)
+ P3 Metadata about the instance data set (Section 2, Paragraph 9)
shall be defined.
P4 A YANG instance data set shall be allowed to contain data for
multiple YANG modules.
P5 Instance data shall be allowed to contain configuration data,
state data, or a mix of the two.
P6 Partial data sets shall be allowed.
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 actually implemented by a
- server.
+ independent of whether the module is implemented by a server.
P8 It shall be possible to report the identity of the datastore with
which the instance data set is associated.
-2.2. Delivery of Instance Data
+1.3. 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
+1.4. Data Life cycle
A YANG instance data set is created 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
+2. Instance Data File Format
A YANG instance data file MUST contain a single instance data set and
no additional data.
- 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
+ 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 we want to document/provide. The syntax and
- semantics of content-data is defined by the content-schema.
+ instance data that the user wants to document/provide. The syntax
+ and semantics of content-data is defined by the content-schema.
Two formats are specified based on the XML and JSON YANG encodings.
Later as other YANG encodings (e.g., CBOR) are defined, further
instance data formats may be specified.
The content-data part MUST conform to the content-schema, while
allowing for the exceptions listed below. The content-data part
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].
+ o metadata as defined by [RFC7952].
- a default attribute as defined in [RFC6243] section 6. and in
+ o a default attribute as defined in [RFC6243] section 6. and in
[RFC8040] section 4.8.9.
- origin metadata as specified in [RFC8526] and [RFC8527]
+ o origin metadata as specified in [RFC8526] and [RFC8527]
- implementation specific metadata relevant to individual data
+ o implementation specific metadata relevant to individual data
nodes. Unknown metadata MUST be ignored by users of instance
data, allowing it to be used later for other purposes.
An instance data set MAY contain data for any number of YANG modules;
- if needed it MAY carry the complete configuration and state data set
- for a server. Default values SHOULD NOT be included.
+ if needed it MAY carry the complete configuration and state data for
+ a server. Default values SHOULD NOT be included.
- Config=true and config=false data MAY be mixed in the instance data
- file.
+ Configuration ("config true") and operational state data ("config
+ false") MAY be mixed in the instance data file.
Instance data files MAY contain partial data sets. This means
- mandatory, min-elements, require-instance=true, must and when
- constrains MAY be violated.
+ "mandatory", "min-elements", "require-instance true", "must" and
+ "when" constrains MAY be violated.
The name of the instance data file SHOULD take one of the following
two forms:
- If revision information inside the data set is present
+ If "revision" information is present inside the data set:
- * instance-data-set-name ['@' revision-date] '.filetype'
+ instance-data-set-name ['@' revision-date] '.filetype'
- * E.g., acme-router-modules@2018-01-25.xml
+ E.g., acme-router-modules@2018-01-25.xml
- If the leaf "name" is present in the instance data header, this
- MUST be used. If the "revision-date" is present in both the
- filename and in the instance data header, the revision date in the
- file name MUST be set to the latest revision date inside the
- instance data set.
+ If the leaf "name" is present in the instance data header, its
+ value SHOULD be used for the "instance-data-set-name". If the
+ "revision-date" is present in both the filename and in the
+ instance data header, the revision date in the file name MUST be
+ set to the latest revision date inside the instance data set.
If timestamp information inside the data set is present
- * instance-data-set-name ['@' timestamp] '.filetype'
+ instance-data-set-name ['@' timestamp] '.filetype'
- * E.g., acme-router-modules@2018-01-25T15_06_34_3+01_00.json
+ E.g., acme-router-modules@2018-01-25T15_06_34_3+01_00.json
- If the leaf "name" is present in the instance data header, this
- MUST be used. If the "timestamp" is present both in the filename
- and in the instance data header, the timestamp in the file name
- MUST be set to the timestamp inside the instance data set; the
- semicolons and the decimal point, if present, shall be replaced by
- underscores.
+ If the leaf "name" is present in the instance data header, its
+ value SHOULD be used for the "instance-data-set-name". If the
+ "timestamp" is present both in the filename and in the instance
+ data header, the timestamp in the file name SHOULD be set to the
+ timestamp inside the instance data set; the semicolons and the
+ decimal point, if present, shall be replaced by underscores.
- The revision date or timestamp is optional. ".filetype" SHALL be
+ The revision date or timestamp is optional. ".filetype" SHOULD be
".json" or ".xml" according to the format used.
Metadata, information about the data set itself SHOULD be included in
the instance data set. Some metadata items are defined in the YANG
- module ietf-yang-instance-data, but other items MAY also be used.
+ module "ietf-yang-instance-data", but other items MAY be used.
+
Metadata MUST include:
- Version of the YANG Instance Data format
+ o Version of the YANG Instance Data format
Metadata SHOULD include:
o Name of the data set
- o Content schema specification
+
+ o Content schema specification (i.e., the "content-schema" node)
o Description of the instance data set. The description SHOULD
contain information whether and how the data can change during the
lifetime of the server.
-3.1. Specifying the Content Schema
+2.1. Specifying the Content Schema
To properly understand and use an instance data set, the user needs
to know the content-schema. One of the following methods SHOULD be
used:
Inline method: Include the needed information as part of the
instance data set.
Simplified-Inline method: Include the needed information as part
of the instance data set; short specification.
URI method: 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)
- External Method: Do not include the content-schema, the user needs
- to obtain the information through external documents.
+ External Method: Do not include the "content-schema" node; the
+ user needs to obtain the information through external documents.
Additional methods e.g., a YANG-package based solution may be added
later.
Note, 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 "UC2 Preloading Data" 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 a different other schema
depends on many factors including the amount of differences and the
compatibility between the original and the other schema, considering
modules, revisions, features, deviations, the scope of the instance
data, etc.
-3.1.1. Inline Method
+2.1.1. Inline Method
One or more inline-module elements define YANG module(s) used to
specify the content defining YANG modules.
E.g., ietf-yang-library@2016-06-21
The anydata inline-schema carries instance data (conforming to the
inline-modules) that actually specifies the content defining YANG
modules including revision, supported features, deviations and any
- relevant additional data (e.g., revision labels
- [I-D.verdt-netmod-yang-module-versioning]). See Section 3.2.
+ relevant additional data (e.g., revision labels which can be used as
+ alternative to the revision
+ date[I-D.verdt-netmod-yang-module-versioning]). See Section 2.2.
-3.1.2. Simplified-Inline Method
+2.1.2. Simplified-Inline Method
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.
-3.1.3. URI Method
+2.1.3. URI Method
- The same-schema-as-file leaf SHALL contain a URI that references
+ The "same-schema-as-file" leaf SHALL 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.
The referenced instance data file MAY have no content-data if it is
used solely for specifying the content-schema.
- If a referenced instance data file is not available, content-schema
- is unknown.
+ If a referenced instance data file is unavailable, content-schema is
+ unknown.
The URI method is advantageous when the user wants to avoid the
overhead of specifying the content-schema in each instance data file:
- E.g., In Use Case 6, when the system creates a diagnostic file every
- minute to document the state of the server.
+ E.g., In UC6, when the system creates a diagnostic file every minute
+ to document the state of the server.
-3.2. Examples
+2.2. Examples
- The following examples use artwork folding
- [I-D.ietf-netmod-artwork-folding] for better formatting.
+2.2.1. UC1, Documenting Server Capabilities
- The following example is based on "UC1, Documenting Server
- Capabilities". It provides (a shortened) list of supported YANG
- modules and NETCONF capabilities for a server. It uses the inline
- method to specify the content-schema.
+ The example illustrates UC1 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.
+
+ The example uses artwork folding[I-D.ietf-netmod-artwork-folding].
========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
+
acme-router-modules
ietf-yang-library@2016-06-21
ietf-yang-library
2016-06-21
@@ -396,23 +401,20 @@
1956-10-23
Initial version
Defines the minimal set of modules that any \
acme-router will contain.
info@acme.com
-
ietf-yang-library
2016-06-21
\
urn:ietf:params:xml:ns:yang:ietf-yang-library\
implement
@@ -422,20 +424,28 @@
urn:ietf:params:xml:ns:yang:ietf-system
sys:authentication
sys:local-users
acme-system-ext
2018-08-06
implement
+ ietf-netconf-monitoring
+ 2010-10-04
+ \
+ urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\
+
+ implement
+
+
ietf-yang-types
2013-07-15
urn:ietf:params:xml:ns:yang:ietf-yang-types\
import
acme-system-ext
2018-08-06
urn:rdns:acme.com:oammodel:acme-system-ext\
@@ -447,27 +457,27 @@
xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
\
urn:ietf:params:netconf:capability:validate:1.1\
- Figure 1: XML Instance Data Set - Use case 1, Documenting server
- capabilities
+ Figure 1: Documenting server capabilities
- The following example is based on "UC2, Preloading Default
- Configuration". It provides a (shortened) default rule set for a
- read-only operator role. It uses the inline method for specifying
- the content-schema.
+2.2.2. UC2, Preloading Default Configuration
+
+ The example illustrates UC2 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.
read-only-acm-rules
ietf-netconf-acm@2018-02-14
1776-07-04
@@ -486,28 +496,29 @@
read-all
*
read
permit
- Figure 2: XML Instance Data Set - Use case 2, Preloading access
- control data
+ Figure 2: Preloading access control data
- The following example is based on UC5 Storing diagnostics data. An
- instance data set is produced by the server every 15 minutes that
- contains statistics about NETCONF. As a new set is produced
- periodically many times a day a revision-date would be useless;
- instead a timestamp is included.
+2.2.3. UC5, Storing diagnostics data
+
+ The example illustrates UC5 Section 1. An instance data set is
+ produced by the server every 15 minutes that contains statistics
+ about the NETCONF server. As a new set is produced periodically many
+ times a day a revision-date would be useless; instead a timestamp is
+ included.
{
"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"],
"content-data": {
@@ -520,26 +531,25 @@
"in-rpcs ": "8711",
"in-bad-rpcs ": "408",
"out-rpc-errors ": "408",
"out-notifications": "39007"
}
}
}
}
}
- Figure 3: JSON Instance Data File example - UC5 Storing diagnostics
- data
+ Figure 3: Storing diagnostics data
-4. YANG Instance Data Model
+3. YANG Instance Data Model
-4.1. Tree Diagram
+3.1. Tree Diagram
The following tree diagram [RFC8340] provides an overview of the data
model.
module: ietf-yang-instance-data
structure instance-data-set:
+-- name? string
+-- format-version? string
+-- content-schema
| +-- (content-schema-spec)?
@@ -553,27 +563,27 @@
+-- description* string
+-- contact? string
+-- organization? string
+-- datastore? ds:datastore-ref
+-- revision* [date]
| +-- date string
| +-- description? string
+-- timestamp? yang:date-and-time
+-- content-data?
-4.2. YANG Model
+3.2. YANG Model
This YANG module imports typedefs from [RFC6991], identities from
[RFC8342] and the "structure" extension from
[I-D.ietf-netmod-yang-data-ext].
- file "ietf-yang-instance-data@2020-03-19.yang"
+ file "ietf-yang-instance-data@2020-04-02.yang"
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
"YANG Data Structure Extensions:
draft-ietf-netmod-yang-data-ext-05";
@@ -619,69 +629,78 @@
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 2020-03-19 {
+ revision 2020-04-02 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Instance Data Format";
}
feature inline-content-schema {
description
"This feature indicates that inline content-schema
option is supported.";
}
+ 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 definining a module name and an optional revision
+ date, e.g. ietf-yang-library@2016-06-21";
+ }
+
sx:structure "instance-data-set" {
description
"A data structure to define a format for
YANG instance data sets. Consists of meta-data about
the instance data set and the real content-data.";
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 3
of RFC XXXX.";
}
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 "2020-03-19";
+ default "2020-04-02";
description
- "Version of the 'YANG Instance Data format'.
-
- It SHALL contain the revision date of the
- ietf-yang-instance-data module used when creating the
- instance data set in a YYYY-MM-DD format";
+ "The 'revision' of the 'ietf-yang-instance-data' module
+ used to encode this 'instance-data-set'.";
}
container content-schema {
description
"The content schema 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 string;
+ type module-with-revision-date;
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. If other methods (e.g., revision-label) are
defined to identify individual module revisions
those MAY be used instead of using a revision date.
@@ -689,55 +708,55 @@
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 {
if-feature "inline-content-schema";
leaf-list inline-module {
- type string;
+ type module-with-revision-date;
min-elements 1;
- ordered-by user;
description
"Indicates that content defining YANG modules
are specified inline.
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. If other methods (e.g., revision-label) are
defined to identify individual module revisions
those MAY be used instead of using a revision date.
E.g., ietf-yang-library@2016-06-21
The first item is either ietf-yang-library or some
other YANG module that contains a list of YANG modules
with their name, revision-date, supported-features,
- and deviations. The usage of
- ietf-yang-library@2019-01-04 MUST be supported.
+ and deviations. The usage of revision '2019-01-04'
+ of the 'ietf-yang-library' module MUST be supported.
Using other modules, module versions MAY also be
supported.
- As some versions of ietf-yang-library MAY contain
- different module-sets for different datastores, if
- multiple module-sets are included, the instance data
- set's meta-data MUST contain the datastore information
- and instance data for the ietf-yang-library MUST also
- contain information specifying the module-set for the
- relevant datastore.
+ Some versions of ietf-yang-library MAY contain
+ different module-sets for different datastores. In
+ this case the instance data set MUST contain the
+ 'datastore' leaf and instance data for the
+ ietf-yang-library MUST also contain information
+ specifying the module-set for the relevant datastore.
Subsequent items MAY specify YANG modules augmenting
the first module with useful data
(e.g., revision label).";
+ reference
+ "RFC 8525";
}
anydata inline-schema {
mandatory true;
description
"Instance data corresponding to the YANG modules
specified in the inline-module nodes defining the set
of content defining YANG modules for this
instance-data-set.";
}
}
@@ -786,23 +805,23 @@
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 one SHOULD be added
in front of the revisions sequence so that all
revisions are in reverse chronological order.
- For instance data sets that are read from
+ Instance data sets that are read from
or produced by a server or otherwise
- subject to frequent updates or changes, revision
+ 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 {
@@ -810,98 +829,97 @@
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.
- For instance data sets that are read from or produced
+ Instance data sets that are read from or produced
by a server or otherwise subject to frequent
- updates or changes, timestamp SHOULD be present";
+ updates or changes: timestamp SHOULD be present";
}
anydata content-data {
description
"Contains the real instance data.
-
- The data MUST conform to the relevant YANG Modules specified
- either in the content-schema-spec or in some other
+ The data MUST conform to the relevant YANG modules specified
+ either in the content-schema or in some other
implementation specific manner.";
}
}
}
-5. Security Considerations
+4. Security Considerations
- The YANG module defined in this document is designed as a wrapper
- specifying a format and a metadata header for YANG instance data
- defined by the content-schema. The data is designed to be accessed
- as a stored file or over any file access method or protocol.
+ 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, so it does not follow the
+ security considerations template for YANG models. The instance data
+ is designed to be accessed as a stored file or over any file access
+ method or protocol.
The document does not specify any method to influence the behavior of
a server.
Instance data files may contain sensitive data.
The header part is not security sensitive.
The security sensitivity of the instance data in the content part is
completely dependent on the content schema. Depending on the nature
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
be needed for the result of a read operation returning the same data.
Instance data files should be protected against modification or
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.
-6. IANA Considerations
+5. IANA Considerations
This document registers one URI and one YANG module.
-6.1. URI Registration
+5.1. URI Registration
This document registers one URI in the IETF XML registry [RFC3688].
Following the format in RFC 3688, the following registration is
requested to be made:
URI: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data
-
Registrant Contact: The IESG.
-
XML: N/A, the requested URI is an XML namespace.
-6.2. YANG Module Name Registration
+5.2. YANG Module Name Registration
This document registers one YANG module in the YANG Module Names
registry [RFC6020].
name: ietf-yang-instance-data
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data
prefix: yid
reference: RFC XXXX
-7. Acknowledgments
+6. Acknowledgments
For their valuable comments, discussions, and feedback, we wish to
acknowledge Andy Bierman, Juergen Schoenwaelder, Rob Wilton, Joe
Clarke, Kent Watsen Martin Bjorklund, Ladislav Lhotka, Qin Wu and
other members of the Netmod WG.
-8. References
+7. References
-8.1. Normative References
+7.1. Normative References
[I-D.ietf-netmod-yang-data-ext]
Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data
Structure Extensions", draft-ietf-netmod-yang-data-ext-05
(work in progress), December 2019.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
.
@@ -927,24 +945,20 @@
.
[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, .
- [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
- BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
- .
-
[RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
and R. Wilton, "Network Management Datastore Architecture
(NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
.
[RFC8525] Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K.,
and R. Wilton, "YANG Library", RFC 8525,
DOI 10.17487/RFC8525, March 2019,
.
@@ -953,21 +967,21 @@
Management Datastore Architecture", RFC 8526,
DOI 10.17487/RFC8526, March 2019,
.
[RFC8527] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
and R. Wilton, "RESTCONF Extensions to Support the Network
Management Datastore Architecture", RFC 8527,
DOI 10.17487/RFC8527, March 2019,
.
-8.2. Informative References
+7.2. Informative References
[I-D.ietf-netmod-artwork-folding]
Watsen, K., Auerswald, E., Farrel, A., and Q. WU,
"Handling Long Lines in Inclusions in Internet-Drafts and
RFCs", draft-ietf-netmod-artwork-folding-12 (work in
progress), January 2020.
[I-D.ietf-netmod-factory-default]
WU, Q., Lengyel, B., and Y. Niu, "A YANG Data Model for
Factory Default Settings", draft-ietf-netmod-factory-
@@ -981,20 +995,24 @@
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
DOI 10.17487/RFC3688, January 2004,
.
[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for
the Network Configuration Protocol (NETCONF)", RFC 6020,
DOI 10.17487/RFC6020, October 2010,
.
+ [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
+ BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
+ .
+
[RFC8632] Vallin, S. and M. Bjorklund, "A YANG Data Model for Alarm
Management", RFC 8632, DOI 10.17487/RFC8632, September
2019, .
[RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications
for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641,
September 2019, .
Appendix A. Changes between revisions
@@ -1025,42 +1042,41 @@
v06 - v07
o Updated terminology, use-cases
o Many small changes based on WGLC
v05 - v06
o Modified module name format, removed .yin or .yang extension
- o Removed pattern for module and inline-module. We want to allow
- the usage of revision-label later
+ o Removed pattern for module and inline-module. The usage of
+ revision-label should also be allowed.
v04 - v05
o Updated according to YANG-Doctor review
o Updated security considerations
o Added a wrapping container for the schema, and renamed the data
nodes in the inline and uri cases.
o Allowed .yin for simplified-inline schema naming. Made date
- optional if it is not available in the YANG module.
+ optional if it is unavailable in the YANG module.
o Added a mandatory yid-version to the header metadata to allow
later updates of the module.
v03 - v04
o removed entity-tag and last-modified timestamp
-
o Added simplified-inline method of content-schema specification
v02 - v03
o target renamed to "content-schema" and "content defining YANG
module(s)"
o Made name of instance data set optional
o Updated according to draft-ietf-netmod-yang-data-ext-03
@@ -1102,68 +1119,67 @@
o Moved detailed use case descriptions to appendix
Appendix B. Backwards Compatibility
The concept of backwards compatibility and what changes are backwards
compatible are not defined for instance data sets as it is highly
dependent on the specific use case and the content-schema.
For instance data that is the result of a design or specification
- activity, some changes that may be good to avoid are listed. 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 problems.
+ activity, some changes that may be good to avoid are listed below.
+
+ 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.
o 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.
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-
type-id) the change may not be noticed.
o 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.
-Appendix C. Detailed Use Cases - Non-Normative
-
-C.1. Use Cases
+Appendix C. Detailed Use Cases
- We present a number of use cases were YANG instance data is needed.
+ This section is non-normative.
-C.1.1. Use Case 1: Early Documentation of Server Capabilities
+C.1. Use Case 1: Early Documentation of Server Capabilities
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:
- o data defined in ietf-yang-library: YANG modules, submodules,
+ o data defined in "ietf-yang-library": YANG modules, submodules,
features, deviations, schema-mounts, and datastores supported
([RFC8525])
o alarms supported ([RFC8632])
o data nodes and subtrees that support or do not support on-change
notifications ([RFC8641])
o netconf-capabilities in ietf-netconf-monitoring
-
While it is good practice to allow a client to query these
capabilities from the live server, that is often not possible.
Often when a network node is released, an associated NMS (network
management system) 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 not
- available early in some offline document, but only as instance data
+ 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 a correctly configured
network nodes from which data can be retrieved, is a very expensive
proposition. (An NMS may handle dozens of node types.)
Network operators often build their own home-grown 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
@@ -1176,42 +1192,42 @@
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/
document them early e.g., in a YANG instance data File.
It is anticipated that a separate IETF document will define in detail
how and which set of server capabilities should be documented.
-C.1.2. Use Case 2: Preloading Data
+C.2. Use Case 2: Preloading Data
There are parts of the configuration that must be fully configurable
by the operator. However, often a simple default configuration will
be sufficient.
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.
Defining access control data is a complex task. To help, the device
vendor predefines a set of default groups (/nacm:nacm/groups) and
rules for these groups to access specific parts of common models
(/nacm:nacm/rule-list/rule).
YANG instance data files are used to document and/or preload the
default configuration.
-C.1.3. Use Case 3: Documenting Factory Default Settings
+C.3. Use Case 3: Documenting Factory Default Settings
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 the default factory
configuration.
In NETCONF, the operation can already be used to
reset the startup datastore. There are ongoing efforts to introduce
a new, more generic factory-reset operation for the same purpose
[I-D.ietf-netmod-factory-default]