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