idnits 2.17.1 draft-ietf-netmod-yang-instance-file-format-08.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 9, 2020) is 1509 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 10, 2020 Cisco Systems, Inc. 6 March 9, 2020 8 YANG Instance Data File Format 9 draft-ietf-netmod-yang-instance-file-format-08 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 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. 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. Open Issues . . . . . . . . . . . . . . . . . . . . 22 77 Appendix B. Changes between revisions . . . . . . . . . . . . . 22 78 Appendix C. Backwards Compatibility . . . . . . . . . . . . . . 24 79 Appendix D. Detailed Use Cases - Non-Normative . . . . . . . . . 24 80 D.1. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 24 81 D.1.1. Use Case 1: Early Documentation of Server 82 Capabilities . . . . . . . . . . . . . . . . . . . . 24 83 D.1.2. Use Case 2: Preloading Data . . . . . . . . . . . . . 26 84 D.1.3. Use Case 3: Documenting Factory Default Settings . . 26 85 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26 87 1. Terminology 89 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 90 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 91 "OPTIONAL" in this document are to be interpreted as described in BCP 92 14 [RFC2119] [RFC8174] when, and only when, they appear in all 93 capitals, as shown here. 95 Instance Data: A collection of instantiated data nodes. 97 Instance Data Set: A named set of data items annotated with metadata 98 that can be used as instance data in a YANG data tree. 100 Instance Data File: A file containing an instance data set formatted 101 according to the rules described in this document. 103 Content-schema: A set of YANG modules with their revision, supported 104 features, and deviations for which the instance data set contains 105 instance data. 107 Content defining YANG module: an individual YANG module that is part 108 of the content-schema. 110 The term Server is used as defined in [RFC8342]. 112 2. Introduction 114 There is a need to document data defined in YANG models when a live 115 server is not available. Data is often needed already at design or 116 implementation time or needed by groups that do not have a live 117 running server available. To facilitate this offline delivery of 118 data, this document specifies a standard format for YANG instance 119 data sets and YANG instance data files. 121 The following is a list of already implemented and potential use 122 cases. 124 UC1 Documentation of server capabilities 126 UC2 Preloading default configuration data 128 UC3 Documenting Factory Default Settings 130 UC4 Storing the configuration of a device, e.g., for backup, archive 131 or audit purposes 133 UC5 Storing diagnostics data 135 UC6 Allowing YANG instance data to potentially be carried within 136 other IPC message formats 138 UC7 Default instance data used as part of a templating solution 140 UC8 Providing data examples in RFCs or internet drafts 142 In Appendix D we describe the first three use cases in detail. 144 There are many and varied use cases where YANG instance data could be 145 used. We do not want to limit future uses of instance data sets, so 146 specifying how and when to use YANG instance data is out of scope for 147 this document. It is anticipated that other documents will define 148 specific use cases. Use cases are listed here only to indicate the 149 need for this work. 151 2.1. Principles 153 The following is a list of the basic principles of the instance data 154 format: 156 P1 Two standard formats shall be defined based on the XML and JSON 157 encodings. 159 P2 Instance data shall reuse existing encoding rules for YANG 160 defined data. Its format will be similar to the response of a 161 NETCONF operation or the RESTCONF response to a GET method 162 invocation on the (unified) datastore resource. 164 P3 Metadata about the instance data set (Section 3, Paragraph 9) 165 shall be defined. 167 P4 A YANG instance data set shall be allowed to contain data for 168 multiple YANG modules. 170 P5 Instance data shall be allowed to contain configuration data, 171 state data, or a mix of the two. 173 P6 Partial data sets shall be allowed. 175 P7 The YANG instance data format shall be usable for any data for 176 which YANG module(s) are defined and available to the reader, 177 independent of whether the module is actually implemented by a 178 server. 180 P8 It shall be possible to report the identity of the datastore with 181 which the instance data set is associated. 183 2.2. 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 2.3. 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 3. 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 we want to document/provide. The syntax and 214 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 metadata as defined by [RFC7952]. 228 a default attribute as defined in [RFC6243] section 6. and in 229 [RFC8040] section 4.8.9. 231 origin metadata as specified in [RFC8526] and [RFC8527] 233 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 set 239 for a server. Default values SHOULD NOT be included. 241 Config=true and config=false data MAY be mixed in the instance data 242 file. 244 Instance data files MAY contain partial data sets. This means 245 mandatory, min-elements, require-instance=true, must and when 246 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 inside the data set is present 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, this 258 MUST be used. If the "revision-date" is present in both the 259 filename and in the instance data header, the revision date in the 260 file name MUST be set to the latest revision date inside the 261 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, this 270 MUST be used. If the "timestamp" is present both in the filename 271 and in the instance data header, the timestamp in the file name 272 MUST be set to the timestamp inside the instance data set; the 273 semicolons and the decimal point, if present, shall be replaced by 274 underscores. 276 The revision date or timestamp is optional. ".filetype" SHALL 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 also be used. 282 Metadata MUST include: 284 Version of the YANG Instance Data format 286 Metadata SHOULD include: 288 o Name of the data set 289 o Content schema specification 291 o Description of the instance data set. The description SHOULD 292 contain information whether and how the data can change during the 293 lifetime of the server. 295 3.1. Specifying the Content Schema 297 To properly understand and use an instance data set, the user needs 298 to know the content-schema. One of the following methods SHOULD be 299 used: 301 Inline method: Include the needed information as part of the 302 instance data set. 304 Simplified-Inline method: Include the needed information as part 305 of the instance data set; short specification. 307 URI method: Include a URI that references another YANG instance 308 data file. This instance data file will use the same content- 309 schema as the referenced YANG instance data file. (if you don't 310 want to repeat the info again and again) 312 External Method: Do not include the content-schema, the user needs 313 to obtain the information through external documents. 315 Additional methods e.g., a YANG-package based solution may be added 316 later. 318 Note, the specified content-schema only indicates the set of modules 319 that were used to define this YANG instance data set. Sometimes 320 instance data may be used for a server supporting a different YANG 321 module set. (e.g., for "UC2 Preloading Data" the instance data set 322 may not be updated every time the YANG modules on the server are 323 updated) Whether an instance data set originally defined using a 324 specific content-schema is usable with a different other schema 325 depends on many factors including the amount of differences and the 326 compatibility between the original and the other schema, considering 327 modules, revisions, features, deviations, the scope of the instance 328 data, etc. 330 3.1.1. Inline Method 332 One or more inline-module elements define YANG module(s) used to 333 specify the content defining YANG modules. 335 E.g., ietf-yang-library@2016-06-21 337 The anydata inline-schema carries instance data (conforming to the 338 inline-modules) that actually specifies the content defining YANG 339 modules including revision, supported features, deviations and any 340 relevant additional data (e.g., revision labels 341 [I-D.verdt-netmod-yang-module-versioning]). See Section 3.2. 343 3.1.2. Simplified-Inline Method 345 The instance data set contains a list of content defining YANG 346 modules including the revision date for each. Usage of this method 347 implies that the modules are used without any deviations and with all 348 features supported. 350 3.1.3. URI Method 352 The same-schema-as-file leaf SHALL contain a URI that references 353 another YANG instance data file. The current instance data file will 354 use the same content schema as the referenced file. 356 The referenced instance data file MAY have no content-data if it is 357 used solely for specifying the content-schema. 359 If a referenced instance data file is not available, content-schema 360 is unknown. 362 The URI method is advantageous when the user wants to avoid the 363 overhead of specifying the content-schema in each instance data file: 364 E.g., In Use Case 6, when the system creates a diagnostic file every 365 minute to document the state of the server. 367 3.2. Examples 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 375 377 acme-router-modules 378 2020-03-06 379 380 381 ietf-yang-library@2016-06-21 382 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 acme-router 402 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-factory-default] 965 WU, Q., Lengyel, B., and Y. Niu, "A YANG Data Model for 966 Factory Default Settings", draft-ietf-netmod-factory- 967 default-14 (work in progress), February 2020. 969 [I-D.verdt-netmod-yang-module-versioning] 970 Claise, B., Clarke, J., Rahman, R., Wilton, R., Lengyel, 971 B., Sterne, J., and K. D'Souza, "Updated YANG Module 972 Revision Handling", draft-verdt-netmod-yang-module- 973 versioning-01 (work in progress), October 2019. 975 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 976 DOI 10.17487/RFC3688, January 2004, 977 . 979 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 980 the Network Configuration Protocol (NETCONF)", RFC 6020, 981 DOI 10.17487/RFC6020, October 2010, 982 . 984 [RFC8632] Vallin, S. and M. Bjorklund, "A YANG Data Model for Alarm 985 Management", RFC 8632, DOI 10.17487/RFC8632, September 986 2019, . 988 [RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications 989 for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, 990 September 2019, . 992 Appendix A. Open Issues 994 o - 996 Appendix B. Changes between revisions 998 v07 - v08 1000 o Moved compatibility into appendix 1002 o Renamed yid-version to format-version as "yid" can be regarded as 1003 a racial slur. Changed format to date of the YANG module 1005 o Made support of ietf-yang-library mandatory if inline-content- 1006 schema is supported 1008 o Many small changes based on WGLC 1010 v06 - v07 1012 o Updated terminology, use-cases 1014 o Many small changes based on WGLC 1016 v05 - v06 1018 o Modified module name format, removed .yin or .yang extension 1020 o Removed pattern for module and inline-module. We want to allow 1021 the usage of revision-label later 1023 v04 - v05 1025 o Updated according to YANG-Doctor review 1027 o Updated security considerations 1029 o Added a wrapping container for the schema, and renamed the data 1030 nodes in the inline and uri cases. 1032 o Allowed .yin for simplified-inline schema naming. Made date 1033 optional if it is not available in the YANG module. 1035 o Added a mandatory yid-version to the header metadata to allow 1036 later updates of the module. 1038 v03 - v04 1040 o removed entity-tag and last-modified timestamp 1042 o Added simplified-inline method of content-schema specification 1044 v02 - v03 1046 o target renamed to "content-schema" and "content defining YANG 1047 module(s)" 1049 o Made name of instance data set optional 1051 o Updated according to draft-ietf-netmod-yang-data-ext-03 1053 o Clarified that entity-tag and last-modified timestamp are encoded 1054 as metadata. While they contain useful data, the HTTP-header 1055 based encoding from Restconf is not suitable. 1057 v01 - v02 1059 o Removed design time from terminology 1061 o Defined the format of the content-data part by referencing various 1062 RFCs and drafts instead of the result of the get-data and get 1063 operations. 1065 o Changed target-ptr to a choice 1067 o Inline target-ptr may include augmenting modules and alternatives 1068 to ietf-yang-library 1070 o Moved list of target modules into a separate 1071 element. 1073 o Added backwards compatibility considerations 1075 v00 - v01 1077 o Added the target-ptr metadata with 3 methods 1079 o Added timestamp metadata 1080 o Removed usage of dedicated .yid file extension 1082 o Added list of use cases 1084 o Added list of principles 1086 o Updated examples 1088 o Moved detailed use case descriptions to appendix 1090 Appendix C. Backwards Compatibility 1092 The concept of backwards compatibility and what changes are backwards 1093 compatible are not defined for instance data sets as it is highly 1094 dependent on the specific use case and the content-schema. 1096 For instance data that is the result of a design or specification 1097 activity, some changes that may be good to avoid are listed. YANG 1098 uses the concept of managed entities identified by key values; if the 1099 connection between the represented entity and the key value is not 1100 preserved during an update, this may lead to problems. 1102 o If the key value of a list entry that represents the same managed 1103 entity as before is changed, the user may mistakenly identify the 1104 list entry as new. 1106 o If the meaning of a list entry is changed, but the key values are 1107 not (e.g., redefining an alarm-type but not changing its alarm- 1108 type-id) the change may not be noticed. 1110 o If the key value of a previously removed list entry is reused for 1111 a different entity, the change may be misinterpreted as 1112 reintroducing the previous entity. 1114 Appendix D. Detailed Use Cases - Non-Normative 1116 D.1. Use Cases 1118 We present a number of use cases were YANG instance data is needed. 1120 D.1.1. Use Case 1: Early Documentation of Server Capabilities 1122 A server has a number of server-capabilities that are defined in YANG 1123 modules and can be retrieved from the server using protocols like 1124 NETCONF or RESTCONF. Server capabilities include: 1126 o data defined in ietf-yang-library: YANG modules, submodules, 1127 features, deviations, schema-mounts, and datastores supported 1128 ([RFC8525]) 1130 o alarms supported ([RFC8632]) 1132 o data nodes and subtrees that support or do not support on-change 1133 notifications ([RFC8641]) 1135 o netconf-capabilities in ietf-netconf-monitoring 1137 While it is good practice to allow a client to query these 1138 capabilities from the live server, that is often not possible. 1140 Often when a network node is released, an associated NMS (network 1141 management system) is also released with it. The NMS depends on the 1142 capabilities of the server. During NMS implementation, information 1143 about server capabilities is needed. If the information is not 1144 available early in some offline document, but only as instance data 1145 from the live network node, the NMS implementation will be delayed, 1146 because it has to wait until the network node is ready. Also 1147 assuming that all NMS implementors will have a correctly configured 1148 network nodes from which data can be retrieved, is a very expensive 1149 proposition. (An NMS may handle dozens of node types.) 1151 Network operators often build their own home-grown NMS systems that 1152 need to be integrated with a vendor's network node. The operator 1153 needs to know the network node's server capabilities in order to do 1154 this. Moreover, the network operator's decision to buy a vendor's 1155 product may even be influenced by the network node's OAM feature set 1156 documented as the server's capabilities. 1158 Beside NMS implementors, system integrators and many others also need 1159 the same information early. Examples could be model driven testing, 1160 generating documentation, etc. 1162 Most server-capabilities are relatively stable and change only during 1163 upgrade or due to licensing or the addition or removal of hardware. 1164 They are usually defined by a vendor at design time, before the 1165 product is released. It is feasible and advantageous to define/ 1166 document them early e.g., in a YANG instance data File. 1168 It is anticipated that a separate IETF document will define in detail 1169 how and which set of server capabilities should be documented. 1171 D.1.2. Use Case 2: Preloading Data 1173 There are parts of the configuration that must be fully configurable 1174 by the operator. However, often a simple default configuration will 1175 be sufficient. 1177 One example is access control groups/roles and related rules. While 1178 a sophisticated operator may define dozens of different groups, often 1179 a basic (read-only operator, read-write system administrator, 1180 security-administrator) triplet will be enough. Vendors will often 1181 provide such default configuration data to make device configuration 1182 easier for an operator. 1184 Defining access control data is a complex task. To help, the device 1185 vendor predefines a set of default groups (/nacm:nacm/groups) and 1186 rules for these groups to access specific parts of common models 1187 (/nacm:nacm/rule-list/rule). 1189 YANG instance data files are used to document and/or preload the 1190 default configuration. 1192 D.1.3. Use Case 3: Documenting Factory Default Settings 1194 Nearly every server has a factory default configuration. If the 1195 system is really badly misconfigured or if the current configuration 1196 is to be abandoned, the system can be reset the default factory 1197 configuration. 1199 In NETCONF, the operation can already be used to 1200 reset the startup datastore. There are ongoing efforts to introduce 1201 a new, more generic factory-reset operation for the same purpose 1202 [I-D.ietf-netmod-factory-default] 1204 The operator currently has no way to know what the default 1205 configuration actually contains. YANG instance data can also be used 1206 to document the factory default configuration. 1208 Authors' Addresses 1210 Balazs Lengyel 1211 Ericsson 1212 Magyar Tudosok korutja 11 1213 1117 Budapest 1214 Hungary 1216 Phone: +36-70-330-7909 1217 Email: balazs.lengyel@ericsson.com 1218 Benoit Claise 1219 Cisco Systems, Inc. 1220 De Kleetlaan 6a b1 1221 1831 Diegem 1222 Belgium 1224 Phone: +32 2 704 5622 1225 Email: bclaise@cisco.com