blob: debfae7363a18194e11fd83011e8c82c98db382d [file] [log] [blame]
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +01001 module ietf-yang-library {
2 yang-version 1.1;
3 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library";
Michal Vasko134fa342019-07-18 16:25:08 +02004 prefix yanglib;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +01005
6 import ietf-yang-types {
7 prefix yang;
Michal Vasko134fa342019-07-18 16:25:08 +02008 reference
9 "RFC 6991: Common YANG Data Types";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010010 }
11 import ietf-inet-types {
12 prefix inet;
Michal Vasko134fa342019-07-18 16:25:08 +020013 reference
14 "RFC 6991: Common YANG Data Types";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010015 }
16 import ietf-datastores {
17 prefix ds;
Michal Vasko134fa342019-07-18 16:25:08 +020018 reference
19 "RFC 8342: Network Management Datastore Architecture
20 (NMDA)";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010021 }
22
23 organization
24 "IETF NETCONF (Network Configuration) Working Group";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010025 contact
Michal Vasko134fa342019-07-18 16:25:08 +020026 "WG Web: <https://datatracker.ietf.org/wg/netconf/>
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010027 WG List: <mailto:netconf@ietf.org>
28
29 Author: Andy Bierman
30 <mailto:andy@yumaworks.com>
31
32 Author: Martin Bjorklund
33 <mailto:mbj@tail-f.com>
34
35 Author: Juergen Schoenwaelder
36 <mailto:j.schoenwaelder@jacobs-university.de>
37
38 Author: Kent Watsen
Michal Vasko134fa342019-07-18 16:25:08 +020039 <mailto:kent+ietf@watsen.net>
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010040
Michal Vasko134fa342019-07-18 16:25:08 +020041 Author: Robert Wilton
42 <mailto:rwilton@cisco.com>";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010043 description
Michal Vasko134fa342019-07-18 16:25:08 +020044 "This module provides information about the YANG modules,
45 datastores, and datastore schemas used by a network
46 management server.
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010047
Michal Vasko134fa342019-07-18 16:25:08 +020048 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
49 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
50 'MAY', and 'OPTIONAL' in this document are to be interpreted as
51 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
52 they appear in all capitals, as shown here.
53
54 Copyright (c) 2019 IETF Trust and the persons identified as
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010055 authors of the code. All rights reserved.
56
57 Redistribution and use in source and binary forms, with or
58 without modification, is permitted pursuant to, and subject
59 to the license terms contained in, the Simplified BSD License
60 set forth in Section 4.c of the IETF Trust's Legal Provisions
61 Relating to IETF Documents
Michal Vasko134fa342019-07-18 16:25:08 +020062 (https://trustee.ietf.org/license-info).
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010063
Michal Vasko134fa342019-07-18 16:25:08 +020064 This version of this YANG module is part of RFC 8525; see
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010065 the RFC itself for full legal notices.";
66
Michal Vasko134fa342019-07-18 16:25:08 +020067 revision 2019-01-04 {
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010068 description
Michal Vasko134fa342019-07-18 16:25:08 +020069 "Added support for multiple datastores according to the
70 Network Management Datastore Architecture (NMDA).";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010071 reference
Michal Vasko134fa342019-07-18 16:25:08 +020072 "RFC 8525: YANG Library";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010073 }
74 revision 2016-04-09 {
75 description
76 "Initial revision.";
77 reference
Michal Vasko134fa342019-07-18 16:25:08 +020078 "RFC 7895: YANG Module Library";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +010079 }
80
81 /*
82 * Typedefs
83 */
84
85 typedef revision-identifier {
86 type string {
87 pattern '\d{4}-\d{2}-\d{2}';
88 }
89 description
90 "Represents a specific date in YYYY-MM-DD format.";
91 }
92
93 /*
94 * Groupings
95 */
96
97 grouping module-identification-leafs {
98 description
99 "Parameters for identifying YANG modules and submodules.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100100 leaf name {
101 type yang:yang-identifier;
102 mandatory true;
103 description
104 "The YANG module or submodule name.";
105 }
106 leaf revision {
107 type revision-identifier;
108 description
109 "The YANG module or submodule revision date. If no revision
110 statement is present in the YANG module or submodule, this
111 leaf is not instantiated.";
112 }
113 }
114
115 grouping location-leaf-list {
116 description
Michal Vasko134fa342019-07-18 16:25:08 +0200117 "Common leaf-list parameter for the locations of modules and
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100118 submodules.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100119 leaf-list location {
120 type inet:uri;
121 description
122 "Contains a URL that represents the YANG schema
123 resource for this module or submodule.
124
125 This leaf will only be present if there is a URL
126 available for retrieval of the schema for this entry.";
127 }
128 }
129
Michal Vasko134fa342019-07-18 16:25:08 +0200130 grouping module-implementation-parameters {
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100131 description
132 "Parameters for describing the implementation of a module.";
Michal Vasko134fa342019-07-18 16:25:08 +0200133 leaf-list feature {
134 type yang:yang-identifier;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100135 description
Michal Vasko134fa342019-07-18 16:25:08 +0200136 "List of all YANG feature names from this module that are
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100137 supported by the server, regardless whether they are defined
138 in the module or any included submodule.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100139 }
Michal Vasko134fa342019-07-18 16:25:08 +0200140 leaf-list deviation {
141 type leafref {
142 path "../../module/name";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100143 }
Michal Vasko134fa342019-07-18 16:25:08 +0200144 description
145 "List of all YANG deviation modules used by this server to
146 modify the conformance of the module associated with this
147 entry. Note that the same module can be used for deviations
148 for multiple modules, so the same entry MAY appear within
149 multiple 'module' entries.
150
151 This reference MUST NOT (directly or indirectly)
152 refer to the module being deviated.
153
154 Robust clients may want to make sure that they handle a
155 situation where a module deviates itself (directly or
156 indirectly) gracefully.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100157 }
158 }
159
160 grouping module-set-parameters {
161 description
162 "A set of parameters that describe a module set.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100163 leaf name {
164 type string;
165 description
166 "An arbitrary name of the module set.";
167 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100168 list module {
169 key "name";
170 description
171 "An entry in this list represents a module implemented by the
Michal Vasko134fa342019-07-18 16:25:08 +0200172 server, as per Section 5.6.5 of RFC 7950, with a particular
173 set of supported features and deviations.";
174 reference
175 "RFC 7950: The YANG 1.1 Data Modeling Language";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100176 uses module-identification-leafs;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100177 leaf namespace {
178 type inet:uri;
179 mandatory true;
180 description
181 "The XML namespace identifier for this module.";
182 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100183 uses location-leaf-list;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100184 list submodule {
185 key "name";
186 description
187 "Each entry represents one submodule within the
188 parent module.";
189 uses module-identification-leafs;
190 uses location-leaf-list;
191 }
Michal Vasko134fa342019-07-18 16:25:08 +0200192 uses module-implementation-parameters;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100193 }
194 list import-only-module {
195 key "name revision";
196 description
197 "An entry in this list indicates that the server imports
198 reusable definitions from the specified revision of the
Michal Vasko134fa342019-07-18 16:25:08 +0200199 module but does not implement any protocol-accessible
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100200 objects from this revision.
201
202 Multiple entries for the same module name MAY exist. This
Michal Vasko134fa342019-07-18 16:25:08 +0200203 can occur if multiple modules import the same module but
204 specify different revision dates in the import statements.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100205 leaf name {
206 type yang:yang-identifier;
207 description
208 "The YANG module name.";
209 }
210 leaf revision {
211 type union {
212 type revision-identifier;
213 type string {
Michal Vasko134fa342019-07-18 16:25:08 +0200214 length "0";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100215 }
216 }
217 description
Michal Vasko134fa342019-07-18 16:25:08 +0200218 "The YANG module revision date.
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100219 A zero-length string is used if no revision statement
220 is present in the YANG module.";
221 }
222 leaf namespace {
223 type inet:uri;
224 mandatory true;
225 description
226 "The XML namespace identifier for this module.";
227 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100228 uses location-leaf-list;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100229 list submodule {
230 key "name";
231 description
232 "Each entry represents one submodule within the
233 parent module.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100234 uses module-identification-leafs;
235 uses location-leaf-list;
236 }
237 }
238 }
239
240 grouping yang-library-parameters {
241 description
242 "The YANG library data structure is represented as a grouping
243 so it can be reused in configuration or another monitoring
244 data structure.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100245 list module-set {
Michal Vasko134fa342019-07-18 16:25:08 +0200246 key "name";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100247 description
Michal Vasko134fa342019-07-18 16:25:08 +0200248 "A set of modules that may be used by one or more schemas.
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100249
Michal Vasko134fa342019-07-18 16:25:08 +0200250 A module set does not have to be referentially complete,
251 i.e., it may define modules that contain import statements
252 for other modules not included in the module set.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100253 uses module-set-parameters;
254 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100255 list schema {
256 key "name";
257 description
258 "A datastore schema that may be used by one or more
Michal Vasko134fa342019-07-18 16:25:08 +0200259 datastores.
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100260
Michal Vasko134fa342019-07-18 16:25:08 +0200261 The schema must be valid and referentially complete, i.e.,
262 it must contain modules to satisfy all used import
263 statements for all modules specified in the schema.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100264 leaf name {
265 type string;
266 description
267 "An arbitrary name of the schema.";
268 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100269 leaf-list module-set {
270 type leafref {
271 path "../../module-set/name";
272 }
273 description
Michal Vasko134fa342019-07-18 16:25:08 +0200274 "A set of module-sets that are included in this schema.
275 If a non-import-only module appears in multiple module
276 sets, then the module revision and the associated features
277 and deviations must be identical.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100278 }
279 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100280 list datastore {
281 key "name";
282 description
283 "A datastore supported by this server.
284
285 Each datastore indicates which schema it supports.
286
287 The server MUST instantiate one entry in this list per
288 specific datastore it supports.
Michal Vasko134fa342019-07-18 16:25:08 +0200289 Each datastore entry with the same datastore schema SHOULD
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100290 reference the same schema.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100291 leaf name {
Michal Vasko134fa342019-07-18 16:25:08 +0200292 type ds:datastore-ref;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100293 description
294 "The identity of the datastore.";
295 }
296 leaf schema {
297 type leafref {
298 path "../../schema/name";
299 }
300 mandatory true;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100301 description
Michal Vasko134fa342019-07-18 16:25:08 +0200302 "A reference to the schema supported by this datastore.
303 All non-import-only modules of the schema are implemented
304 with their associated features and deviations.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100305 }
306 }
307 }
308
309 /*
310 * Top-level container
311 */
312
313 container yang-library {
314 config false;
315 description
Michal Vasko134fa342019-07-18 16:25:08 +0200316 "Container holding the entire YANG library of this server.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100317 uses yang-library-parameters;
Michal Vasko134fa342019-07-18 16:25:08 +0200318 leaf content-id {
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100319 type string;
320 mandatory true;
321 description
Michal Vasko134fa342019-07-18 16:25:08 +0200322 "A server-generated identifier of the contents of the
323 '/yang-library' tree. The server MUST change the value of
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100324 this leaf if the information represented by the
Michal Vasko134fa342019-07-18 16:25:08 +0200325 '/yang-library' tree, except '/yang-library/content-id', has
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100326 changed.";
327 }
328 }
329
330 /*
331 * Notifications
332 */
333
334 notification yang-library-update {
335 description
336 "Generated when any YANG library information on the
337 server has changed.";
Michal Vasko134fa342019-07-18 16:25:08 +0200338 leaf content-id {
339 type leafref {
340 path "/yanglib:yang-library/yanglib:content-id";
341 }
342 mandatory true;
343 description
344 "Contains the YANG library content identifier for the updated
345 YANG library at the time the notification is generated.";
346 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100347 }
348
349 /*
350 * Legacy groupings
351 */
352
353 grouping module-list {
354 status deprecated;
355 description
356 "The module data structure is represented as a grouping
357 so it can be reused in configuration or another monitoring
358 data structure.";
359
360 grouping common-leafs {
361 status deprecated;
362 description
363 "Common parameters for YANG modules and submodules.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100364 leaf name {
365 type yang:yang-identifier;
366 status deprecated;
367 description
368 "The YANG module or submodule name.";
369 }
370 leaf revision {
371 type union {
372 type revision-identifier;
373 type string {
Michal Vasko134fa342019-07-18 16:25:08 +0200374 length "0";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100375 }
376 }
377 status deprecated;
378 description
379 "The YANG module or submodule revision date.
380 A zero-length string is used if no revision statement
381 is present in the YANG module or submodule.";
382 }
383 }
Michal Vasko134fa342019-07-18 16:25:08 +0200384
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100385 grouping schema-leaf {
386 status deprecated;
387 description
388 "Common schema leaf parameter for modules and submodules.";
389 leaf schema {
390 type inet:uri;
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100391 description
392 "Contains a URL that represents the YANG schema
393 resource for this module or submodule.
394
395 This leaf will only be present if there is a URL
396 available for retrieval of the schema for this entry.";
397 }
398 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100399 list module {
400 key "name revision";
401 status deprecated;
402 description
403 "Each entry represents one revision of one module
404 currently supported by the server.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100405 uses common-leafs {
406 status deprecated;
407 }
408 uses schema-leaf {
409 status deprecated;
410 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100411 leaf namespace {
412 type inet:uri;
413 mandatory true;
414 status deprecated;
415 description
416 "The XML namespace identifier for this module.";
417 }
418 leaf-list feature {
419 type yang:yang-identifier;
420 status deprecated;
421 description
422 "List of YANG feature names from this module that are
Michal Vasko134fa342019-07-18 16:25:08 +0200423 supported by the server, regardless of whether they are
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100424 defined in the module or any included submodule.";
425 }
426 list deviation {
427 key "name revision";
428 status deprecated;
429 description
430 "List of YANG deviation module names and revisions
431 used by this server to modify the conformance of
432 the module associated with this entry. Note that
433 the same module can be used for deviations for
434 multiple modules, so the same entry MAY appear
435 within multiple 'module' entries.
436
437 The deviation module MUST be present in the 'module'
438 list, with the same name and revision values.
439 The 'conformance-type' value will be 'implement' for
440 the deviation module.";
441 uses common-leafs {
442 status deprecated;
443 }
444 }
445 leaf conformance-type {
446 type enumeration {
447 enum implement {
448 description
449 "Indicates that the server implements one or more
450 protocol-accessible objects defined in the YANG module
451 identified in this entry. This includes deviation
452 statements defined in the module.
453
454 For YANG version 1.1 modules, there is at most one
Michal Vasko134fa342019-07-18 16:25:08 +0200455 'module' entry with conformance type 'implement' for a
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100456 particular module name, since YANG 1.1 requires that
457 at most one revision of a module is implemented.
458
459 For YANG version 1 modules, there SHOULD NOT be more
Michal Vasko134fa342019-07-18 16:25:08 +0200460 than one 'module' entry for a particular module
461 name.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100462 }
463 enum import {
464 description
465 "Indicates that the server imports reusable definitions
Michal Vasko134fa342019-07-18 16:25:08 +0200466 from the specified revision of the module but does
467 not implement any protocol-accessible objects from
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100468 this revision.
469
Michal Vasko134fa342019-07-18 16:25:08 +0200470 Multiple 'module' entries for the same module name MAY
471 exist. This can occur if multiple modules import the
472 same module but specify different revision dates in
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100473 the import statements.";
474 }
475 }
476 mandatory true;
477 status deprecated;
478 description
479 "Indicates the type of conformance the server is claiming
480 for the YANG module identified by this entry.";
481 }
482 list submodule {
483 key "name revision";
484 status deprecated;
485 description
486 "Each entry represents one submodule within the
487 parent module.";
488 uses common-leafs {
489 status deprecated;
490 }
491 uses schema-leaf {
492 status deprecated;
493 }
494 }
495 }
496 }
497
498 /*
499 * Legacy operational state data nodes
500 */
501
502 container modules-state {
503 config false;
504 status deprecated;
505 description
506 "Contains YANG module monitoring information.";
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100507 leaf module-set-id {
508 type string;
509 mandatory true;
510 status deprecated;
511 description
512 "Contains a server-specific identifier representing
513 the current set of modules and submodules. The
514 server MUST change the value of this leaf if the
515 information represented by the 'module' list instances
516 has changed.";
517 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100518 uses module-list {
519 status deprecated;
520 }
521 }
522
523 /*
524 * Legacy notifications
525 */
526
527 notification yang-library-change {
528 status deprecated;
529 description
530 "Generated when the set of modules and submodules supported
531 by the server has changed.";
532 leaf module-set-id {
533 type leafref {
534 path "/yanglib:modules-state/yanglib:module-set-id";
535 }
536 mandatory true;
537 status deprecated;
538 description
539 "Contains the module-set-id value representing the
540 set of modules and submodules supported at the server
541 at the time the notification is generated.";
542 }
543 }
Michal Vaskoeb3bd0e2018-01-26 11:52:11 +0100544 }