blob: 58d95c1ec89361f509b4e1ac27403c7b47fb0b22 [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";
4 prefix "yanglib";
5
6 import ietf-yang-types {
7 prefix yang;
8 reference "RFC 6991: Common YANG Data Types.";
9 }
10 import ietf-inet-types {
11 prefix inet;
12 reference "RFC 6991: Common YANG Data Types.";
13 }
14 import ietf-datastores {
15 prefix ds;
16 reference "I-D.ietf-revised-datastores:
17 Network Management Datastore Architecture.";
18 }
19
20 organization
21 "IETF NETCONF (Network Configuration) Working Group";
22
23 contact
24 "WG Web: <http://tools.ietf.org/wg/netconf/>
25 WG List: <mailto:netconf@ietf.org>
26
27 Author: Andy Bierman
28 <mailto:andy@yumaworks.com>
29
30 Author: Martin Bjorklund
31 <mailto:mbj@tail-f.com>
32
33 Author: Juergen Schoenwaelder
34 <mailto:j.schoenwaelder@jacobs-university.de>
35
36 Author: Kent Watsen
37 <mailto:kwatsen@juniper.net>
38
39 Author: Rob Wilton
40 <rwilton@cisco.com>";
41
42 description
43 "This module contains information about the YANG server instance,
44 including the modules and datastores the server supports, and
45 which modules are present in which datastores.
46
47 Copyright (c) 2018 IETF Trust and the persons identified as
48 authors of the code. All rights reserved.
49
50 Redistribution and use in source and binary forms, with or
51 without modification, is permitted pursuant to, and subject
52 to the license terms contained in, the Simplified BSD License
53 set forth in Section 4.c of the IETF Trust's Legal Provisions
54 Relating to IETF Documents
55 (http://trustee.ietf.org/license-info).
56
57 This version of this YANG module is part of RFC XXXX; see
58 the RFC itself for full legal notices.";
59
60 // RFC Ed.: update the date below with the date of RFC publication
61 // and remove this note.
62 // RFC Ed.: replace XXXX with actual RFC number and remove this
63 // note.
64 revision 2018-01-17 {
65 description
66 "Added support for multiple datastores.";
67 reference
68 "RFC XXXX: YANG Library.";
69 }
70 revision 2016-04-09 {
71 description
72 "Initial revision.";
73 reference
74 "RFC 7895: YANG Module Library.";
75 }
76
77 /*
78 * Typedefs
79 */
80
81 typedef revision-identifier {
82 type string {
83 pattern '\d{4}-\d{2}-\d{2}';
84 }
85 description
86 "Represents a specific date in YYYY-MM-DD format.";
87 }
88
89 /*
90 * Groupings
91 */
92
93 grouping module-identification-leafs {
94 description
95 "Parameters for identifying YANG modules and submodules.";
96
97 leaf name {
98 type yang:yang-identifier;
99 mandatory true;
100 description
101 "The YANG module or submodule name.";
102 }
103 leaf revision {
104 type revision-identifier;
105 description
106 "The YANG module or submodule revision date. If no revision
107 statement is present in the YANG module or submodule, this
108 leaf is not instantiated.";
109 }
110 }
111
112 grouping location-leaf-list {
113 description
114 "Common location leaf list parameter for modules and
115 submodules.";
116
117 leaf-list location {
118 type inet:uri;
119 description
120 "Contains a URL that represents the YANG schema
121 resource for this module or submodule.
122
123 This leaf will only be present if there is a URL
124 available for retrieval of the schema for this entry.";
125 }
126 }
127
128 grouping implementation-parameters {
129 description
130 "Parameters for describing the implementation of a module.";
131
132 list feature {
133 key "name";
134 description
135 "List of YANG feature names from this module that are
136 supported by the server, regardless whether they are defined
137 in the module or any included submodule.";
138 leaf name {
139 type yang:yang-identifier;
140 description
141 "A feature supported by the server.";
142 }
143 }
144 list deviation {
145 key "module";
146 description
147 "List of YANG deviation modules used by this server to modify
148 the conformance of the module associated with this entry.
149 Note that the same module can be used for deviations for
150 multiple modules, so the same entry MAY appear within
151 multiple 'module' entries.";
152
153 leaf module {
154 type leafref {
155 path "../../../module/name";
156 }
157 description
158 "A module that deviates the module associated with this
159 entry.";
160 }
161 }
162 }
163
164 grouping module-set-parameters {
165 description
166 "A set of parameters that describe a module set.";
167
168 leaf name {
169 type string;
170 description
171 "An arbitrary name of the module set.";
172 }
173 leaf checksum {
174 type string;
175 config false;
176 mandatory true;
177 description
178 "A server-generated checksum of the contents of the module
179 set. The server MUST change the value of this leaf if the
180 information represented by the module set, except
181 'checksum', has changed.";
182 }
183 list module {
184 key "name";
185 description
186 "An entry in this list represents a module implemented by the
187 server with a particular set of supported features and
188 deviations.
189
190 The server implements one or more protocol-accessible
191 objects defined in the YANG module identified in this entry.
192 This includes deviation statements defined in the module.";
193
194 uses module-identification-leafs;
195
196 leaf namespace {
197 type inet:uri;
198 mandatory true;
199 description
200 "The XML namespace identifier for this module.";
201 }
202
203 uses location-leaf-list;
204
205 list submodule {
206 key "name";
207 description
208 "Each entry represents one submodule within the
209 parent module.";
210 uses module-identification-leafs;
211 uses location-leaf-list;
212 }
213
214 uses implementation-parameters;
215 }
216 list import-only-module {
217 key "name revision";
218 description
219 "An entry in this list indicates that the server imports
220 reusable definitions from the specified revision of the
221 module, but does not implement any protocol accessible
222 objects from this revision.
223
224 Multiple entries for the same module name MAY exist. This
225 can occur if multiple modules import the same module, but
226 specify different revision-dates in the import statements.";
227
228 leaf name {
229 type yang:yang-identifier;
230 description
231 "The YANG module name.";
232 }
233 leaf revision {
234 type union {
235 type revision-identifier;
236 type string {
237 length 0;
238 }
239 }
240 description
241 "The YANG module or revision date.
242 A zero-length string is used if no revision statement
243 is present in the YANG module.";
244 }
245 leaf namespace {
246 type inet:uri;
247 mandatory true;
248 description
249 "The XML namespace identifier for this module.";
250 }
251
252 uses location-leaf-list;
253
254 list submodule {
255 key "name";
256 description
257 "Each entry represents one submodule within the
258 parent module.";
259
260 uses module-identification-leafs;
261 uses location-leaf-list;
262 }
263 }
264 }
265
266 grouping yang-library-parameters {
267 description
268 "The YANG library data structure is represented as a grouping
269 so it can be reused in configuration or another monitoring
270 data structure.";
271
272 list module-set {
273 key name;
274 description
275 "A set of modules that may be used by one or more schemas.";
276
277 uses module-set-parameters;
278 }
279
280 list schema {
281 key "name";
282 description
283 "A datastore schema that may be used by one or more
284 datastores.";
285
286 leaf name {
287 type string;
288 description
289 "An arbitrary name of the schema.";
290 }
291 leaf checksum {
292 type string;
293 config false;
294 mandatory true;
295 description
296 "A server-generated checksum of the contents of the schema.
297 The server MUST change the value of this leaf if the
298 information represented by the schema, except 'checksum',
299 has changed.";
300 }
301 leaf-list module-set {
302 type leafref {
303 path "../../module-set/name";
304 }
305 description
306 "A set of module-sets that are included in this schema.";
307 }
308 }
309
310 list datastore {
311 key "name";
312 description
313 "A datastore supported by this server.
314
315 Each datastore indicates which schema it supports.
316
317 The server MUST instantiate one entry in this list per
318 specific datastore it supports.
319
320 Each datstore entry with the same datastore schema SHOULD
321 reference the same schema.";
322
323 leaf name {
324 type identityref {
325 base ds:datastore;
326 }
327 description
328 "The identity of the datastore.";
329 }
330 leaf schema {
331 type leafref {
332 path "../../schema/name";
333 }
334 mandatory true;
335
336 description
337 "A reference to the schema supported by this datastore.";
338 }
339 }
340 }
341
342 /*
343 * Top-level container
344 */
345
346 container yang-library {
347 config false;
348 description
349 "Container providing all the YANG meta information the
350 server possesses.";
351
352 uses yang-library-parameters;
353
354 leaf checksum {
355 type string;
356 mandatory true;
357 description
358 "A server-generated checksum of the contents of the
359 'yang-library' tree. The server MUST change the value of
360 this leaf if the information represented by the
361 'yang-library' tree, except 'yang-library/checksum', has
362 changed.";
363 }
364 }
365
366 /*
367 * Notifications
368 */
369
370 notification yang-library-update {
371 description
372 "Generated when any YANG library information on the
373 server has changed.";
374 }
375
376 /*
377 * Legacy groupings
378 */
379
380 grouping module-list {
381 status deprecated;
382 description
383 "The module data structure is represented as a grouping
384 so it can be reused in configuration or another monitoring
385 data structure.";
386
387 grouping common-leafs {
388 status deprecated;
389 description
390 "Common parameters for YANG modules and submodules.";
391
392 leaf name {
393 type yang:yang-identifier;
394 status deprecated;
395 description
396 "The YANG module or submodule name.";
397 }
398 leaf revision {
399 type union {
400 type revision-identifier;
401 type string {
402 length 0;
403 }
404 }
405 status deprecated;
406 description
407 "The YANG module or submodule revision date.
408 A zero-length string is used if no revision statement
409 is present in the YANG module or submodule.";
410 }
411 }
412 grouping schema-leaf {
413 status deprecated;
414 description
415 "Common schema leaf parameter for modules and submodules.";
416 leaf schema {
417 type inet:uri;
418 status deprecated;
419 description
420 "Contains a URL that represents the YANG schema
421 resource for this module or submodule.
422
423 This leaf will only be present if there is a URL
424 available for retrieval of the schema for this entry.";
425 }
426 }
427
428 list module {
429 key "name revision";
430 status deprecated;
431 description
432 "Each entry represents one revision of one module
433 currently supported by the server.";
434
435 uses common-leafs {
436 status deprecated;
437 }
438 uses schema-leaf {
439 status deprecated;
440 }
441
442 leaf namespace {
443 type inet:uri;
444 mandatory true;
445 status deprecated;
446 description
447 "The XML namespace identifier for this module.";
448 }
449 leaf-list feature {
450 type yang:yang-identifier;
451 status deprecated;
452 description
453 "List of YANG feature names from this module that are
454 supported by the server, regardless whether they are
455 defined in the module or any included submodule.";
456 }
457 list deviation {
458 key "name revision";
459 status deprecated;
460 description
461 "List of YANG deviation module names and revisions
462 used by this server to modify the conformance of
463 the module associated with this entry. Note that
464 the same module can be used for deviations for
465 multiple modules, so the same entry MAY appear
466 within multiple 'module' entries.
467
468 The deviation module MUST be present in the 'module'
469 list, with the same name and revision values.
470 The 'conformance-type' value will be 'implement' for
471 the deviation module.";
472 uses common-leafs {
473 status deprecated;
474 }
475 }
476 leaf conformance-type {
477 type enumeration {
478 enum implement {
479 description
480 "Indicates that the server implements one or more
481 protocol-accessible objects defined in the YANG module
482 identified in this entry. This includes deviation
483 statements defined in the module.
484
485 For YANG version 1.1 modules, there is at most one
486 module entry with conformance type 'implement' for a
487 particular module name, since YANG 1.1 requires that
488 at most one revision of a module is implemented.
489
490 For YANG version 1 modules, there SHOULD NOT be more
491 than one module entry for a particular module name.";
492 }
493 enum import {
494 description
495 "Indicates that the server imports reusable definitions
496 from the specified revision of the module, but does
497 not implement any protocol accessible objects from
498 this revision.
499
500 Multiple module entries for the same module name MAY
501 exist. This can occur if multiple modules import the
502 same module, but specify different revision-dates in
503 the import statements.";
504 }
505 }
506 mandatory true;
507 status deprecated;
508 description
509 "Indicates the type of conformance the server is claiming
510 for the YANG module identified by this entry.";
511 }
512 list submodule {
513 key "name revision";
514 status deprecated;
515 description
516 "Each entry represents one submodule within the
517 parent module.";
518 uses common-leafs {
519 status deprecated;
520 }
521 uses schema-leaf {
522 status deprecated;
523 }
524 }
525 }
526 }
527
528 /*
529 * Legacy operational state data nodes
530 */
531
532 container modules-state {
533 config false;
534 status deprecated;
535 description
536 "Contains YANG module monitoring information.";
537
538 leaf module-set-id {
539 type string;
540 mandatory true;
541 status deprecated;
542 description
543 "Contains a server-specific identifier representing
544 the current set of modules and submodules. The
545 server MUST change the value of this leaf if the
546 information represented by the 'module' list instances
547 has changed.";
548 }
549
550 uses module-list {
551 status deprecated;
552 }
553 }
554
555 /*
556 * Legacy notifications
557 */
558
559 notification yang-library-change {
560 status deprecated;
561 description
562 "Generated when the set of modules and submodules supported
563 by the server has changed.";
564 leaf module-set-id {
565 type leafref {
566 path "/yanglib:modules-state/yanglib:module-set-id";
567 }
568 mandatory true;
569 status deprecated;
570 description
571 "Contains the module-set-id value representing the
572 set of modules and submodules supported at the server
573 at the time the notification is generated.";
574 }
575 }
576
577 }