blob: debfae7363a18194e11fd83011e8c82c98db382d [file] [log] [blame]
Radek Krejci86d106e2018-10-18 09:53:19 +02001 module ietf-yang-library {
2 yang-version 1.1;
3 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library";
Michal Vaskocf296c82020-05-27 11:16:45 +02004 prefix yanglib;
Radek Krejci86d106e2018-10-18 09:53:19 +02005
6 import ietf-yang-types {
7 prefix yang;
Michal Vaskocf296c82020-05-27 11:16:45 +02008 reference
9 "RFC 6991: Common YANG Data Types";
Radek Krejci86d106e2018-10-18 09:53:19 +020010 }
11 import ietf-inet-types {
12 prefix inet;
Michal Vaskocf296c82020-05-27 11:16:45 +020013 reference
14 "RFC 6991: Common YANG Data Types";
Radek Krejci86d106e2018-10-18 09:53:19 +020015 }
16 import ietf-datastores {
17 prefix ds;
Michal Vaskocf296c82020-05-27 11:16:45 +020018 reference
19 "RFC 8342: Network Management Datastore Architecture
20 (NMDA)";
Radek Krejci86d106e2018-10-18 09:53:19 +020021 }
22
23 organization
24 "IETF NETCONF (Network Configuration) Working Group";
Radek Krejci86d106e2018-10-18 09:53:19 +020025 contact
Michal Vaskocf296c82020-05-27 11:16:45 +020026 "WG Web: <https://datatracker.ietf.org/wg/netconf/>
Radek Krejci86d106e2018-10-18 09:53:19 +020027 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 Vaskocf296c82020-05-27 11:16:45 +020039 <mailto:kent+ietf@watsen.net>
Radek Krejci86d106e2018-10-18 09:53:19 +020040
Michal Vaskocf296c82020-05-27 11:16:45 +020041 Author: Robert Wilton
42 <mailto:rwilton@cisco.com>";
Radek Krejci86d106e2018-10-18 09:53:19 +020043 description
Michal Vaskocf296c82020-05-27 11:16:45 +020044 "This module provides information about the YANG modules,
45 datastores, and datastore schemas used by a network
46 management server.
Radek Krejci86d106e2018-10-18 09:53:19 +020047
Michal Vaskocf296c82020-05-27 11:16:45 +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
Radek Krejci86d106e2018-10-18 09:53:19 +020055 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 Vaskocf296c82020-05-27 11:16:45 +020062 (https://trustee.ietf.org/license-info).
Radek Krejci86d106e2018-10-18 09:53:19 +020063
Michal Vaskocf296c82020-05-27 11:16:45 +020064 This version of this YANG module is part of RFC 8525; see
Radek Krejci86d106e2018-10-18 09:53:19 +020065 the RFC itself for full legal notices.";
66
Michal Vaskocf296c82020-05-27 11:16:45 +020067 revision 2019-01-04 {
Radek Krejci86d106e2018-10-18 09:53:19 +020068 description
Michal Vaskocf296c82020-05-27 11:16:45 +020069 "Added support for multiple datastores according to the
70 Network Management Datastore Architecture (NMDA).";
Radek Krejci86d106e2018-10-18 09:53:19 +020071 reference
Michal Vaskocf296c82020-05-27 11:16:45 +020072 "RFC 8525: YANG Library";
Radek Krejci86d106e2018-10-18 09:53:19 +020073 }
74 revision 2016-04-09 {
75 description
76 "Initial revision.";
77 reference
Michal Vaskocf296c82020-05-27 11:16:45 +020078 "RFC 7895: YANG Module Library";
Radek Krejci86d106e2018-10-18 09:53:19 +020079 }
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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200100 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 Vaskocf296c82020-05-27 11:16:45 +0200117 "Common leaf-list parameter for the locations of modules and
Radek Krejci86d106e2018-10-18 09:53:19 +0200118 submodules.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200119 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 Vaskocf296c82020-05-27 11:16:45 +0200130 grouping module-implementation-parameters {
Radek Krejci86d106e2018-10-18 09:53:19 +0200131 description
132 "Parameters for describing the implementation of a module.";
Michal Vaskocf296c82020-05-27 11:16:45 +0200133 leaf-list feature {
134 type yang:yang-identifier;
Radek Krejci86d106e2018-10-18 09:53:19 +0200135 description
Michal Vaskocf296c82020-05-27 11:16:45 +0200136 "List of all YANG feature names from this module that are
Radek Krejci86d106e2018-10-18 09:53:19 +0200137 supported by the server, regardless whether they are defined
138 in the module or any included submodule.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200139 }
Michal Vaskocf296c82020-05-27 11:16:45 +0200140 leaf-list deviation {
141 type leafref {
142 path "../../module/name";
Radek Krejci86d106e2018-10-18 09:53:19 +0200143 }
Michal Vaskocf296c82020-05-27 11:16:45 +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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200157 }
158 }
159
160 grouping module-set-parameters {
161 description
162 "A set of parameters that describe a module set.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200163 leaf name {
164 type string;
165 description
166 "An arbitrary name of the module set.";
167 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200168 list module {
169 key "name";
170 description
171 "An entry in this list represents a module implemented by the
Michal Vaskocf296c82020-05-27 11:16:45 +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";
Radek Krejci86d106e2018-10-18 09:53:19 +0200176 uses module-identification-leafs;
Radek Krejci86d106e2018-10-18 09:53:19 +0200177 leaf namespace {
178 type inet:uri;
179 mandatory true;
180 description
181 "The XML namespace identifier for this module.";
182 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200183 uses location-leaf-list;
Radek Krejci86d106e2018-10-18 09:53:19 +0200184 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 Vaskocf296c82020-05-27 11:16:45 +0200192 uses module-implementation-parameters;
Radek Krejci86d106e2018-10-18 09:53:19 +0200193 }
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 Vaskocf296c82020-05-27 11:16:45 +0200199 module but does not implement any protocol-accessible
Radek Krejci86d106e2018-10-18 09:53:19 +0200200 objects from this revision.
201
202 Multiple entries for the same module name MAY exist. This
Michal Vaskocf296c82020-05-27 11:16:45 +0200203 can occur if multiple modules import the same module but
204 specify different revision dates in the import statements.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200205 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 Vaskocf296c82020-05-27 11:16:45 +0200214 length "0";
Radek Krejci86d106e2018-10-18 09:53:19 +0200215 }
216 }
217 description
Michal Vaskocf296c82020-05-27 11:16:45 +0200218 "The YANG module revision date.
Radek Krejci86d106e2018-10-18 09:53:19 +0200219 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 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200228 uses location-leaf-list;
Radek Krejci86d106e2018-10-18 09:53:19 +0200229 list submodule {
230 key "name";
231 description
232 "Each entry represents one submodule within the
233 parent module.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200234 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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200245 list module-set {
Michal Vaskocf296c82020-05-27 11:16:45 +0200246 key "name";
Radek Krejci86d106e2018-10-18 09:53:19 +0200247 description
Michal Vaskocf296c82020-05-27 11:16:45 +0200248 "A set of modules that may be used by one or more schemas.
Radek Krejci86d106e2018-10-18 09:53:19 +0200249
Michal Vaskocf296c82020-05-27 11:16:45 +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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200253 uses module-set-parameters;
254 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200255 list schema {
256 key "name";
257 description
258 "A datastore schema that may be used by one or more
Michal Vaskocf296c82020-05-27 11:16:45 +0200259 datastores.
Radek Krejci86d106e2018-10-18 09:53:19 +0200260
Michal Vaskocf296c82020-05-27 11:16:45 +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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200264 leaf name {
265 type string;
266 description
267 "An arbitrary name of the schema.";
268 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200269 leaf-list module-set {
270 type leafref {
271 path "../../module-set/name";
272 }
273 description
Michal Vaskocf296c82020-05-27 11:16:45 +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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200278 }
279 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200280 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 Vaskocf296c82020-05-27 11:16:45 +0200289 Each datastore entry with the same datastore schema SHOULD
Radek Krejci86d106e2018-10-18 09:53:19 +0200290 reference the same schema.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200291 leaf name {
Michal Vaskocf296c82020-05-27 11:16:45 +0200292 type ds:datastore-ref;
Radek Krejci86d106e2018-10-18 09:53:19 +0200293 description
294 "The identity of the datastore.";
295 }
296 leaf schema {
297 type leafref {
298 path "../../schema/name";
299 }
300 mandatory true;
Radek Krejci86d106e2018-10-18 09:53:19 +0200301 description
Michal Vaskocf296c82020-05-27 11:16:45 +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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200305 }
306 }
307 }
308
309 /*
310 * Top-level container
311 */
312
313 container yang-library {
314 config false;
315 description
Michal Vaskocf296c82020-05-27 11:16:45 +0200316 "Container holding the entire YANG library of this server.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200317 uses yang-library-parameters;
Michal Vaskocf296c82020-05-27 11:16:45 +0200318 leaf content-id {
Radek Krejci86d106e2018-10-18 09:53:19 +0200319 type string;
320 mandatory true;
321 description
Michal Vaskocf296c82020-05-27 11:16:45 +0200322 "A server-generated identifier of the contents of the
323 '/yang-library' tree. The server MUST change the value of
Radek Krejci86d106e2018-10-18 09:53:19 +0200324 this leaf if the information represented by the
Michal Vaskocf296c82020-05-27 11:16:45 +0200325 '/yang-library' tree, except '/yang-library/content-id', has
Radek Krejci86d106e2018-10-18 09:53:19 +0200326 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 Vaskocf296c82020-05-27 11:16:45 +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 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200347 }
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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200364 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 Vaskocf296c82020-05-27 11:16:45 +0200374 length "0";
Radek Krejci86d106e2018-10-18 09:53:19 +0200375 }
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 Vaskocf296c82020-05-27 11:16:45 +0200384
Radek Krejci86d106e2018-10-18 09:53:19 +0200385 grouping schema-leaf {
386 status deprecated;
387 description
388 "Common schema leaf parameter for modules and submodules.";
389 leaf schema {
390 type inet:uri;
Radek Krejci86d106e2018-10-18 09:53:19 +0200391 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 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200399 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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200405 uses common-leafs {
406 status deprecated;
407 }
408 uses schema-leaf {
409 status deprecated;
410 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200411 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 Vaskocf296c82020-05-27 11:16:45 +0200423 supported by the server, regardless of whether they are
Radek Krejci86d106e2018-10-18 09:53:19 +0200424 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 Vaskocf296c82020-05-27 11:16:45 +0200455 'module' entry with conformance type 'implement' for a
Radek Krejci86d106e2018-10-18 09:53:19 +0200456 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 Vaskocf296c82020-05-27 11:16:45 +0200460 than one 'module' entry for a particular module
461 name.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200462 }
463 enum import {
464 description
465 "Indicates that the server imports reusable definitions
Michal Vaskocf296c82020-05-27 11:16:45 +0200466 from the specified revision of the module but does
467 not implement any protocol-accessible objects from
Radek Krejci86d106e2018-10-18 09:53:19 +0200468 this revision.
469
Michal Vaskocf296c82020-05-27 11:16:45 +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
Radek Krejci86d106e2018-10-18 09:53:19 +0200473 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.";
Radek Krejci86d106e2018-10-18 09:53:19 +0200507 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 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200518 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 }
Radek Krejci86d106e2018-10-18 09:53:19 +0200544 }