idnits 2.17.1 draft-ietf-netmod-yang-instance-file-format-11.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 (April 8, 2020) is 1450 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: October 10, 2020 Cisco Systems, Inc. 6 April 8, 2020 8 YANG Instance Data File Format 9 draft-ietf-netmod-yang-instance-file-format-11 11 Abstract 13 There is a need to document data defined in YANG models when a live 14 server is unavailable. Data is often needed at design or 15 implementation time or needed when a live running server is 16 unavailable. This document specifies a standard file format for YANG 17 instance data, which follows the syntax and semantics of existing 18 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 October 10, 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. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 56 1.2. Principles . . . . . . . . . . . . . . . . . . . . . . . 4 57 1.3. Delivery of Instance Data . . . . . . . . . . . . . . . . 4 58 1.4. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 5 59 2. Instance Data File Format . . . . . . . . . . . . . . . . . . 5 60 2.1. Specifying the Content Schema . . . . . . . . . . . . . . 7 61 2.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 7 62 2.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 8 63 2.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8 64 2.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8 65 2.2.1. UC1, Documenting Server Capabilities . . . . . . . . 8 66 2.2.2. UC2, Preloading Default Configuration . . . . . . . . 10 67 2.2.3. UC5, Storing diagnostics data . . . . . . . . . . . . 11 68 3. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 12 69 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 12 70 3.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 13 71 4. Security Considerations . . . . . . . . . . . . . . . . . . . 19 72 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 73 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 20 74 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 20 75 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20 76 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 77 7.1. Normative References . . . . . . . . . . . . . . . . . . 20 78 7.2. Informative References . . . . . . . . . . . . . . . . . 21 79 Appendix A. Changes between revisions . . . . . . . . . . . . . 22 80 Appendix B. Backwards Compatibility . . . . . . . . . . . . . . 25 81 Appendix C. Detailed Use Cases . . . . . . . . . . . . . . . . . 25 82 C.1. Use Case 1: Early Documentation of Server Capabilities . 25 83 C.2. Use Case 2: Preloading Data . . . . . . . . . . . . . . . 26 84 C.3. Use Case 3: Documenting Factory Default Settings . . . . 27 85 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 87 1. Introduction 89 There is a need to document data defined in YANG models when a live 90 server is unavailable. Data is often needed at design or 91 implementation time or needed when a live running server is 92 unavailable. To facilitate this offline delivery of data, this 93 document specifies a standard format for YANG instance data sets and 94 YANG instance data files. The format of the instance data set is 95 defined by the "ietf-yang-instance-data" YANG module, see Section 3. 97 The YANG data model in this document conforms to the Network 98 Management Datastore Architecture (NMDA) defined in [RFC8342] 100 The following is a list of already implemented and potential use 101 cases. 103 UC1 Documentation of server capabilities 105 UC2 Preloading default configuration data 107 UC3 Documenting Factory Default Settings 109 UC4 Storing the configuration of a device, e.g., for backup, archive 110 or audit purposes 112 UC5 Storing diagnostics data 114 UC6 Allowing YANG instance data to potentially be carried within 115 other IPC message formats 117 UC7 Default instance data used as part of a templating solution 119 UC8 Providing data examples in RFCs or internet drafts 121 In Appendix C describes the first three use cases in detail. 123 There are many and varied use cases where YANG instance data could be 124 used. This document does not limit future uses of instance data 125 sets, so specifying how and when to use YANG instance data is out of 126 scope for this document. It is anticipated that other documents will 127 define specific use cases. Use cases are listed only as examples. 129 1.1. Terminology 131 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 132 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 133 "OPTIONAL" in this document are to be interpreted as described in BCP 134 14 [RFC2119] [RFC8174] when, and only when, they appear in all 135 capitals, as shown here. 137 Instance Data: A collection of instantiated data nodes. 139 Instance Data Set: A named set of data items annotated with metadata 140 that can be used as instance data in a YANG data tree. 142 Instance Data File: A file containing an instance data set formatted 143 according to the rules described in this document. 145 Content-schema: A set of YANG modules with their revision, supported 146 features, and deviations for which the instance data set contains 147 instance data. 149 Content defining YANG module: an individual YANG module that is part 150 of the content-schema. 152 The term "server" is used as defined in [RFC8342]. 154 1.2. Principles 156 The following is a list of the basic principles of the instance data 157 format: 159 P1 Two standard formats shall be defined based on the XML and JSON 160 encodings. 162 P2 Instance data shall reuse existing encoding rules for YANG 163 defined data. 165 P3 Metadata about the instance data set (Section 2, Paragraph 9) 166 shall be defined. 168 P4 A YANG instance data set shall be allowed to contain data for 169 multiple YANG modules. 171 P5 Instance data shall be allowed to contain configuration data, 172 state data, or a mix of the two. 174 P6 Partial data sets shall be allowed. 176 P7 The YANG instance data format shall be usable for any data for 177 which YANG module(s) are defined and available to the reader, 178 independent of whether the module is implemented by a server. 180 P8 It shall be possible to report the identity of the datastore with 181 which the instance data set is associated. 183 1.3. Delivery of Instance Data 185 Instance data sets that are produced as a result of some sort of 186 specification or design effort may be available without the need for 187 a live server e.g., via download from the vendor's website, or in any 188 other way that product documentation is distributed. 190 Other instance data sets may be read from or produced by the YANG 191 server itself e.g., UC5 documenting diagnostic data. 193 1.4. Data Life cycle 195 A YANG instance data set is created at a specific point of time. If 196 the data changes afterwards, this is not represented in the instance 197 data set anymore. The current values may be retrieved at run-time 198 via NETCONF/RESTCONF or received e.g., in YANG-Push notifications. 200 Whether the instance data changes and if so, when and how, should be 201 described either in the instance data set's description statement or 202 in some other implementation specific manner. 204 2. Instance Data File Format 206 A YANG instance data file MUST contain a single instance data set and 207 no additional data. 209 The format of the instance data set is defined by the "ietf-yang- 210 instance-data" YANG module. It is made up of a header part and 211 content-data. The header part carries metadata for the instance data 212 set. The content-data, defined as an anydata data node, carries the 213 instance data that the user wants to document/provide. The syntax 214 and semantics of content-data is defined by the content-schema. 216 Two formats are specified based on the XML and JSON YANG encodings. 217 Later as other YANG encodings (e.g., CBOR) are defined, further 218 instance data formats may be specified. 220 The content-data part MUST conform to the content-schema, while 221 allowing for the exceptions listed below. The content-data part 222 SHALL follow the encoding rules defined in [RFC7950] for XML and 223 [RFC7951] for JSON and MUST use UTF-8 character encoding. Content- 224 data MAY include: 226 o metadata as defined by [RFC7952]. 228 o a default attribute as defined in [RFC6243] section 6. and in 229 [RFC8040] section 4.8.9. 231 o origin metadata as specified in [RFC8526] and [RFC8527] 233 o implementation specific metadata relevant to individual data 234 nodes. Unknown metadata MUST be ignored by users of instance 235 data, allowing it to be used later for other purposes. 237 An instance data set MAY contain data for any number of YANG modules; 238 if needed it MAY carry the complete configuration and state data for 239 a server. Default values SHOULD NOT be included. 241 Configuration ("config true") and operational state data ("config 242 false") MAY be mixed in the instance data file. 244 Instance data files MAY contain partial data sets. This means 245 "mandatory", "min-elements", "require-instance true", "must" and 246 "when" constrains MAY be violated. 248 The name of the instance data file SHOULD take one of the following 249 two forms: 251 If "revision" information is present inside the data set: 253 instance-data-set-name ['@' revision-date] '.filetype' 255 E.g., acme-router-modules@2018-01-25.xml 257 If the leaf "name" is present in the instance data header, its 258 value SHOULD be used for the "instance-data-set-name". If the 259 "revision-date" is present in both the filename and in the 260 instance data header, the revision date in the file name MUST be 261 set to the latest revision date inside the instance data set. 263 If timestamp information inside the data set is present 265 instance-data-set-name ['@' timestamp] '.filetype' 267 E.g., acme-router-modules@2018-01-25T15_06_34_3+01_00.json 269 If the leaf "name" is present in the instance data header, its 270 value SHOULD be used for the "instance-data-set-name". If the 271 "timestamp" is present both in the filename and in the instance 272 data header, the timestamp in the file name SHOULD be set to the 273 timestamp inside the instance data set; the semicolons and the 274 decimal point, if present, shall be replaced by underscores. 276 The revision date or timestamp is optional. ".filetype" SHOULD be 277 ".json" or ".xml" according to the format used. 279 Metadata, information about the data set itself SHOULD be included in 280 the instance data set. Some metadata items are defined in the YANG 281 module "ietf-yang-instance-data", but other items MAY be used. 283 Metadata MUST include: 285 o Version of the YANG Instance Data format 287 Metadata SHOULD include: 289 o Name of the data set 291 o Content schema specification (i.e., the "content-schema" node) 293 o Description of the instance data set. The description SHOULD 294 contain information whether and how the data can change during the 295 lifetime of the server. 297 2.1. Specifying the Content Schema 299 To properly understand and use an instance data set, the user needs 300 to know the content-schema. One of the following methods SHOULD be 301 used: 303 Inline method: Include the needed information as part of the 304 instance data set. 306 Simplified-Inline method: Include the needed information as part 307 of the instance data set; short specification. 309 URI method: Include a URI that references another YANG instance 310 data file. This instance data file will use the same content- 311 schema as the referenced YANG instance data file. (if you don't 312 want to repeat the info again and again) 314 External Method: Do not include the "content-schema" node; the 315 user needs to obtain the information through external documents. 317 Additional methods e.g., a YANG-package based solution may be added 318 later. 320 Note, the specified content-schema only indicates the set of modules 321 that were used to define this YANG instance data set. Sometimes 322 instance data may be used for a server supporting a different YANG 323 module set. (e.g., for "UC2 Preloading Data" the instance data set 324 may not be updated every time the YANG modules on the server are 325 updated) Whether an instance data set originally defined using a 326 specific content-schema is usable with a different other schema 327 depends on many factors including the amount of differences and the 328 compatibility between the original and the other schema, considering 329 modules, revisions, features, deviations, the scope of the instance 330 data, etc. 332 2.1.1. Inline Method 334 One or more inline-module elements define YANG module(s) used to 335 specify the content defining YANG modules. 337 E.g., ietf-yang-library@2016-06-21 339 The anydata inline-schema carries instance data (conforming to the 340 inline-modules) that actually specifies the content defining YANG 341 modules including revision, supported features, deviations and any 342 relevant additional data (e.g., revision labels which can be used as 343 alternative to the revision 344 date[I-D.verdt-netmod-yang-module-versioning]). See Section 2.2. 346 2.1.2. Simplified-Inline Method 348 The instance data set contains a list of content defining YANG 349 modules including the revision date for each. Usage of this method 350 implies that the modules are used without any deviations and with all 351 features supported. 353 2.1.3. URI Method 355 The "same-schema-as-file" leaf SHALL contain a URI that references 356 another YANG instance data file. The current instance data file will 357 use the same content schema as the referenced file. 359 The referenced instance data file MAY have no content-data if it is 360 used solely for specifying the content-schema. 362 If a referenced instance data file is unavailable, content-schema is 363 unknown. 365 The URI method is advantageous when the user wants to avoid the 366 overhead of specifying the content-schema in each instance data file: 367 E.g., In UC6, when the system creates a diagnostic file every minute 368 to document the state of the server. 370 2.2. Examples 372 2.2.1. UC1, Documenting Server Capabilities 374 The example illustrates UC1 Section 1. It provides a list of 375 supported YANG modules and NETCONF capabilities for a server. It 376 uses the "inline" method to specify the content-schema. 378 The example uses artwork folding[I-D.ietf-netmod-artwork-folding]. 380 ========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) =========== 382 383 386 acme-router-modules 387 388 ietf-yang-library@2016-06-21 389 390 392 393 ietf-yang-library 394 2016-06-21 395 396 397 ietf-netconf-monitoring 398 2010-10-04 399 400 401 402 403 404 1956-10-23 405 Initial version 406 407 Defines the minimal set of modules that any \ 408 acme-router will contain. 409 info@acme.com 410 411 413 414 ietf-yang-library 415 2016-06-21 416 \ 417 urn:ietf:params:xml:ns:yang:ietf-yang-library\ 418 419 implement 420 421 422 ietf-system 423 2014-08-06 424 urn:ietf:params:xml:ns:yang:ietf-system 425 sys:authentication 426 sys:local-users 427 428 acme-system-ext 429 2018-08-06 430 431 implement 432 433 434 ietf-netconf-monitoring 435 2010-10-04 436 \ 437 urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\ 438 439 implement 440 441 442 ietf-yang-types 443 2013-07-15 444 urn:ietf:params:xml:ns:yang:ietf-yang-types\ 445 446 import 447 448 449 acme-system-ext 450 2018-08-06 451 urn:rdns:acme.com:oammodel:acme-system-ext\ 452 453 implement 454 455 456 458 459 \ 460 urn:ietf:params:netconf:capability:validate:1.1\ 461 462 463 464 465 467 Figure 1: Documenting server capabilities 469 2.2.2. UC2, Preloading Default Configuration 471 The example illustrates UC2 Section 1. It provides a default rule 472 set for a read-only operator role. It uses the "simplified-inline" 473 method for specifying the content-schema. 475 476 478 read-only-acm-rules 479 480 ietf-netconf-acm@2018-02-14 481 482 483 1776-07-04 484 Initial version 485 486 Access control rules for a read-only role. 487 488 489 true 490 deny 491 deny 492 493 read-only-role 494 read-only-group 495 496 read-all 497 * 498 read 499 permit 500 501 502 503 504 506 Figure 2: Preloading access control data 508 2.2.3. UC5, Storing diagnostics data 510 The example illustrates UC5 Section 1. An instance data set is 511 produced by the server every 15 minutes that contains statistics 512 about the NETCONF server. As a new set is produced periodically many 513 times a day a revision-date would be useless; instead a timestamp is 514 included. 516 { 517 "ietf-yang-instance-data:instance-data-set": { 518 "name": "acme-router-netconf-diagnostics", 519 "content-schema": { 520 "same-schema-as-file": "file:///acme-diagnostics-schema.json" 521 }, 522 "timestamp": "2018-01-25T17:00:38Z", 523 "description": ["NETCONF statistics"], 524 "content-data": { 525 "ietf-netconf-monitoring:netconf-state": { 526 "statistics": { 527 "netconf-start-time ": "2018-12-05T17:45:00Z", 528 "in-bad-hellos ": "32", 529 "in-sessions ": "397", 530 "dropped-sessions ": "87", 531 "in-rpcs ": "8711", 532 "in-bad-rpcs ": "408", 533 "out-rpc-errors ": "408", 534 "out-notifications": "39007" 535 } 536 } 537 } 538 } 539 } 541 Figure 3: Storing diagnostics data 543 3. YANG Instance Data Model 545 3.1. Tree Diagram 547 The following tree diagram [RFC8340] provides an overview of the data 548 model. 550 module: ietf-yang-instance-data 551 structure instance-data-set: 552 +-- name? string 553 +-- format-version? string 554 +-- content-schema 555 | +-- (content-schema-spec)? 556 | +--:(simplified-inline) 557 | | +-- module* string 558 | +--:(inline) {inline-content-schema}? 559 | | +-- inline-module* string 560 | | +-- inline-schema 561 | +--:(uri) 562 | +-- same-schema-as-file? inet:uri 563 +-- description* string 564 +-- contact? string 565 +-- organization? string 566 +-- datastore? ds:datastore-ref 567 +-- revision* [date] 568 | +-- date string 569 | +-- description? string 570 +-- timestamp? yang:date-and-time 571 +-- content-data? 573 3.2. YANG Model 575 This YANG module imports typedefs from [RFC6991], identities from 576 [RFC8342] and the "structure" extension from 577 [I-D.ietf-netmod-yang-data-ext]. 579 file "ietf-yang-instance-data@2020-04-02.yang" 580 module ietf-yang-instance-data { 581 yang-version 1.1; 582 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"; 583 prefix yid; 585 import ietf-yang-structure-ext { 586 prefix sx; 587 reference 588 "YANG Data Structure Extensions: 589 draft-ietf-netmod-yang-data-ext-05"; 590 } 591 import ietf-datastores { 592 prefix ds; 593 reference 594 "RFC 8342: Network Management Datastore Architecture (NMDA)"; 595 } 596 import ietf-inet-types { 597 prefix inet; 598 reference 599 "RFC 6991: Common YANG Data Types"; 600 } 601 import ietf-yang-types { 602 prefix yang; 603 reference 604 "RFC 6991: Common YANG Data Types"; 605 } 607 organization 608 "IETF NETMOD Working Group"; 609 contact 610 "WG Web: 611 WG List: 613 Author: Balazs Lengyel 614 "; 615 description 616 "The module defines the structure and content of YANG 617 instance data sets. 619 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 620 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 621 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document 622 are to be interpreted as described in BCP 14 (RFC 2119) 623 (RFC 8174) when, and only when, they appear in all 624 capitals, as shown here. 626 Copyright (c) 2020 IETF Trust and the persons identified as 627 authors of the code. All rights reserved. 629 Redistribution and use in source and binary forms, with or 630 without modification, is permitted pursuant to, and subject 631 to the license terms contained in, the Simplified BSD License 632 set forth in Section 4.c of the IETF Trust's Legal Provisions 633 Relating to IETF Documents 634 (http://trustee.ietf.org/license-info). 636 This version of this YANG module is part of RFC XXXX; see 637 the RFC itself for full legal notices."; 639 revision 2020-04-02 { 640 description 641 "Initial revision."; 642 reference 643 "RFC XXXX: YANG Instance Data Format"; 644 } 645 feature inline-content-schema { 646 description 647 "This feature indicates that inline content-schema 648 option is supported."; 649 } 651 typedef module-with-revision-date { 652 type string { 653 pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*' + 654 '(@\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1]))?'; 655 pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; 656 } 657 description 658 "A type definining a module name and an optional revision 659 date, e.g. ietf-yang-library@2016-06-21"; 660 } 662 sx:structure "instance-data-set" { 663 description 664 "A data structure to define a format for 665 YANG instance data sets. Consists of meta-data about 666 the instance data set and the real content-data."; 667 leaf name { 668 type string; 669 description 670 "An arbitrary name for the YANG instance data set. This 671 value is primarily used for descriptive purposes. However, 672 when the instance data set is saved to a file, then the 673 filename MUST encode the name's value, per Section 3 674 of RFC XXXX."; 675 } 676 leaf format-version { 677 type string { 678 pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])'; 679 } 680 default "2020-04-02"; 681 description 682 "The 'revision' of the 'ietf-yang-instance-data' module 683 used to encode this 'instance-data-set'."; 684 } 685 container content-schema { 686 description 687 "The content schema used to create the instance data set. 688 If not present the user needs to obtain the information 689 through external documents."; 690 choice content-schema-spec { 691 description 692 "Specification of the content-schema."; 694 case simplified-inline { 695 leaf-list module { 696 type module-with-revision-date; 697 description 698 "The list of content defining YANG modules. 700 The value SHALL start with the module name. 701 If the module contains a revision statement the 702 revision date SHALL be included in the leaf-list 703 entry. If other methods (e.g., revision-label) are 704 defined to identify individual module revisions 705 those MAY be used instead of using a revision date. 707 E.g., ietf-yang-library@2016-06-21 709 Usage of this leaf-list implies the modules are 710 used without any deviations and with all features 711 supported. Multiple revisions of the same module 712 MUST NOT be specified."; 713 } 714 } 715 case inline { 716 if-feature "inline-content-schema"; 717 leaf-list inline-module { 718 type module-with-revision-date; 719 min-elements 1; 720 description 721 "Indicates that content defining YANG modules 722 are specified inline. 724 The value SHALL start with the module name. 725 If the module contains a revision statement the 726 revision date SHALL be included in the leaf-list 727 entry. If other methods (e.g., revision-label) are 728 defined to identify individual module revisions 729 those MAY be used instead of using a revision date. 731 E.g., ietf-yang-library@2016-06-21 733 The first item is either ietf-yang-library or some 734 other YANG module that contains a list of YANG modules 735 with their name, revision-date, supported-features, 736 and deviations. The usage of revision '2019-01-04' 737 of the 'ietf-yang-library' module MUST be supported. 738 Using other modules, module versions MAY also be 739 supported. 741 Some versions of ietf-yang-library MAY contain 742 different module-sets for different datastores. In 743 this case the instance data set MUST contain the 744 'datastore' leaf and instance data for the 745 ietf-yang-library MUST also contain information 746 specifying the module-set for the relevant datastore. 748 Subsequent items MAY specify YANG modules augmenting 749 the first module with useful data 750 (e.g., revision label)."; 751 reference 752 "RFC 8525"; 753 } 754 anydata inline-schema { 755 mandatory true; 756 description 757 "Instance data corresponding to the YANG modules 758 specified in the inline-module nodes defining the set 759 of content defining YANG modules for this 760 instance-data-set."; 761 } 762 } 763 case uri { 764 leaf same-schema-as-file { 765 type inet:uri; 766 description 767 "A reference to another YANG instance data file. 768 This instance data file uses the same 769 content schema as the referenced file."; 770 } 771 } 772 } 773 } 774 leaf-list description { 775 type string; 776 description 777 "Description of the instance data set."; 778 } 779 leaf contact { 780 type string; 781 description 782 "Contact information for the person or 783 organization to whom queries concerning this 784 instance data set should be sent."; 785 } 786 leaf organization { 787 type string; 788 description 789 "Organization responsible for the instance 790 data set."; 791 } 792 leaf datastore { 793 type ds:datastore-ref; 794 description 795 "The identity of the datastore with which the 796 instance data set is associated, e.g., the datastore from 797 where the data was read or the datastore into which the data 798 may be loaded or the datastore which is being documented. 799 If a single specific datastore cannot be specified, the 800 leaf MUST be absent. 802 If this leaf is absent, then the datastore to which the 803 instance data belongs is undefined."; 804 } 805 list revision { 806 key "date"; 807 description 808 "Instance data sets that are produced as 809 a result of some sort of specification or design effort 810 SHOULD have at least one revision entry. For every 811 published editorial change, a new one SHOULD be added 812 in front of the revisions sequence so that all 813 revisions are in reverse chronological order. 815 Instance data sets that are read from 816 or produced by a server or otherwise 817 subject to frequent updates or changes: revision 818 SHOULD NOT be present"; 819 leaf date { 820 type string { 821 pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])'; 822 } 823 description 824 "Specifies the date the instance data set 825 was last modified. Formatted as YYYY-MM-DD"; 826 } 827 leaf description { 828 type string; 829 description 830 "Description of this revision of the instance data set."; 831 } 832 } 833 leaf timestamp { 834 type yang:date-and-time; 835 description 836 "The date and time when the instance data set 837 was last modified. 839 Instance data sets that are read from or produced 840 by a server or otherwise subject to frequent 841 updates or changes: timestamp SHOULD be present"; 842 } 843 anydata content-data { 844 description 845 "Contains the real instance data. 846 The data MUST conform to the relevant YANG modules specified 847 either in the content-schema or in some other 848 implementation specific manner."; 849 } 850 } 851 } 852 854 4. Security Considerations 856 The YANG module defined in this document only defines a wrapper 857 structure specifying a format and a metadata header for YANG instance 858 data defined by the content-schema, so it does not follow the 859 security considerations template for YANG models. The instance data 860 is designed to be accessed as a stored file or over any file access 861 method or protocol. 863 The document does not specify any method to influence the behavior of 864 a server. 866 Instance data files may contain sensitive data. 868 The header part is not security sensitive. 870 The security sensitivity of the instance data in the content part is 871 completely dependent on the content schema. Depending on the nature 872 of the instance data, instance data files MAY need to be handled in a 873 secure way. The same kind of handling should be applied, that would 874 be needed for the result of a read operation returning the same data. 876 Instance data files should be protected against modification or 877 unauthorized access using normal file handling mechanisms. Care 878 should be taken, when copying the original files or providing file 879 access for additional users, not to reveal information 880 unintentionally. 882 5. IANA Considerations 884 This document registers one URI and one YANG module. 886 5.1. URI Registration 888 This document registers one URI in the IETF XML registry [RFC3688]. 889 Following the format in RFC 3688, the following registration is 890 requested to be made: 892 URI: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data 893 Registrant Contact: The IESG. 894 XML: N/A, the requested URI is an XML namespace. 896 5.2. YANG Module Name Registration 898 This document registers one YANG module in the YANG Module Names 899 registry [RFC6020]. 901 name: ietf-yang-instance-data 902 namespace: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data 903 prefix: yid 904 reference: RFC XXXX 906 6. Acknowledgments 908 For their valuable comments, discussions, and feedback, we wish to 909 acknowledge Andy Bierman, Juergen Schoenwaelder, Rob Wilton, Joe 910 Clarke, Kent Watsen Martin Bjorklund, Ladislav Lhotka, Qin Wu and 911 other members of the Netmod WG. 913 7. References 915 7.1. Normative References 917 [I-D.ietf-netmod-yang-data-ext] 918 Bierman, A., Bjorklund, M., and K. Watsen, "YANG Data 919 Structure Extensions", draft-ietf-netmod-yang-data-ext-05 920 (work in progress), December 2019. 922 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 923 Requirement Levels", BCP 14, RFC 2119, 924 DOI 10.17487/RFC2119, March 1997, 925 . 927 [RFC6243] Bierman, A. and B. Lengyel, "With-defaults Capability for 928 NETCONF", RFC 6243, DOI 10.17487/RFC6243, June 2011, 929 . 931 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 932 RFC 6991, DOI 10.17487/RFC6991, July 2013, 933 . 935 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 936 RFC 7950, DOI 10.17487/RFC7950, August 2016, 937 . 939 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 940 RFC 7951, DOI 10.17487/RFC7951, August 2016, 941 . 943 [RFC7952] Lhotka, L., "Defining and Using Metadata with YANG", 944 RFC 7952, DOI 10.17487/RFC7952, August 2016, 945 . 947 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 948 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 949 . 951 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 952 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 953 May 2017, . 955 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 956 and R. Wilton, "Network Management Datastore Architecture 957 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 958 . 960 [RFC8525] Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K., 961 and R. Wilton, "YANG Library", RFC 8525, 962 DOI 10.17487/RFC8525, March 2019, 963 . 965 [RFC8526] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 966 and R. Wilton, "NETCONF Extensions to Support the Network 967 Management Datastore Architecture", RFC 8526, 968 DOI 10.17487/RFC8526, March 2019, 969 . 971 [RFC8527] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 972 and R. Wilton, "RESTCONF Extensions to Support the Network 973 Management Datastore Architecture", RFC 8527, 974 DOI 10.17487/RFC8527, March 2019, 975 . 977 7.2. Informative References 979 [I-D.ietf-netmod-artwork-folding] 980 Watsen, K., Auerswald, E., Farrel, A., and Q. WU, 981 "Handling Long Lines in Inclusions in Internet-Drafts and 982 RFCs", draft-ietf-netmod-artwork-folding-12 (work in 983 progress), January 2020. 985 [I-D.ietf-netmod-factory-default] 986 WU, Q., Lengyel, B., and Y. Niu, "A YANG Data Model for 987 Factory Default Settings", draft-ietf-netmod-factory- 988 default-14 (work in progress), February 2020. 990 [I-D.verdt-netmod-yang-module-versioning] 991 Claise, B., Clarke, J., Rahman, R., Wilton, R., Lengyel, 992 B., Sterne, J., and K. D'Souza, "Updated YANG Module 993 Revision Handling", draft-verdt-netmod-yang-module- 994 versioning-01 (work in progress), October 2019. 996 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 997 DOI 10.17487/RFC3688, January 2004, 998 . 1000 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1001 the Network Configuration Protocol (NETCONF)", RFC 6020, 1002 DOI 10.17487/RFC6020, October 2010, 1003 . 1005 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 1006 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 1007 . 1009 [RFC8632] Vallin, S. and M. Bjorklund, "A YANG Data Model for Alarm 1010 Management", RFC 8632, DOI 10.17487/RFC8632, September 1011 2019, . 1013 [RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications 1014 for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, 1015 September 2019, . 1017 Appendix A. Changes between revisions 1019 Note to RFC Editor (To be removed by RFC Editor) 1021 v09 - v10 1023 o Editorial updates 1025 v08 - v09 1026 o Removed reference to similar to get reply 1028 o Introduced artwork folding in the examples 1030 v07 - v08 1032 o Moved compatibility into appendix 1034 o Renamed yid-version to format-version. Changed format to date of 1035 the YANG module 1037 o Made support of ietf-yang-library mandatory if inline-content- 1038 schema is supported 1040 o Many small changes based on WGLC 1042 v06 - v07 1044 o Updated terminology, use-cases 1046 o Many small changes based on WGLC 1048 v05 - v06 1050 o Modified module name format, removed .yin or .yang extension 1052 o Removed pattern for module and inline-module. The usage of 1053 revision-label should also be allowed. 1055 v04 - v05 1057 o Updated according to YANG-Doctor review 1059 o Updated security considerations 1061 o Added a wrapping container for the schema, and renamed the data 1062 nodes in the inline and uri cases. 1064 o Allowed .yin for simplified-inline schema naming. Made date 1065 optional if it is unavailable in the YANG module. 1067 o Added a mandatory yid-version to the header metadata to allow 1068 later updates of the module. 1070 v03 - v04 1072 o removed entity-tag and last-modified timestamp 1073 o Added simplified-inline method of content-schema specification 1075 v02 - v03 1077 o target renamed to "content-schema" and "content defining YANG 1078 module(s)" 1080 o Made name of instance data set optional 1082 o Updated according to draft-ietf-netmod-yang-data-ext-03 1084 o Clarified that entity-tag and last-modified timestamp are encoded 1085 as metadata. While they contain useful data, the HTTP-header 1086 based encoding from Restconf is not suitable. 1088 v01 - v02 1090 o Removed design time from terminology 1092 o Defined the format of the content-data part by referencing various 1093 RFCs and drafts instead of the result of the get-data and get 1094 operations. 1096 o Changed target-ptr to a choice 1098 o Inline target-ptr may include augmenting modules and alternatives 1099 to ietf-yang-library 1101 o Moved list of target modules into a separate 1102 element. 1104 o Added backwards compatibility considerations 1106 v00 - v01 1108 o Added the target-ptr metadata with 3 methods 1110 o Added timestamp metadata 1112 o Removed usage of dedicated .yid file extension 1114 o Added list of use cases 1116 o Added list of principles 1118 o Updated examples 1120 o Moved detailed use case descriptions to appendix 1122 Appendix B. Backwards Compatibility 1124 The concept of backwards compatibility and what changes are backwards 1125 compatible are not defined for instance data sets as it is highly 1126 dependent on the specific use case and the content-schema. 1128 For instance data that is the result of a design or specification 1129 activity, some changes that may be good to avoid are listed below. 1131 YANG uses the concept of managed entities identified by key values; 1132 if the connection between the represented entity and the key value is 1133 not preserved during an update, this may lead to the following 1134 problems. 1136 o If the key value of a list entry that represents the same managed 1137 entity as before is changed, the user may mistakenly identify the 1138 list entry as new. 1140 o If the meaning of a list entry is changed, but the key values are 1141 not (e.g., redefining an alarm-type but not changing its alarm- 1142 type-id) the change may not be noticed. 1144 o If the key value of a previously removed list entry is reused for 1145 a different entity, the change may be misinterpreted as 1146 reintroducing the previous entity. 1148 Appendix C. Detailed Use Cases 1150 This section is non-normative. 1152 C.1. Use Case 1: Early Documentation of Server Capabilities 1154 A server has a number of server-capabilities that are defined in YANG 1155 modules and can be retrieved from the server using protocols like 1156 NETCONF or RESTCONF. Server capabilities include: 1158 o data defined in "ietf-yang-library": YANG modules, submodules, 1159 features, deviations, schema-mounts, and datastores supported 1160 ([RFC8525]) 1162 o alarms supported ([RFC8632]) 1164 o data nodes and subtrees that support or do not support on-change 1165 notifications ([RFC8641]) 1167 o netconf-capabilities in ietf-netconf-monitoring 1168 While it is good practice to allow a client to query these 1169 capabilities from the live server, that is often not possible. 1171 Often when a network node is released, an associated NMS (network 1172 management system) is also released with it. The NMS depends on the 1173 capabilities of the server. During NMS implementation, information 1174 about server capabilities is needed. If the information is 1175 unavailable early in some offline document, but only as instance data 1176 from the live network node, the NMS implementation will be delayed, 1177 because it has to wait until the network node is ready. Also 1178 assuming that all NMS implementors will have a correctly configured 1179 network nodes from which data can be retrieved, is a very expensive 1180 proposition. (An NMS may handle dozens of node types.) 1182 Network operators often build their own home-grown NMS systems that 1183 need to be integrated with a vendor's network node. The operator 1184 needs to know the network node's server capabilities in order to do 1185 this. Moreover, the network operator's decision to buy a vendor's 1186 product may even be influenced by the network node's OAM feature set 1187 documented as the server's capabilities. 1189 Beside NMS implementors, system integrators and many others also need 1190 the same information early. Examples could be model driven testing, 1191 generating documentation, etc. 1193 Most server-capabilities are relatively stable and change only during 1194 upgrade or due to licensing or the addition or removal of hardware. 1195 They are usually defined by a vendor at design time, before the 1196 product is released. It is feasible and advantageous to define/ 1197 document them early e.g., in a YANG instance data File. 1199 It is anticipated that a separate IETF document will define in detail 1200 how and which set of server capabilities should be documented. 1202 C.2. Use Case 2: Preloading Data 1204 There are parts of the configuration that must be fully configurable 1205 by the operator. However, often a simple default configuration will 1206 be sufficient. 1208 One example is access control groups/roles and related rules. While 1209 a sophisticated operator may define dozens of different groups, often 1210 a basic (read-only operator, read-write system administrator, 1211 security-administrator) triplet will be enough. Vendors will often 1212 provide such default configuration data to make device configuration 1213 easier for an operator. 1215 Defining access control data is a complex task. To help, the device 1216 vendor predefines a set of default groups (/nacm:nacm/groups) and 1217 rules for these groups to access specific parts of common models 1218 (/nacm:nacm/rule-list/rule). 1220 YANG instance data files are used to document and/or preload the 1221 default configuration. 1223 C.3. Use Case 3: Documenting Factory Default Settings 1225 Nearly every server has a factory default configuration. If the 1226 system is really badly misconfigured or if the current configuration 1227 is to be abandoned, the system can be reset the default factory 1228 configuration. 1230 In NETCONF, the operation can already be used to 1231 reset the startup datastore. There are ongoing efforts to introduce 1232 a new, more generic factory-reset operation for the same purpose 1233 [I-D.ietf-netmod-factory-default] 1235 The operator currently has no way to know what the default 1236 configuration actually contains. YANG instance data can also be used 1237 to document the factory default configuration. 1239 Authors' Addresses 1241 Balazs Lengyel 1242 Ericsson 1243 Magyar Tudosok korutja 11 1244 1117 Budapest 1245 Hungary 1247 Phone: +36-70-330-7909 1248 Email: balazs.lengyel@ericsson.com 1250 Benoit Claise 1251 Cisco Systems, Inc. 1252 De Kleetlaan 6a b1 1253 1831 Diegem 1254 Belgium 1256 Phone: +32 2 704 5622 1257 Email: bclaise@cisco.com