idnits 2.17.1 draft-ietf-netmod-yang-instance-file-format-19.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: ---------------------------------------------------------------------------- == There is 1 instance of lines with non-ascii characters in the document. 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 (16 September 2021) is 947 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) No issues found here. 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: 20 March 2022 Huawei 6 16 September 2021 8 YANG Instance Data File Format 9 draft-ietf-netmod-yang-instance-file-format-19 11 Abstract 13 There is a need to document data defined in YANG models at design 14 time, implementation time or when a live server is unavailable. This 15 document specifies a standard file format for YANG instance data, 16 which follows the syntax and semantics of existing YANG models, and 17 annotates it with metadata. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on 20 March 2022. 36 Copyright Notice 38 Copyright (c) 2021 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 43 license-info) in effect on the date of publication of this document. 44 Please review these documents carefully, as they describe your rights 45 and restrictions with respect to this document. Code Components 46 extracted from this document must include Simplified BSD License text 47 as described in Section 4.e of the Trust Legal Provisions and are 48 provided without warranty as described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.2. Principles . . . . . . . . . . . . . . . . . . . . . . . 4 55 1.3. Delivery of Instance Data . . . . . . . . . . . . . . . . 4 56 1.4. Data Life cycle . . . . . . . . . . . . . . . . . . . . . 5 57 2. Instance Data File Format . . . . . . . . . . . . . . . . . . 5 58 2.1. Specifying the Content Schema . . . . . . . . . . . . . . 7 59 2.1.1. Inline Method . . . . . . . . . . . . . . . . . . . . 7 60 2.1.2. Simplified-Inline Method . . . . . . . . . . . . . . 8 61 2.1.3. URI Method . . . . . . . . . . . . . . . . . . . . . 8 62 2.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8 63 2.2.1. Documentation of server capabilities . . . . . . . . 8 64 2.2.2. Preloading default configuration data . . . . . . . . 10 65 2.2.3. Storing diagnostics data . . . . . . . . . . . . . . 11 66 3. YANG Instance Data Model . . . . . . . . . . . . . . . . . . 12 67 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 12 68 3.2. YANG Model . . . . . . . . . . . . . . . . . . . . . . . 13 69 4. Security Considerations . . . . . . . . . . . . . . . . . . . 19 70 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 71 5.1. URI Registration . . . . . . . . . . . . . . . . . . . . 20 72 5.2. YANG Module Name Registration . . . . . . . . . . . . . . 20 73 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20 74 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 75 7.1. Normative References . . . . . . . . . . . . . . . . . . 20 76 7.2. Informative References . . . . . . . . . . . . . . . . . 22 77 Appendix A. Changes between revisions . . . . . . . . . . . . . 23 78 Appendix B. Backwards Compatibility . . . . . . . . . . . . . . 26 79 Appendix C. Detailed Use Cases . . . . . . . . . . . . . . . . . 26 80 C.1. Use Case 1: Early Documentation of Server Capabilities . 26 81 C.2. Use Case 2: Preloading Data . . . . . . . . . . . . . . . 27 82 C.3. Use Case 3: Documenting Factory Default Settings . . . . 28 83 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 85 1. Introduction 87 There is a need to document data defined in YANG models when a live 88 server is unavailable. Data is often needed at design, 89 implementation time or when a live running server is unavailable. To 90 facilitate this offline delivery of data, this document specifies a 91 standard format for YANG instance data sets and YANG instance data 92 files. The format of the instance data set is defined by the "ietf- 93 yang-instance-data" YANG module, see Section 3. The YANG data model 94 in this document conforms to the Network Management Datastore 95 Architecture (NMDA) defined in [RFC8342] 96 The following is a list of already implemented and potential use 97 cases. 99 UC1 Documentation of server capabilities 101 UC2 Preloading default configuration data 103 UC3 Documenting Factory Default Settings 105 UC4 Storing the configuration of a device, e.g., for backup, archive 106 or audit purposes 108 UC5 Storing diagnostics data 110 UC6 Allowing YANG instance data to potentially be carried within 111 other IPC message formats 113 UC7 Default instance data used as part of a templating solution 115 UC8 Providing data examples in RFCs or internet drafts 117 In Appendix C describes the first three use cases in detail. 119 There are many and varied use cases where YANG instance data could be 120 used. This document does not limit future uses of instance data 121 sets, so specifying how and when to use YANG instance data is out of 122 scope for this document. It is anticipated that other documents will 123 define specific use cases. Use cases are listed only as examples. 125 1.1. Terminology 127 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 128 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 129 "OPTIONAL" in this document are to be interpreted as described in BCP 130 14 [RFC2119] [RFC8174] when, and only when, they appear in all 131 capitals, as shown here. 133 Instance Data: A collection of instantiated data nodes. 135 Instance Data Set: A named set of data items annotated with metadata 136 that can be used as instance data in a YANG data tree. 138 Instance Data File: A file containing an instance data set formatted 139 according to the rules described in this document. 141 Content-schema: A set of YANG modules with their revision, supported 142 features, and deviations for which the instance data set contains 143 instance data. 145 Content defining YANG module: an individual YANG module that is part 146 of the content-schema. 148 The term "server" is used as defined in [RFC8342]. 150 1.2. 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 2, Paragraph 12) 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 implemented by a server. 176 P8 It shall be possible to report the identity of the datastore with 177 which the instance data set is associated. 179 1.3. Delivery of Instance Data 181 Instance data sets that are produced as a result of some sort of 182 specification or design effort may be available without the need for 183 a live server e.g., via download from the vendor's website, or in any 184 other way that product documentation is distributed. 186 Other instance data sets may be read from or produced by the YANG 187 server itself e.g., UC5 documenting diagnostic data. 189 1.4. Data Life cycle 191 A YANG instance data set is created at a specific point of time. If 192 the data changes afterwards, this is not represented in the instance 193 data set anymore. The current values may be retrieved at run-time 194 via NETCONF/RESTCONF or received e.g., in YANG-Push notifications. 196 Whether the instance data changes and if so, when and how, should be 197 described either in the instance data set's description statement or 198 in some other implementation specific manner. 200 2. Instance Data File Format 202 A YANG instance data file MUST contain a single instance data set and 203 no additional data. 205 The format of the instance data set is defined by the "ietf-yang- 206 instance-data" YANG module. It is made up of a header part and 207 content-data. The header part carries metadata for the instance data 208 set. The content-data, defined as an anydata data node, carries the 209 instance data that the user wants to document/provide. The syntax 210 and semantics of content-data is defined by the content-schema. 212 Two formats are specified based on the XML and JSON YANG encodings. 213 Later, as other YANG encodings (e.g., CBOR) are defined, further 214 instance data formats may be specified. 216 The content-data part MUST conform to the content-schema, while 217 allowing for the exceptions listed below. The content-data part 218 SHALL follow the encoding rules defined in [RFC7950] for XML and 219 [RFC7951] for JSON and MUST use UTF-8 character encoding. Content- 220 data MAY include: 222 * metadata, as defined by [RFC7952]. 224 * origin metadata, as specified in [RFC8526] and [RFC8527] 226 * implementation specific metadata relevant to individual data 227 nodes. Unknown metadata MUST be ignored by users of instance 228 data, allowing it to be used later for other purposes. 230 An instance data set MAY contain data for any number of YANG modules; 231 if needed it MAY carry the complete configuration and state data for 232 a server. Default values should be excluded where they do not 233 provide additional useful data. 235 Configuration ("config true") and operational state data ("config 236 false") MAY be mixed in the instance data file. 238 Instance data files MAY contain partial data sets. This means 239 "mandatory", "min-elements", "require-instance true", "must" and 240 "when" constrains MAY be violated. 242 The name of the instance data file SHOULD be of the form: 244 instance-data-set-name ['@' ( revision-date / timestamp ) ] 245 ( '.xml' / '.json' ) 247 E.g., acme-router-modules.xml 248 E.g., acme-router-modules@2018-01-25.xml 249 E.g., acme-router-modules@2018-01-25T15_06_34_3+01_00.json 251 If the leaf "name" is present in the instance data header, its value 252 SHOULD be used for the "instance-data-set-name". If the "revision- 253 date" is present in the filename it MUST conform to the format of the 254 revision-date leaf in the YANG model. If the "revision-date" is 255 present in both the filename and in the instance data header, the 256 revision date in the file name MUST be set to the latest revision 257 date inside the instance data set. If the "timestamp" is present in 258 the filename it MUST conform to the format of the timestamp leaf in 259 the YANG model except for replacing colons as described below. If 260 the "timestamp" is present both in the filename and in the instance 261 data header, the timestamp in the file name SHOULD be set to the 262 timestamp inside the instance data set; any colons, if present, shall 263 be replaced by underscores. 265 Metadata, information about the data set itself SHOULD be included in 266 the instance data set. Some metadata items are defined in the YANG 267 module "ietf-yang-instance-data", but other items MAY be used. 269 Metadata MUST include: 271 - Version of the YANG Instance Data format 273 Metadata SHOULD include: 275 - Name of the data set 277 - Content schema specification (i.e., the "content-schema" node) 279 - Description of the instance data set. The description SHOULD 280 contain information whether and how the data can change during 281 the lifetime of the server 283 - An indication whether default values are included. The default 284 handling uses the concepts defined in [RFC6243], however as 285 only concepts are re-used, users of instance data sets, do not 286 need to support RFC 6243. 288 2.1. Specifying the Content Schema 290 To properly understand and use an instance data set, the user needs 291 to know the content-schema. One of the following methods SHOULD be 292 used: 294 Simplified-Inline method: Include the needed information as part 295 of the instance data set; short specification. 297 Inline method: Include the needed information as part of the 298 instance data set. 300 URI method: Include a URI that references another YANG instance 301 data file. This instance data file will use the same content- 302 schema as the referenced YANG instance data file. (if you don't 303 want to repeat the info again and again) 305 External Method: Do not include the "content-schema" node; the 306 user needs to obtain the information through external documents. 308 Additional methods e.g., a YANG-package based solution may be added 309 later. 311 Note, the specified content-schema only indicates the set of modules 312 that were used to define this YANG instance data set. Sometimes 313 instance data may be used for a server supporting a different YANG 314 module set (e.g., for the "Preloading default configuration data" 315 use-case, UC2 in Section 1, the instance data set may not be updated 316 every time the YANG modules on the server are updated). Whether an 317 instance data set originally defined using a specific content-schema 318 is usable with a different other schema depends on many factors 319 including the amount of differences and the compatibility between the 320 original and the other schema, considering modules, revisions, 321 features, deviations, the scope of the instance data, etc. 323 2.1.1. Inline Method 325 The inline-yang-library anydata data node carries instance data 326 (conforming to ietf-yang-library@2019-01-04) that specifies the 327 content defining YANG modules including revision, supported features, 328 deviations and any relevant additional data. An example of the 329 "inline" method is provided in Figure 1. 331 2.1.2. Simplified-Inline Method 333 The instance data set contains a list of content defining YANG 334 modules including the revision date for each. Usage of this method 335 implies that the modules are used without any deviations and with all 336 features supported. YANG modules that are only required to satisfy 337 import-only dependencies MAY be excluded from the leaf-list. If they 338 are excluded then the consumer of the instance data set has to apply 339 the YANG language rules to resolve the imports. An example of the 340 "simplified-inline" method is provided in Figure 2. 342 2.1.3. URI Method 344 The "same-schema-as-file" leaf SHALL contain a URI that references 345 another YANG instance data file. The current instance data file will 346 use the same content schema as the referenced file. 348 The referenced instance data file MAY have no content-data if it is 349 used solely for specifying the content-schema. 351 If a referenced instance data file is unavailable, content-schema is 352 unknown. 354 The URI method is advantageous when the user wants to avoid the 355 overhead of specifying the content-schema in each instance data file: 356 E.g., In UC6, when the system creates a diagnostic file every minute 357 to document the state of the server. 359 An example of the "URI" method is provided in Figure 3. 361 2.2. Examples 363 2.2.1. Documentation of server capabilities 365 The example file acme-router-modules@2021-09-16.xml reflects UC1 in 366 Section 1. It provides a list of supported YANG modules and NETCONF 367 capabilities for a server. It uses the "inline" method to specify 368 the content-schema. 370 The example uses artwork folding [RFC8792]. 372 ========== NOTE: '\' line wrapping per RFC 8792 =========== 374 375 377 acme-router-modules 378 379 380 382 383 ietf-yang-library 384 2019-01-04 385 386 387 ietf-netconf-monitoring 388 2010-10-04 389 390 391 392 393 394 1956-10-23 395 Initial version 396 397 Defines the minimal set of modules that any \ 398 acme-router will contain. 399 info@acme.com 400 401 403 404 ietf-yang-library 405 2019-01-04 406 \ 407 urn:ietf:params:xml:ns:yang:ietf-yang-library\ 408 409 implement 410 411 412 ietf-system 413 2014-08-06 414 urn:ietf:params:xml:ns:yang:ietf-system 415 sys:authentication 416 sys:local-users 417 418 acme-system-ext 419 2018-08-06 420 421 implement 422 423 424 ietf-netconf-monitoring 425 2010-10-04 426 \ 427 urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\ 428 429 implement 430 431 432 ietf-yang-types 433 2013-07-15 434 urn:ietf:params:xml:ns:yang:ietf-yang-types\ 435 436 import 437 438 439 acme-system-ext 440 2018-08-06 441 urn:rdns:acme.com:oammodel:acme-system-ext\ 442 443 implement 444 445 446 448 449 \ 450 urn:ietf:params:netconf:capability:validate:1.1\ 451 452 453 454 455 457 Figure 1 459 2.2.2. Preloading default configuration data 461 The example file read-only-acm-rules@2021-09-16.xml reflects UC2 in 462 Section 1. It provides a default rule set for a read-only operator 463 role. It uses the "simplified-inline" method for specifying the 464 content-schema. 466 467 469 read-only-acm-rules 470 471 ietf-netconf-acm@2018-02-14 472 473 474 1776-07-04 475 Initial version 476 477 Access control rules for a read-only role. 478 479 480 true 481 deny 482 deny 483 484 read-only-role 485 read-only-group 486 487 read-all 488 * 489 read 490 permit 491 492 493 494 495 497 Figure 2 499 2.2.3. Storing diagnostics data 501 The example file acme-router-netconf- 502 diagnostics@2018-01-25T17_00_38Z.json reflects UC5 in Section 1. An 503 instance data set is produced by the server every 15 minutes that 504 contains statistics about the NETCONF server. As a new set is 505 produced periodically many times a day a revision-date would be 506 useless; instead a timestamp is included. 508 { 509 "ietf-yang-instance-data:instance-data-set": { 510 "name": "acme-router-netconf-diagnostics", 511 "content-schema": { 512 "same-schema-as-file": "file:///acme-diagnostics-schema.json" 513 }, 514 "timestamp": "2018-01-25T17:00:38Z", 515 "description": ["NETCONF statistics"], 516 "content-data": { 517 "ietf-netconf-monitoring:netconf-state": { 518 "statistics": { 519 "netconf-start-time ": "2018-12-05T17:45:00Z", 520 "in-bad-hellos ": "32", 521 "in-sessions ": "397", 522 "dropped-sessions ": "87", 523 "in-rpcs ": "8711", 524 "in-bad-rpcs ": "408", 525 "out-rpc-errors ": "408", 526 "out-notifications": "39007" 527 } 528 } 529 } 530 } 531 } 533 Figure 3 535 3. YANG Instance Data Model 537 3.1. Tree Diagram 539 The following tree diagram [RFC8340] provides an overview of the data 540 model. 542 module: ietf-yang-instance-data 544 structure instance-data-set: 545 +-- name? string 546 +-- format-version? string 547 +-- includes-defaults? enumeration 548 +-- content-schema 549 | +-- (content-schema-spec)? 550 | +--:(simplified-inline) 551 | | +-- module* module-with-revision-date 552 | +--:(inline) 553 | | +-- inline-yang-library 554 | +--:(uri) 555 | +-- same-schema-as-file? inet:uri 556 +-- description* string 557 +-- contact? string 558 +-- organization? string 559 +-- datastore? ds:datastore-ref 560 +-- revision* [date] 561 | +-- date string 562 | +-- description? string 563 +-- timestamp? yang:date-and-time 564 +-- content-data? 566 3.2. YANG Model 568 This YANG module imports typedefs from [RFC6991], [RFC6243], 569 identities from [RFC8342] and the "structure" extension from 570 [RFC8791]. It also references [RFC8525]. 572 file "ietf-yang-instance-data@2021-09-16.yang" 573 // RFC Ed.: replace the date above if the module gets changed in 574 //anyway during reviews or RFC editor process and remove this note 575 module ietf-yang-instance-data { 576 yang-version 1.1; 577 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"; 578 prefix yid; 580 import ietf-yang-structure-ext { 581 prefix sx; 582 reference 583 "YANG Data Structure Extensions: 584 draft-ietf-netmod-yang-data-ext-05"; 585 } 586 import ietf-datastores { 587 prefix ds; 588 reference 589 "RFC 8342: Network Management Datastore Architecture (NMDA)"; 591 } 592 import ietf-inet-types { 593 prefix inet; 594 reference 595 "RFC 6991: Common YANG Data Types"; 596 } 597 import ietf-yang-types { 598 prefix yang; 599 reference 600 "RFC 6991: Common YANG Data Types"; 601 } 603 import ietf-netconf-with-defaults { 604 prefix ncwd; 605 reference 606 "RFC 6243: With-defaults Capability for NETCONF"; 607 } 609 organization 610 "IETF NETMOD Working Group"; 611 contact 612 "WG Web: 613 WG List: 615 Author: Balazs Lengyel 616 618 Author: Benoit Claise 619 "; 620 description 621 "The module defines the structure and content of YANG 622 instance data sets. 624 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 625 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 626 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document 627 are to be interpreted as described in BCP 14 (RFC 2119) 628 (RFC 8174) when, and only when, they appear in all 629 capitals, as shown here. 631 Copyright (c) 2021 IETF Trust and the persons identified as 632 authors of the code. All rights reserved. 634 Redistribution and use in source and binary forms, with or 635 without modification, is permitted pursuant to, and subject 636 to the license terms contained in, the Simplified BSD License 637 set forth in Section 4.c of the IETF Trust's Legal Provisions 638 Relating to IETF Documents 639 (http://trustee.ietf.org/license-info). 641 This version of this YANG module is part of RFC XXXX; see 642 the RFC itself for full legal notices."; 643 // RFC Ed.: replace XXXX with RFC number and remove this note 645 revision 2021-09-16 { 646 // RFC Ed.: replace the date above if the module gets changed in 647 // anyway during reviews or RFC editor process and remove 648 //this note 649 description 650 "Initial revision."; 651 reference 652 "RFC XXXX: YANG Instance Data Format"; 653 // RFC Ed.: replace XXXX with RFC number and remove this note 654 } 656 typedef module-with-revision-date { 657 type string { 658 pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*' 659 + '(@\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1]))?'; 660 pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; 661 } 662 description 663 "A type defining a module name and an optional revision 664 date, e.g. ietf-yang-library@2019-01-04"; 665 } 667 sx:structure "instance-data-set" { 668 description 669 "A data structure to define a format for YANG instance 670 data. The majority of the YANG nodes provide meta-data 671 about the instance data; the instance data itself is 672 is contained only in the 'content-data' node."; 673 leaf name { 674 type string; 675 description 676 "An arbitrary name for the YANG instance data set. This 677 value is primarily used for descriptive purposes. However, 678 when the instance data set is saved to a file, then the 679 filename MUST encode the name's value, per Section 3 680 of RFC XXXX."; 681 // RFC Ed.: replace XXXX with RFC number and remove this note 682 } 683 leaf format-version { 684 type string { 685 pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])'; 686 } 687 default "2021-09-16"; 688 // RFC Ed.: replace the date above if the module gets changed 689 // in anyway during reviews or RFC editor process and remove 690 // this note 691 description 692 "The 'revision' of the 'ietf-yang-instance-data' module 693 used to encode this 'instance-data-set'."; 694 } 695 leaf includes-defaults { 696 type ncwd:with-defaults-mode; 697 default report-all; 698 description " 699 Indicates how data nodes with default values are 700 represented for all data nodes contained in the 701 instance-data-set. 703 It uses the same definitions as per section 3 of RFC 6243, 704 but applied in the context of an instance data file rather 705 than a NETCONF request using the 706 parameter. 708 For JSON files, the encoding of the 'report-all-tagged' 709 option is as defined in section 4.8.9 of RFC 8040."; 710 reference "With-defaults Capability for NETCONF, RFC 6243."; 711 } 712 container content-schema { 713 description 714 "The content schema (i.e., YANG modules) used to create 715 the instance data set. 716 If not present the user needs to obtain the information 717 through external documents."; 718 choice content-schema-spec { 719 description 720 "Specification of the content-schema."; 721 case simplified-inline { 722 leaf-list module { 723 type module-with-revision-date; 724 min-elements 1; 725 description 726 "The list of content defining YANG modules. 728 The value SHALL start with the module name. 729 If the module contains a revision statement the 730 revision date SHALL be included in the leaf-list 731 entry. 733 E.g., ietf-yang-library@2019-01-04 734 Usage of this leaf-list implies the modules are 735 used without any deviations and with all features 736 supported. Multiple revisions of the same module 737 MUST NOT be specified."; 738 } 739 } 740 case inline { 741 anydata inline-yang-library { 742 mandatory true; 743 description 744 "Instance data corresponding to the 745 ietf-yang-library@2019-01-04 defining 746 the set of content defining YANG modules for 747 this instance-data-set."; 748 } 749 } 750 case uri { 751 leaf same-schema-as-file { 752 type inet:uri; 753 description 754 "A reference to another YANG instance data file. 755 This instance data file uses the same 756 content schema as the referenced file. 758 Referenced files using the 'inline' or the 759 'simplified-inline' methods MUST be supported. 760 Referenced files using the 'URI Method' MAY be 761 supported. 763 The URL schemes 'file://' and 'https://' MUST 764 be supported, other schemes MAY also be 765 supported."; 766 } 767 } 768 } 769 } 770 leaf-list description { 771 type string; 772 description 773 "Description of the instance data set."; 774 } 775 leaf contact { 776 type string; 777 description 778 "Contact information for the person or 779 organization to whom queries concerning this 780 instance data set should be sent."; 781 } 782 leaf organization { 783 type string; 784 description 785 "Organization responsible for the instance 786 data set."; 787 } 788 leaf datastore { 789 type ds:datastore-ref; 790 description 791 "The identity of the datastore with which the 792 instance data set is associated, e.g., the datastore from 793 where the data was read or the datastore into which the data 794 may be loaded or the datastore which is being documented. 795 If a single specific datastore cannot be specified, the 796 leaf MUST be absent. 798 If this leaf is absent, then the datastore to which the 799 instance data belongs is unspecified."; 800 } 801 list revision { 802 key "date"; 803 description 804 "Instance data sets that are produced as 805 a result of some sort of specification or design effort 806 SHOULD have at least one revision entry. For every 807 published editorial change, a new unique revision SHOULD 808 be added in front of the revisions sequence so that all 809 revisions are in reverse chronological order. 811 In case of instance data sets that are read from 812 or produced by a server or otherwise subject to 813 frequent updates or changes, revision 814 SHOULD NOT be present"; 815 leaf date { 816 type string { 817 pattern '\d{4}-(1[0-2]|0[1-9])-(0[1-9]|[1|2][0-9]|3[0-1])'; 818 } 819 description 820 "Specifies the date the instance data set 821 was last modified. Formatted as YYYY-MM-DD"; 822 } 823 leaf description { 824 type string; 825 description 826 "Description of this revision of the instance data set."; 827 } 828 } 829 leaf timestamp { 830 type yang:date-and-time; 831 description 832 "The date and time when the instance data set 833 was last modified. 835 In case of instance data sets that are read from or 836 produced by a server or otherwise subject to frequent 837 updates or changes, timestamp SHOULD be present. 839 If both a revision list entry and timestamp are present 840 the timestamp SHOULD contain the same date as the 841 latest revision statement."; 842 } 843 anydata content-data { 844 description 845 "Contains the real instance data. 846 The data MUST conform to the relevant YANG modules 847 specified 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. Because of this the security 859 considerations template for YANG models in section 3.7.1 in [RFC8407] 860 is not followed. The instance data is designed to be accessed as a 861 stored file or over any file access 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 with one possible 869 exception. If the URI method is used for specification of the 870 content schema and the URI includes a username and/or a password, the 871 instance data file needs to be handled in a secure way as mentioned 872 below. 874 The security sensitivity of the instance data in the content part is 875 completely dependent on the content schema. Depending on the nature 876 of the instance data, instance data files MAY need to be handled 877 securely. The same kind of handling should be applied, that would be 878 needed for the result of a read operation returning the same data. 880 Instance data files should be protected against modification or 881 unauthorized access using normal file handling mechanisms. Care 882 should be taken, when copying the original files or providing file 883 access for additional users, not to reveal information 884 unintentionally. 886 5. IANA Considerations 888 This document registers one URI and one YANG module. 890 5.1. URI Registration 892 This document registers one URI in the IETF XML registry [RFC3688]. 893 Following the format in RFC 3688, the following registration is 894 requested to be made: 896 URI: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data 897 Registrant Contact: The IESG. 898 XML: N/A, the requested URI is an XML namespace. 900 5.2. YANG Module Name Registration 902 This document registers one YANG module in the YANG Module Names 903 registry [RFC6020]. Following the format in [RFC6020], the following 904 registrations are requested: 906 name: ietf-yang-instance-data 907 namespace: urn:ietf:params:xml:ns:yang:ietf-yang-instance-data 908 prefix: yid 909 reference: RFC XXXX 910 // RFC Ed.: replace XXXX with RFC number and remove this note 912 6. Acknowledgments 914 For their valuable comments, discussions, and feedback, we wish to 915 acknowledge Andy Bierman, Juergen Schoenwaelder, Rob Wilton, Joe 916 Clarke, Kent Watsen Martin Bjorklund, Ladislav Lhotka, Qin Wu and 917 other members of the Netmod WG. 919 7. References 921 7.1. Normative References 923 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 924 Requirement Levels", BCP 14, RFC 2119, 925 DOI 10.17487/RFC2119, March 1997, 926 . 928 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 929 the Network Configuration Protocol (NETCONF)", RFC 6020, 930 DOI 10.17487/RFC6020, October 2010, 931 . 933 [RFC6243] Bierman, A. and B. Lengyel, "With-defaults Capability for 934 NETCONF", RFC 6243, DOI 10.17487/RFC6243, June 2011, 935 . 937 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 938 RFC 6991, DOI 10.17487/RFC6991, July 2013, 939 . 941 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 942 RFC 7950, DOI 10.17487/RFC7950, August 2016, 943 . 945 [RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", 946 RFC 7951, DOI 10.17487/RFC7951, August 2016, 947 . 949 [RFC7952] Lhotka, L., "Defining and Using Metadata with YANG", 950 RFC 7952, DOI 10.17487/RFC7952, August 2016, 951 . 953 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 954 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 955 May 2017, . 957 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 958 and R. Wilton, "Network Management Datastore Architecture 959 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 960 . 962 [RFC8525] Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K., 963 and R. Wilton, "YANG Library", RFC 8525, 964 DOI 10.17487/RFC8525, March 2019, 965 . 967 [RFC8526] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 968 and R. Wilton, "NETCONF Extensions to Support the Network 969 Management Datastore Architecture", RFC 8526, 970 DOI 10.17487/RFC8526, March 2019, 971 . 973 [RFC8527] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 974 and R. Wilton, "RESTCONF Extensions to Support the Network 975 Management Datastore Architecture", RFC 8527, 976 DOI 10.17487/RFC8527, March 2019, 977 . 979 [RFC8791] Bierman, A., Björklund, M., and K. Watsen, "YANG Data 980 Structure Extensions", RFC 8791, DOI 10.17487/RFC8791, 981 June 2020, . 983 7.2. Informative References 985 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 986 DOI 10.17487/RFC3688, January 2004, 987 . 989 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 990 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 991 . 993 [RFC8407] Bierman, A., "Guidelines for Authors and Reviewers of 994 Documents Containing YANG Data Models", BCP 216, RFC 8407, 995 DOI 10.17487/RFC8407, October 2018, 996 . 998 [RFC8632] Vallin, S. and M. Bjorklund, "A YANG Data Model for Alarm 999 Management", RFC 8632, DOI 10.17487/RFC8632, September 1000 2019, . 1002 [RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications 1003 for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, 1004 September 2019, . 1006 [RFC8792] Watsen, K., Auerswald, E., Farrel, A., and Q. Wu, 1007 "Handling Long Lines in Content of Internet-Drafts and 1008 RFCs", RFC 8792, DOI 10.17487/RFC8792, June 2020, 1009 . 1011 [RFC8808] Wu, Q., Lengyel, B., and Y. Niu, "A YANG Data Model for 1012 Factory Default Settings", RFC 8808, DOI 10.17487/RFC8808, 1013 August 2020, . 1015 Appendix A. Changes between revisions 1017 RFC Ed.: Remove section "Changes between revisions" 1019 v18 - v19 1021 * Updated leaf includes-defaults 1023 v17 - v18 1025 * Added the report-all-tagged mode to the leaf includes-defaults 1027 v16 - v17 1029 * Removed default statement from includes-default 1031 v15 - v16 1033 * Editorial changes 1035 v14 - v15 1037 * Removed reference to revision-label 1039 * For the inline method made the usage of ietf-yang- 1040 library@2019-01-04 mandatory. Simplified the case "inline" in the 1041 YANG module. 1043 * Removed the "inline-module" leaf as it does not carry useful 1044 information anymore. 1046 * Removed YANG feature 1048 v13 - v14 1050 * Added leaf includes-defaults 1052 * Many small changes based on AD review 1054 v09 - v13 1056 * Editorial updates 1058 v08 - v09 1060 * Removed reference to similar to get reply 1062 * Introduced artwork folding in the examples 1063 v07 - v08 1065 * Moved compatibility into appendix 1067 * Renamed yid-version to format-version. Changed format to date of 1068 the YANG module 1070 * Made support of ietf-yang-library mandatory if inline-content- 1071 schema is supported 1073 * Many small changes based on WGLC 1075 v06 - v07 1077 * Updated terminology, use-cases 1079 * Many small changes based on WGLC 1081 v05 - v06 1083 * Modified module name format, removed .yin or .yang extension 1085 * Removed pattern for module and inline-module. The usage of 1086 revision-label should also be allowed. 1088 v04 - v05 1090 * Updated according to YANG-Doctor review 1092 * Updated security considerations 1094 * Added a wrapping container for the schema, and renamed the data 1095 nodes in the inline and uri cases. 1097 * Allowed .yin for simplified-inline schema naming. Made date 1098 optional if it is unavailable in the YANG module. 1100 * Added a mandatory yid-version to the header metadata to allow 1101 later updates of the module. 1103 v03 - v04 1105 * removed entity-tag and last-modified timestamp 1107 * Added simplified-inline method of content-schema specification 1109 v02 - v03 1110 * target renamed to "content-schema" and "content defining YANG 1111 module(s)" 1113 * Made name of instance data set optional 1115 * Updated according to draft-ietf-netmod-yang-data-ext-03 1117 * Clarified that entity-tag and last-modified timestamp are encoded 1118 as metadata. While they contain useful data, the HTTP-header 1119 based encoding from Restconf is not suitable. 1121 v01 - v02 1123 * Removed design time from terminology 1125 * Defined the format of the content-data part by referencing various 1126 RFCs and drafts instead of the result of the get-data and get 1127 operations. 1129 * Changed target-ptr to a choice 1131 * Inline target-ptr may include augmenting modules and alternatives 1132 to ietf-yang-library 1134 * Moved list of target modules into a separate 1135 element. 1137 * Added backwards compatibility considerations 1139 v00 - v01 1141 * Added the target-ptr metadata with 3 methods 1143 * Added timestamp metadata 1145 * Removed usage of dedicated .yid file extension 1147 * Added list of use cases 1149 * Added list of principles 1151 * Updated examples 1153 * Moved detailed use case descriptions to appendix 1155 Appendix B. Backwards Compatibility 1157 The concept of backwards compatibility and what changes are backwards 1158 compatible are not defined for "instance data sets" as it is highly 1159 dependent on the specific use case and the content-schema. 1161 In case of "instance data sets" that are the result of design or 1162 specification activity, some changes that may be good to avoid are 1163 listed below. 1165 YANG uses the concept of managed entities identified by key values; 1166 if the connection between the represented entity and the key value is 1167 not preserved during an update, this may lead to the following 1168 problems. 1170 * If the key value of a list entry that represents the same managed 1171 entity as before is changed, the user may mistakenly identify the 1172 list entry as new. 1174 * If the meaning of a list entry is changed, but the key values are 1175 not (e.g., redefining an alarm-type but not changing its alarm- 1176 type-id) the change may not be noticed. 1178 * If the key value of a previously removed list entry is reused for 1179 a different entity, the change may be misinterpreted as 1180 reintroducing the previous entity. 1182 Appendix C. Detailed Use Cases 1184 This section is non-normative. 1186 C.1. Use Case 1: Early Documentation of Server Capabilities 1188 A server has a number of server-capabilities that are defined in YANG 1189 modules and can be retrieved from the server using protocols like 1190 NETCONF or RESTCONF. Server capabilities include: 1192 * data defined in "ietf-yang-library": YANG modules, submodules, 1193 features, deviations, schema-mounts, and datastores supported 1194 ([RFC8525]) 1196 * alarms supported ([RFC8632]) 1198 * data nodes and subtrees that support or do not support on-change 1199 notifications ([RFC8641]) 1201 * netconf-capabilities in ietf-netconf-monitoring. 1203 While it is good practice to allow a client to query these 1204 capabilities from the live server, that is often not possible. 1206 Often when a network node is released, an associated NMS (network 1207 management system) is also released with it. The NMS depends on the 1208 capabilities of the server. During NMS implementation, information 1209 about server capabilities is needed. If the information is 1210 unavailable early in some offline document, but only as instance data 1211 from the live network node, the NMS implementation will be delayed, 1212 because it has to wait until the network node is ready. Also 1213 assuming that all NMS implementors will have a correctly configured 1214 network nodes from which data can be retrieved, is a very expensive 1215 proposition. (An NMS may handle dozens of node types.) 1217 Network operators often build their own home-grown NMS systems that 1218 need to be integrated with a vendor's network node. The operator 1219 needs to know the network node's server capabilities in order to do 1220 this. Moreover, the network operator's decision to buy a vendor's 1221 product may even be influenced by the network node's OAM feature set 1222 documented as the server's capabilities. 1224 Beside NMS implementors, system integrators and many others also need 1225 the same information early. Examples could be model driven testing, 1226 generating documentation, etc. 1228 Most server-capabilities are relatively stable and change only during 1229 upgrade or due to licensing or the addition or removal of hardware. 1230 They are usually defined by a vendor at design time, before the 1231 product is released. It is feasible and advantageous to define/ 1232 document them early e.g., in a YANG instance data File. 1234 It is anticipated that a separate IETF document will define in detail 1235 how and which set of server capabilities should be documented. 1237 C.2. Use Case 2: Preloading Data 1239 There are parts of the configuration that must be fully configurable 1240 by the operator. However, often a simple default configuration will 1241 be sufficient. 1243 One example is access control groups/roles and related rules. While 1244 a sophisticated operator may define dozens of different groups, often 1245 a basic (read-only operator, read-write system administrator, 1246 security-administrator) triplet will be enough. Vendors will often 1247 provide such default configuration data to make device configuration 1248 easier for an operator. 1250 Defining access control data is a complex task. To help, the device 1251 vendor predefines a set of default groups (/nacm:nacm/groups) and 1252 rules for these groups to access specific parts of common models 1253 (/nacm:nacm/rule-list/rule). 1255 YANG instance data files are used to document and/or preload the 1256 default configuration. 1258 C.3. Use Case 3: Documenting Factory Default Settings 1260 Nearly every server has a factory default configuration. If the 1261 system is really badly misconfigured or if the current configuration 1262 is to be abandoned, the system can be reset the default factory 1263 configuration. 1265 The operator currently needs to know what the default configuration 1266 actually contains. YANG instance data can be used to document the 1267 factory default configuration. See [RFC8808]. 1269 Authors' Addresses 1271 Balazs Lengyel 1272 Ericsson 1274 Email: balazs.lengyel@ericsson.com 1276 Benoit Claise 1277 Huawei 1279 Email: benoit.claise@huawei.com