idnits 2.17.1
draft-ietf-netmod-yang-instance-file-format-09.txt:
Checking boilerplate required by RFC 5378 and the IETF Trust (see
https://trustee.ietf.org/license-info):
----------------------------------------------------------------------------
No issues found here.
Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt:
----------------------------------------------------------------------------
No issues found here.
Checking nits according to https://www.ietf.org/id-info/checklist :
----------------------------------------------------------------------------
No issues found here.
Miscellaneous warnings:
----------------------------------------------------------------------------
== The copyright year in the IETF Trust and authors Copyright Line does not
match the current year
-- The document date (March 17, 2020) is 1499 days in the past. Is this
intentional?
Checking references for intended status: Proposed Standard
----------------------------------------------------------------------------
(See RFCs 3967 and 4897 for information about using normative references
to lower-maturity documents in RFCs)
== Outdated reference: A later version (-15) exists of
draft-ietf-netmod-factory-default-14
Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--).
Run idnits with the --verbose option for more detailed information about
the items above.
--------------------------------------------------------------------------------
2 Netmod B. Lengyel
3 Internet-Draft Ericsson
4 Intended status: Standards Track B. Claise
5 Expires: September 18, 2020 Cisco Systems, Inc.
6 March 17, 2020
8 YANG Instance Data File Format
9 draft-ietf-netmod-yang-instance-file-format-09
11 Abstract
13 There is a need to document data defined in YANG models when a live
14 server is not available. Data is often needed already at design or
15 implementation time or needed by groups that do not have a live
16 running server available. This document specifies a standard file
17 format for YANG instance data, which follows the syntax and semantics
18 of existing YANG models, and annotates it with metadata.
20 Status of This Memo
22 This Internet-Draft is submitted in full conformance with the
23 provisions of BCP 78 and BCP 79.
25 Internet-Drafts are working documents of the Internet Engineering
26 Task Force (IETF). Note that other groups may also distribute
27 working documents as Internet-Drafts. The list of current Internet-
28 Drafts is at https://datatracker.ietf.org/drafts/current/.
30 Internet-Drafts are draft documents valid for a maximum of six months
31 and may be updated, replaced, or obsoleted by other documents at any
32 time. It is inappropriate to use Internet-Drafts as reference
33 material or to cite them other than as "work in progress."
35 This Internet-Draft will expire on September 18, 2020.
37 Copyright Notice
39 Copyright (c) 2020 IETF Trust and the persons identified as the
40 document authors. All rights reserved.
42 This document is subject to BCP 78 and the IETF Trust's Legal
43 Provisions Relating to IETF Documents
44 (https://trustee.ietf.org/license-info) in effect on the date of
45 publication of this document. Please review these documents
46 carefully, as they describe your rights and restrictions with respect
47 to this document. Code Components extracted from this document must
48 include Simplified BSD License text as described in Section 4.e of
49 the Trust Legal Provisions and are provided without warranty as
50 described in the Simplified BSD License.
52 Table of Contents
54 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2
55 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
56 2.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 4
57 2.2. Delivery of Instance Data . . . . . . . . . . . . . . . . 4
58 2.3. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 5
59 3. Instance Data File Format . . . . . . . . . . . . . . . . . . 5
60 3.1. Specifying the Content Schema . . . . . . . . . . . . . . 7
61 3.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 7
62 3.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 8
63 3.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8
64 3.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8
65 4. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 12
66 4.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 12
67 4.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 13
68 5. Security Considerations . . . . . . . . . . . . . . . . . . . 18
69 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
70 6.1. URI Registration . . . . . . . . . . . . . . . . . . . . 19
71 6.2. YANG Module Name Registration . . . . . . . . . . . . . . 19
72 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20
73 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 20
74 8.1. Normative References . . . . . . . . . . . . . . . . . . 20
75 8.2. Informative References . . . . . . . . . . . . . . . . . 21
76 Appendix A. Changes between revisions . . . . . . . . . . . . . 22
77 Appendix B. Backwards Compatibility . . . . . . . . . . . . . . 24
78 Appendix C. Detailed Use Cases - Non-Normative . . . . . . . . . 25
79 C.1. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 25
80 C.1.1. Use Case 1: Early Documentation of Server
81 Capabilities . . . . . . . . . . . . . . . . . . . . 25
82 C.1.2. Use Case 2: Preloading Data . . . . . . . . . . . . . 26
83 C.1.3. Use Case 3: Documenting Factory Default Settings . . 26
84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26
86 1. Terminology
88 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
89 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
90 "OPTIONAL" in this document are to be interpreted as described in BCP
91 14 [RFC2119] [RFC8174] when, and only when, they appear in all
92 capitals, as shown here.
94 Instance Data: A collection of instantiated data nodes.
96 Instance Data Set: A named set of data items annotated with metadata
97 that can be used as instance data in a YANG data tree.
99 Instance Data File: A file containing an instance data set formatted
100 according to the rules described in this document.
102 Content-schema: A set of YANG modules with their revision, supported
103 features, and deviations for which the instance data set contains
104 instance data.
106 Content defining YANG module: an individual YANG module that is part
107 of the content-schema.
109 The term Server is used as defined in [RFC8342].
111 2. Introduction
113 There is a need to document data defined in YANG models when a live
114 server is not available. Data is often needed already at design or
115 implementation time or needed by groups that do not have a live
116 running server available. To facilitate this offline delivery of
117 data, this document specifies a standard format for YANG instance
118 data sets and YANG instance data files.
120 The following is a list of already implemented and potential use
121 cases.
123 UC1 Documentation of server capabilities
125 UC2 Preloading default configuration data
127 UC3 Documenting Factory Default Settings
129 UC4 Storing the configuration of a device, e.g., for backup, archive
130 or audit purposes
132 UC5 Storing diagnostics data
134 UC6 Allowing YANG instance data to potentially be carried within
135 other IPC message formats
137 UC7 Default instance data used as part of a templating solution
139 UC8 Providing data examples in RFCs or internet drafts
141 In Appendix C we describe the first three use cases in detail.
143 There are many and varied use cases where YANG instance data could be
144 used. We do not want to limit future uses of instance data sets, so
145 specifying how and when to use YANG instance data is out of scope for
146 this document. It is anticipated that other documents will define
147 specific use cases. Use cases are listed here only to indicate the
148 need for this work.
150 2.1. Principles
152 The following is a list of the basic principles of the instance data
153 format:
155 P1 Two standard formats shall be defined based on the XML and JSON
156 encodings.
158 P2 Instance data shall reuse existing encoding rules for YANG
159 defined data.
161 P3 Metadata about the instance data set (Section 3, Paragraph 9)
162 shall be defined.
164 P4 A YANG instance data set shall be allowed to contain data for
165 multiple YANG modules.
167 P5 Instance data shall be allowed to contain configuration data,
168 state data, or a mix of the two.
170 P6 Partial data sets shall be allowed.
172 P7 The YANG instance data format shall be usable for any data for
173 which YANG module(s) are defined and available to the reader,
174 independent of whether the module is actually implemented by a
175 server.
177 P8 It shall be possible to report the identity of the datastore with
178 which the instance data set is associated.
180 2.2. Delivery of Instance Data
182 Instance data sets that are produced as a result of some sort of
183 specification or design effort may be available without the need for
184 a live server e.g., via download from the vendor's website, or in any
185 other way that product documentation is distributed.
187 Other instance data sets may be read from or produced by the YANG
188 server itself e.g., UC5 documenting diagnostic data.
190 2.3. Data Life cycle
192 A YANG instance data set is created at a specific point of time. If
193 the data changes afterwards, this is not represented in the instance
194 data set anymore. The current values may be retrieved at run-time
195 via NETCONF/RESTCONF or received e.g., in YANG-Push notifications.
197 Whether the instance data changes and if so, when and how, should be
198 described either in the instance data set's description statement or
199 in some other implementation specific manner.
201 3. Instance Data File Format
203 A YANG instance data file MUST contain a single instance data set and
204 no additional data.
206 The format of the instance data set is defined by the ietf-yang-
207 instance-data YANG module. It is made up of a header part and
208 content-data. The header part carries metadata for the instance data
209 set. The content-data, defined as an anydata data node, carries the
210 instance data that we want to document/provide. The syntax and
211 semantics of content-data is defined by the content-schema.
213 Two formats are specified based on the XML and JSON YANG encodings.
214 Later as other YANG encodings (e.g., CBOR) are defined, further
215 instance data formats may be specified.
217 The content-data part MUST conform to the content-schema, while
218 allowing for the exceptions listed below. The content-data part
219 SHALL follow the encoding rules defined in [RFC7950] for XML and
220 [RFC7951] for JSON and MUST use UTF-8 character encoding. Content-
221 data MAY include:
223 metadata as defined by [RFC7952].
225 a default attribute as defined in [RFC6243] section 6. and in
226 [RFC8040] section 4.8.9.
228 origin metadata as specified in [RFC8526] and [RFC8527]
230 implementation specific metadata relevant to individual data
231 nodes. Unknown metadata MUST be ignored by users of instance
232 data, allowing it to be used later for other purposes.
234 An instance data set MAY contain data for any number of YANG modules;
235 if needed it MAY carry the complete configuration and state data set
236 for a server. Default values SHOULD NOT be included.
238 Config=true and config=false data MAY be mixed in the instance data
239 file.
241 Instance data files MAY contain partial data sets. This means
242 mandatory, min-elements, require-instance=true, must and when
243 constrains MAY be violated.
245 The name of the instance data file SHOULD take one of the following
246 two forms:
248 If revision information inside the data set is present
250 * instance-data-set-name ['@' revision-date] '.filetype'
252 * E.g., acme-router-modules@2018-01-25.xml
254 If the leaf "name" is present in the instance data header, this
255 MUST be used. If the "revision-date" is present in both the
256 filename and in the instance data header, the revision date in the
257 file name MUST be set to the latest revision date inside the
258 instance data set.
260 If timestamp information inside the data set is present
262 * instance-data-set-name ['@' timestamp] '.filetype'
264 * E.g., acme-router-modules@2018-01-25T15_06_34_3+01_00.json
266 If the leaf "name" is present in the instance data header, this
267 MUST be used. If the "timestamp" is present both in the filename
268 and in the instance data header, the timestamp in the file name
269 MUST be set to the timestamp inside the instance data set; the
270 semicolons and the decimal point, if present, shall be replaced by
271 underscores.
273 The revision date or timestamp is optional. ".filetype" SHALL be
274 ".json" or ".xml" according to the format used.
276 Metadata, information about the data set itself SHOULD be included in
277 the instance data set. Some metadata items are defined in the YANG
278 module ietf-yang-instance-data, but other items MAY also be used.
279 Metadata MUST include:
281 Version of the YANG Instance Data format
283 Metadata SHOULD include:
285 o Name of the data set
286 o Content schema specification
288 o Description of the instance data set. The description SHOULD
289 contain information whether and how the data can change during the
290 lifetime of the server.
292 3.1. Specifying the Content Schema
294 To properly understand and use an instance data set, the user needs
295 to know the content-schema. One of the following methods SHOULD be
296 used:
298 Inline method: Include the needed information as part of the
299 instance data set.
301 Simplified-Inline method: Include the needed information as part
302 of the instance data set; short specification.
304 URI method: Include a URI that references another YANG instance
305 data file. This instance data file will use the same content-
306 schema as the referenced YANG instance data file. (if you don't
307 want to repeat the info again and again)
309 External Method: Do not include the content-schema, the user needs
310 to obtain the information through external documents.
312 Additional methods e.g., a YANG-package based solution may be added
313 later.
315 Note, the specified content-schema only indicates the set of modules
316 that were used to define this YANG instance data set. Sometimes
317 instance data may be used for a server supporting a different YANG
318 module set. (e.g., for "UC2 Preloading Data" the instance data set
319 may not be updated every time the YANG modules on the server are
320 updated) Whether an instance data set originally defined using a
321 specific content-schema is usable with a different other schema
322 depends on many factors including the amount of differences and the
323 compatibility between the original and the other schema, considering
324 modules, revisions, features, deviations, the scope of the instance
325 data, etc.
327 3.1.1. Inline Method
329 One or more inline-module elements define YANG module(s) used to
330 specify the content defining YANG modules.
332 E.g., ietf-yang-library@2016-06-21
334 The anydata inline-schema carries instance data (conforming to the
335 inline-modules) that actually specifies the content defining YANG
336 modules including revision, supported features, deviations and any
337 relevant additional data (e.g., revision labels
338 [I-D.verdt-netmod-yang-module-versioning]). See Section 3.2.
340 3.1.2. Simplified-Inline Method
342 The instance data set contains a list of content defining YANG
343 modules including the revision date for each. Usage of this method
344 implies that the modules are used without any deviations and with all
345 features supported.
347 3.1.3. URI Method
349 The same-schema-as-file leaf SHALL contain a URI that references
350 another YANG instance data file. The current instance data file will
351 use the same content schema as the referenced file.
353 The referenced instance data file MAY have no content-data if it is
354 used solely for specifying the content-schema.
356 If a referenced instance data file is not available, content-schema
357 is unknown.
359 The URI method is advantageous when the user wants to avoid the
360 overhead of specifying the content-schema in each instance data file:
361 E.g., In Use Case 6, when the system creates a diagnostic file every
362 minute to document the state of the server.
364 3.2. Examples
366 The following examples use artwork folding
367 [I-D.ietf-netmod-artwork-folding] for better formatting.
369 The following example is based on "UC1, Documenting Server
370 Capabilities". It provides (a shortened) list of supported YANG
371 modules and NETCONF capabilities for a server. It uses the inline
372 method to specify the content-schema.
374 ========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
376
377
379 acme-router-modules
380 2020-03-06
381
382 ietf-yang-library@2016-06-21
383
384
386
387 ietf-yang-library
388 2016-06-21
389
390
391 ietf-netconf-monitoring
392 2010-10-04
393
394
395
396
397
398 1956-10-23
399 Initial version
400
401 Defines the minimal set of modules that any \
402 acme-router will contain.
403 info@acme.com
404
405
408
410
411 ietf-yang-library
412 2016-06-21
413 \
414 urn:ietf:params:xml:ns:yang:ietf-yang-library\
415
416 implement
417
418
419 ietf-system
420 2014-08-06
421 urn:ietf:params:xml:ns:yang:ietf-system
422 sys:authentication
423 sys:local-users
424
425 acme-system-ext
426 2018-08-06
427
428 implement
429
430
431 ietf-yang-types
432 2013-07-15
433 urn:ietf:params:xml:ns:yang:ietf-yang-types\
434
435 import
436
437
438 acme-system-ext
439 2018-08-06
440 urn:rdns:acme.com:oammodel:acme-system-ext\
441
442 implement
443
444
445
447
448 \
449 urn:ietf:params:netconf:capability:validate:1.1\
450
451
452
453
454
456 Figure 1: XML Instance Data Set - Use case 1, Documenting server
457 capabilities
459 The following example is based on "UC2, Preloading Default
460 Configuration". It provides a (shortened) default rule set for a
461 read-only operator role. It uses the inline method for specifying
462 the content-schema.
464
465
467 read-only-acm-rules
468 2020-03-06
469
470 ietf-yang-library@2019-01-04
471
472
474
475 all
476
477 ietf-netconf-acm
478 2012-02-22
479
480
481
482
483
484
485 1776-07-04
486 Initial version
487
488 Access control rules for a read-only role.
489
490
491 true
492 deny
493 deny
494
495 read-only-role
496 read-only-group
497
498 read-all
499 *
500 read
501 permit
502
503
504
505
506
508 Figure 2: XML Instance Data Set - Use case 2, Preloading access
509 control data
511 The following example is based on UC5 Storing diagnostics data. An
512 instance data set is produced by the server every 15 minutes that
513 contains statistics about NETCONF. As a new set is produced
514 periodically many times a day a revision-date would be useless;
515 instead a timestamp is included.
517 {
518 "ietf-yang-instance-data:instance-data-set": {
519 "name": "acme-router-netconf-diagnostics",
520 "format-version": "2020-03-06",
521 "content-schema": {
522 "same-schema-as-file": "file:///acme-diagnostics-schema.json",
523 },
524 "timestamp": "2018-01-25T17:00:38Z",
525 "description":
526 "NETCONF statistics",
527 "content-data": {
528 "ietf-netconf-monitoring:netconf-state": {
529 "statistics": {
530 "netconf-start-time ": "2018-12-05T17:45:00Z",
531 "in-bad-hellos ": "32",
532 "in-sessions ": "397",
533 "dropped-sessions ": "87",
534 "in-rpcs ": "8711",
535 "in-bad-rpcs ": "408",
536 "out-rpc-errors ": "408",
537 "out-notifications": "39007"
538 }
539 }
540 }
541 }
542 }
544 Figure 3: JSON Instance Data File example - UC5 Storing diagnostics
545 data
547 4. YANG Instance Data Model
549 4.1. Tree Diagram
551 The following tree diagram [RFC8340] provides an overview of the data
552 model.
554 module: ietf-yang-instance-data
555 structure instance-data-set:
556 +--rw name? string
557 +--rw format-version string
558 +--rw content-schema
559 | +--rw (content-schema-spec)?
560 | +--:(simplified-inline)
561 | | +--rw module* string
562 | +--:(inline) {inline-content-schema}?
563 | | +--rw inline-module* string
564 | | +--rw inline-schema
565 | +--:(uri)
566 | +--rw same-schema-as-file? inet:uri
567 +--rw description* string
568 +--rw contact? string
569 +--rw organization? string
570 +--rw datastore? ds:datastore-ref
571 +--rw revision* [date]
572 | +--rw date string
573 | +--rw description? string
574 +--rw timestamp? yang:date-and-time
575 +--rw content-data?
577 4.2. YANG Model
579 This YANG module imports typedefs from [RFC6991], identities from
580 [RFC8342] and the "structure" extension from
581 [I-D.ietf-netmod-yang-data-ext].
583 The YANG data model in this document conforms to the Network
584 Management Datastore Architecture (NMDA) defined in [RFC8342]
586 file "ietf-yang-instance-data@2020-03-06.yang"
587 module ietf-yang-instance-data {
588 yang-version 1.1;
589 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data";
590 prefix yid;
592 import ietf-yang-structure-ext {
593 prefix sx;
594 }
595 import ietf-datastores {
596 prefix ds;
597 }
598 import ietf-inet-types {
599 prefix inet;
600 }
601 import ietf-yang-types {
602 prefix yang;
603 }
605 organization
606 "IETF NETMOD Working Group";
607 contact
608 "WG Web:
609 WG List:
611 Author: Balazs Lengyel
612 ";
613 description
614 "The module defines the structure and content of YANG
615 instance data sets.
617 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
618 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
619 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
620 are to be interpreted as described in BCP 14 (RFC 2119)
621 (RFC 8174) when, and only when, they appear in all
622 capitals, as shown here.
624 Copyright (c) 2020 IETF Trust and the persons identified as
625 authors of the code. All rights reserved.
627 Redistribution and use in source and binary forms, with or
628 without modification, is permitted pursuant to, and subject
629 to the license terms contained in, the Simplified BSD License
630 set forth in Section 4.c of the IETF Trust's Legal Provisions
631 Relating to IETF Documents
632 (http://trustee.ietf.org/license-info).
634 This version of this YANG module is part of RFC XXXX; see
635 the RFC itself for full legal notices.";
637 revision 2020-03-06 {
638 description
639 "Initial revision.";
640 reference
641 "RFC XXXX: YANG Instance Data Format";
642 }
644 feature inline-content-schema {
645 description
646 "This feature indicates that inline content-schema
647 option is supported.";
648 }
649 sx:structure "instance-data-set" {
650 description
651 "A data structure to define a format for
652 YANG instance data sets. Consists of meta-data about
653 the instance data set and the real content-data.";
654 leaf name {
655 type string;
656 description
657 "Name of the YANG instance data set.";
658 }
659 leaf format-version {
660 type string;
661 default "2020-03-06";
662 description
663 "Version of the 'YANG Instance Data format'.
665 It SHALL contain the revision date of the
666 ietf-yang-instance-data module used when creating the
667 instance data set in a YYYY-MM-DD format";
668 }
669 container content-schema {
670 description
671 "The content schema used to create the instance data set";
672 choice content-schema-spec {
673 description
674 "Specification of the content-schema";
675 case simplified-inline {
676 leaf-list module {
677 type string;
678 description
679 "The list of content defining YANG modules.
681 The value SHALL start with the module name.
682 If the module contains a revision statement the
683 revision date SHALL be included in the leaf-list
684 entry. If other methods (e.g., revision-label) are
685 defined to identify individual module revisions
686 those MAY be used instead of using a revision date.
688 E.g., ietf-yang-library@2016-06-21
690 Usage of this leaf-list implies the modules are
691 used without any deviations and with all features
692 supported. Multiple revisions of the same module
693 MUST NOT be specified.";
694 }
695 }
696 case inline {
697 if-feature "inline-content-schema";
698 leaf-list inline-module {
699 type string;
700 min-elements 1;
701 ordered-by user;
702 description
703 "Indicates that content defining YANG modules
704 are specified inline.
706 The value SHALL start with the module name.
707 If the module contains a revision statement the
708 revision date SHALL be included in the leaf-list
709 entry. If other methods (e.g., revision-label) are
710 defined to identify individual module revisions
711 those MAY be used instead of using a revision date.
713 E.g., ietf-yang-library@2016-06-21
715 The first item is either ietf-yang-library or some
716 other YANG module that contains a list of YANG modules
717 with their name, revision-date, supported-features,
718 and deviations. The usage of
719 ietf-yang-library@2019-01-04 MUST be supported.
720 Using other modules, module versions MAY also be
721 supported.
723 As some versions of ietf-yang-library MAY contain
724 different module-sets for different datastores, if
725 multiple module-sets are included, the instance data
726 set's meta-data MUST contain the datastore information
727 and instance data for the ietf-yang-library MUST also
728 contain information specifying the module-set for the
729 relevant datastore.
731 Subsequent items MAY specify YANG modules augmenting
732 the first module with useful data
733 (e.g., revision label).";
734 }
735 anydata inline-schema {
736 mandatory true;
737 description
738 "Instance data corresponding to the YANG modules
739 specified in the inline-module nodes defining the set
740 of content defining YANG modules for this
741 instance-data-set.";
742 }
743 }
744 case uri {
745 leaf same-schema-as-file {
746 type inet:uri;
747 description
748 "A reference to another YANG instance data file.
749 This instance data file uses the same
750 content schema as the referenced file.";
751 }
752 }
753 }
754 }
755 leaf-list description {
756 type string;
757 description
758 "Description of the instance data set.";
759 }
760 leaf contact {
761 type string;
762 description
763 "Contact information for the person or
764 organization to whom queries concerning this
765 instance data set should be sent.";
766 }
767 leaf organization {
768 type string;
769 description
770 "Organization responsible for the instance
771 data set.";
772 }
773 leaf datastore {
774 type ds:datastore-ref;
775 description
776 "The identity of the datastore with which the
777 instance data set is associated, e.g., the datastore from
778 where the data was read or the datastore into which the data
779 may be loaded or the datastore which is being documented.
780 If a single specific datastore cannot be specified, the
781 leaf MUST be absent.
783 If this leaf is absent, then the datastore to which the
784 instance data belongs is undefined.";
785 }
786 list revision {
787 key "date";
788 description
789 "Instance data sets that are produced as
790 a result of some sort of specification or design effort
791 SHOULD have at least one revision entry. For every
792 published editorial change, a new one SHOULD be added
793 in front of the revisions sequence so that all
794 revisions are in reverse chronological order.
796 For instance data sets that are read from
797 or produced by a server or otherwise
798 subject to frequent updates or changes, revision
799 SHOULD NOT be present";
800 leaf date {
801 type string {
802 pattern '\d{4}-\d{2}-\d{2}';
803 }
804 description
805 "Specifies the date the instance data set
806 was last modified. Formatted as YYYY-MM-DD";
807 }
808 leaf description {
809 type string;
810 description
811 "Description of this revision of the instance data set.";
812 }
813 }
814 leaf timestamp {
815 type yang:date-and-time;
816 description
817 "The date and time when the instance data set
818 was last modified.
820 For instance data sets that are read from or produced
821 by a server or otherwise subject to frequent
822 updates or changes, timestamp SHOULD be present";
823 }
824 anydata content-data {
825 description
826 "Contains the real instance data.
827 The data MUST conform to the relevant YANG Modules specified
828 either in the content-schema-spec or in some other
829 implementation specific manner.";
830 }
831 }
832 }
833
835 5. Security Considerations
837 The YANG module defined in this document is designed as a wrapper
838 specifying a format and a metadata header for YANG instance data
839 defined by the content-schema. The data is designed to be accessed
840 as a stored file or over any file access method or protocol.
842 The document does not specify any method to influence the behavior of
843 a server.
845 Instance data files may contain sensitive data.
847 The header part is not security sensitive.
849 The security sensitivity of the instance data in the content part is
850 completely dependent on the content schema. Depending on the nature
851 of the instance data, instance data files MAY need to be handled in a
852 secure way. The same kind of handling should be applied, that would
853 be needed for the result of a read operation returning the same data.
855 Instance data files should be protected against modification or
856 unauthorized access using normal file handling mechanisms. Care
857 should be taken, when copying the original files or providing file
858 access for additional users, not to reveal information
859 unintentionally.
861 6. IANA Considerations
863 This document registers one URI and one YANG module.
865 6.1. URI Registration
867 This document registers one URI in the IETF XML registry [RFC3688].
868 Following the format in RFC 3688, the following registration is
869 requested to be made:
871 URI: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data
873 Registrant Contact: The IESG.
875 XML: N/A, the requested URI is an XML namespace.
877 6.2. YANG Module Name Registration
879 This document registers one YANG module in the YANG Module Names
880 registry [RFC6020].
882 name: ietf-yang-instance-data
883 namespace: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data
884 prefix: yid
885 reference: RFC XXXX
887 7. Acknowledgments
889 For their valuable comments, discussions, and feedback, we wish to
890 acknowledge Andy Bierman, Juergen Schoenwaelder, Rob Wilton, Joe
891 Clarke, Kent Watsen Martin Bjorklund, Ladislav Lhotka, Qin Wu and
892 other members of the Netmod WG.
894 8. References
896 8.1. Normative References
898 [I-D.ietf-netmod-yang-data-ext]
899 Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data
900 Structure Extensions", draft-ietf-netmod-yang-data-ext-05
901 (work in progress), December 2019.
903 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
904 Requirement Levels", BCP 14, RFC 2119,
905 DOI 10.17487/RFC2119, March 1997,
906 .
908 [RFC6243] Bierman, A. and B. Lengyel, "With-defaults Capability for
909 NETCONF", RFC 6243, DOI 10.17487/RFC6243, June 2011,
910 .
912 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types",
913 RFC 6991, DOI 10.17487/RFC6991, July 2013,
914 .
916 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
917 RFC 7950, DOI 10.17487/RFC7950, August 2016,
918 .
920 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG",
921 RFC 7951, DOI 10.17487/RFC7951, August 2016,
922 .
924 [RFC7952] Lhotka, L., "Defining and Using Metadata with YANG",
925 RFC 7952, DOI 10.17487/RFC7952, August 2016,
926 .
928 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
929 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
930 .
932 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
933 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
934 May 2017, .
936 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
937 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
938 .
940 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
941 and R. Wilton, "Network Management Datastore Architecture
942 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
943 .
945 [RFC8525] Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K.,
946 and R. Wilton, "YANG Library", RFC 8525,
947 DOI 10.17487/RFC8525, March 2019,
948 .
950 [RFC8526] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
951 and R. Wilton, "NETCONF Extensions to Support the Network
952 Management Datastore Architecture", RFC 8526,
953 DOI 10.17487/RFC8526, March 2019,
954 .
956 [RFC8527] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
957 and R. Wilton, "RESTCONF Extensions to Support the Network
958 Management Datastore Architecture", RFC 8527,
959 DOI 10.17487/RFC8527, March 2019,
960 .
962 8.2. Informative References
964 [I-D.ietf-netmod-artwork-folding]
965 Watsen, K., Auerswald, E., Farrel, A., and Q. WU,
966 "Handling Long Lines in Inclusions in Internet-Drafts and
967 RFCs", draft-ietf-netmod-artwork-folding-12 (work in
968 progress), January 2020.
970 [I-D.ietf-netmod-factory-default]
971 WU, Q., Lengyel, B., and Y. Niu, "A YANG Data Model for
972 Factory Default Settings", draft-ietf-netmod-factory-
973 default-14 (work in progress), February 2020.
975 [I-D.verdt-netmod-yang-module-versioning]
976 Claise, B., Clarke, J., Rahman, R., Wilton, R., Lengyel,
977 B., Sterne, J., and K. D'Souza, "Updated YANG Module
978 Revision Handling", draft-verdt-netmod-yang-module-
979 versioning-01 (work in progress), October 2019.
981 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
982 DOI 10.17487/RFC3688, January 2004,
983 .
985 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for
986 the Network Configuration Protocol (NETCONF)", RFC 6020,
987 DOI 10.17487/RFC6020, October 2010,
988 .
990 [RFC8632] Vallin, S. and M. Bjorklund, "A YANG Data Model for Alarm
991 Management", RFC 8632, DOI 10.17487/RFC8632, September
992 2019, .
994 [RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications
995 for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641,
996 September 2019, .
998 Appendix A. Changes between revisions
1000 Note to RFC Editor (To be removed by RFC Editor)
1002 v08 - v09
1004 o Removed reference to similar to get reply
1006 o Introduced artwork folding in the examples
1008 v07 - v08
1010 o Moved compatibility into appendix
1012 o Renamed yid-version to format-version as "yid" can be regarded as
1013 a racial slur. Changed format to date of the YANG module
1015 o Made support of ietf-yang-library mandatory if inline-content-
1016 schema is supported
1018 o Many small changes based on WGLC
1020 v06 - v07
1022 o Updated terminology, use-cases
1024 o Many small changes based on WGLC
1026 v05 - v06
1028 o Modified module name format, removed .yin or .yang extension
1030 o Removed pattern for module and inline-module. We want to allow
1031 the usage of revision-label later
1033 v04 - v05
1035 o Updated according to YANG-Doctor review
1037 o Updated security considerations
1039 o Added a wrapping container for the schema, and renamed the data
1040 nodes in the inline and uri cases.
1042 o Allowed .yin for simplified-inline schema naming. Made date
1043 optional if it is not available in the YANG module.
1045 o Added a mandatory yid-version to the header metadata to allow
1046 later updates of the module.
1048 v03 - v04
1050 o removed entity-tag and last-modified timestamp
1052 o Added simplified-inline method of content-schema specification
1054 v02 - v03
1056 o target renamed to "content-schema" and "content defining YANG
1057 module(s)"
1059 o Made name of instance data set optional
1061 o Updated according to draft-ietf-netmod-yang-data-ext-03
1063 o Clarified that entity-tag and last-modified timestamp are encoded
1064 as metadata. While they contain useful data, the HTTP-header
1065 based encoding from Restconf is not suitable.
1067 v01 - v02
1069 o Removed design time from terminology
1071 o Defined the format of the content-data part by referencing various
1072 RFCs and drafts instead of the result of the get-data and get
1073 operations.
1075 o Changed target-ptr to a choice
1077 o Inline target-ptr may include augmenting modules and alternatives
1078 to ietf-yang-library
1080 o Moved list of target modules into a separate
1081 element.
1083 o Added backwards compatibility considerations
1085 v00 - v01
1087 o Added the target-ptr metadata with 3 methods
1089 o Added timestamp metadata
1091 o Removed usage of dedicated .yid file extension
1093 o Added list of use cases
1095 o Added list of principles
1097 o Updated examples
1099 o Moved detailed use case descriptions to appendix
1101 Appendix B. Backwards Compatibility
1103 The concept of backwards compatibility and what changes are backwards
1104 compatible are not defined for instance data sets as it is highly
1105 dependent on the specific use case and the content-schema.
1107 For instance data that is the result of a design or specification
1108 activity, some changes that may be good to avoid are listed. YANG
1109 uses the concept of managed entities identified by key values; if the
1110 connection between the represented entity and the key value is not
1111 preserved during an update, this may lead to problems.
1113 o If the key value of a list entry that represents the same managed
1114 entity as before is changed, the user may mistakenly identify the
1115 list entry as new.
1117 o If the meaning of a list entry is changed, but the key values are
1118 not (e.g., redefining an alarm-type but not changing its alarm-
1119 type-id) the change may not be noticed.
1121 o If the key value of a previously removed list entry is reused for
1122 a different entity, the change may be misinterpreted as
1123 reintroducing the previous entity.
1125 Appendix C. Detailed Use Cases - Non-Normative
1127 C.1. Use Cases
1129 We present a number of use cases were YANG instance data is needed.
1131 C.1.1. Use Case 1: Early Documentation of Server Capabilities
1133 A server has a number of server-capabilities that are defined in YANG
1134 modules and can be retrieved from the server using protocols like
1135 NETCONF or RESTCONF. Server capabilities include:
1137 o data defined in ietf-yang-library: YANG modules, submodules,
1138 features, deviations, schema-mounts, and datastores supported
1139 ([RFC8525])
1141 o alarms supported ([RFC8632])
1143 o data nodes and subtrees that support or do not support on-change
1144 notifications ([RFC8641])
1146 o netconf-capabilities in ietf-netconf-monitoring
1148 While it is good practice to allow a client to query these
1149 capabilities from the live server, that is often not possible.
1151 Often when a network node is released, an associated NMS (network
1152 management system) is also released with it. The NMS depends on the
1153 capabilities of the server. During NMS implementation, information
1154 about server capabilities is needed. If the information is not
1155 available early in some offline document, but only as instance data
1156 from the live network node, the NMS implementation will be delayed,
1157 because it has to wait until the network node is ready. Also
1158 assuming that all NMS implementors will have a correctly configured
1159 network nodes from which data can be retrieved, is a very expensive
1160 proposition. (An NMS may handle dozens of node types.)
1162 Network operators often build their own home-grown NMS systems that
1163 need to be integrated with a vendor's network node. The operator
1164 needs to know the network node's server capabilities in order to do
1165 this. Moreover, the network operator's decision to buy a vendor's
1166 product may even be influenced by the network node's OAM feature set
1167 documented as the server's capabilities.
1169 Beside NMS implementors, system integrators and many others also need
1170 the same information early. Examples could be model driven testing,
1171 generating documentation, etc.
1173 Most server-capabilities are relatively stable and change only during
1174 upgrade or due to licensing or the addition or removal of hardware.
1175 They are usually defined by a vendor at design time, before the
1176 product is released. It is feasible and advantageous to define/
1177 document them early e.g., in a YANG instance data File.
1179 It is anticipated that a separate IETF document will define in detail
1180 how and which set of server capabilities should be documented.
1182 C.1.2. Use Case 2: Preloading Data
1184 There are parts of the configuration that must be fully configurable
1185 by the operator. However, often a simple default configuration will
1186 be sufficient.
1188 One example is access control groups/roles and related rules. While
1189 a sophisticated operator may define dozens of different groups, often
1190 a basic (read-only operator, read-write system administrator,
1191 security-administrator) triplet will be enough. Vendors will often
1192 provide such default configuration data to make device configuration
1193 easier for an operator.
1195 Defining access control data is a complex task. To help, the device
1196 vendor predefines a set of default groups (/nacm:nacm/groups) and
1197 rules for these groups to access specific parts of common models
1198 (/nacm:nacm/rule-list/rule).
1200 YANG instance data files are used to document and/or preload the
1201 default configuration.
1203 C.1.3. Use Case 3: Documenting Factory Default Settings
1205 Nearly every server has a factory default configuration. If the
1206 system is really badly misconfigured or if the current configuration
1207 is to be abandoned, the system can be reset the default factory
1208 configuration.
1210 In NETCONF, the operation can already be used to
1211 reset the startup datastore. There are ongoing efforts to introduce
1212 a new, more generic factory-reset operation for the same purpose
1213 [I-D.ietf-netmod-factory-default]
1215 The operator currently has no way to know what the default
1216 configuration actually contains. YANG instance data can also be used
1217 to document the factory default configuration.
1219 Authors' Addresses
1220 Balazs Lengyel
1221 Ericsson
1222 Magyar Tudosok korutja 11
1223 1117 Budapest
1224 Hungary
1226 Phone: +36-70-330-7909
1227 Email: balazs.lengyel@ericsson.com
1229 Benoit Claise
1230 Cisco Systems, Inc.
1231 De Kleetlaan 6a b1
1232 1831 Diegem
1233 Belgium
1235 Phone: +32 2 704 5622
1236 Email: bclaise@cisco.com