Rename restconf-nb-rfc8040 to restconf-nb
[netconf.git] / restconf / restconf-nb / src / test / resources / modules / modules-behind-mount-point / ietf-yang-library@2016-06-21.yang
1 module ietf-yang-library {
2   namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library";
3   prefix "yanglib";
4   import ietf-yang-types {
5     prefix yang;
6   }
7   import ietf-inet-types {
8     prefix inet;
9   }
10   organization
11     "IETF NETCONF (Network Configuration) Working Group";
12   contact
13     "WG Web:   <https://datatracker.ietf.org/wg/netconf/>
14      WG List:  <mailto:netconf@ietf.org>
15      WG Chair: Mehmet Ersue
16                <mailto:mehmet.ersue@nsn.com>
17      WG Chair: Mahesh Jethanandani
18                <mailto:mjethanandani@gmail.com>
19      Editor:   Andy Bierman
20                <mailto:andy@yumaworks.com>
21      Editor:   Martin Bjorklund
22                <mailto:mbj@tail-f.com>
23      Editor:   Kent Watsen
24                <mailto:kwatsen@juniper.net>";
25   description
26     "This module contains monitoring information about the YANG
27      modules and submodules that are used within a YANG-based
28      server.
29      Copyright (c) 2016 IETF Trust and the persons identified as
30      authors of the code.  All rights reserved.
31      Redistribution and use in source and binary forms, with or
32      without modification, is permitted pursuant to, and subject
33      to the license terms contained in, the Simplified BSD License
34      set forth in Section 4.c of the IETF Trust's Legal Provisions
35      Relating to IETF Documents
36      (http://trustee.ietf.org/license-info).
37      This version of this YANG module is part of RFC 7895; see
38      the RFC itself for full legal notices.";
39   revision 2016-06-21 {
40     description
41       "Initial revision.";
42     reference
43       "RFC 7895: YANG Module Library.";
44   }
45   /*
46    * Typedefs
47    */
48   typedef revision-identifier {
49     type string {
50       pattern '\d{4}-\d{2}-\d{2}';
51     }
52     description
53       "Represents a specific date in YYYY-MM-DD format.";
54   }
55   /*
56    * Groupings
57    */
58   grouping module-list {
59     description
60       "The module data structure is represented as a grouping
61        so it can be reused in configuration or another monitoring
62        data structure.";
63     grouping common-leafs {
64       description
65         "Common parameters for YANG modules and submodules.";
66       leaf name {
67         type yang:yang-identifier;
68         description
69           "The YANG module or submodule name.";
70       }
71       leaf revision {
72         type union {
73           type revision-identifier;
74           type string { length 0; }
75         }
76         description
77           "The YANG module or submodule revision date.
78            A zero-length string is used if no revision statement
79            is present in the YANG module or submodule.";
80       }
81     }
82     grouping schema-leaf {
83       description
84         "Common schema leaf parameter for modules and submodules.";
85       leaf schema {
86         type inet:uri;
87         description
88           "Contains a URL that represents the YANG schema
89            resource for this module or submodule.
90            This leaf will only be present if there is a URL
91            available for retrieval of the schema for this entry.";
92       }
93     }
94     list module {
95       key "name revision";
96       description
97         "Each entry represents one revision of one module
98          currently supported by the server.";
99       uses common-leafs;
100       uses schema-leaf;
101       leaf namespace {
102         type inet:uri;
103         mandatory true;
104         description
105           "The XML namespace identifier for this module.";
106       }
107       leaf-list feature {
108         type yang:yang-identifier;
109         description
110           "List of YANG feature names from this module that are
111            supported by the server, regardless of whether they are
112            defined in the module or any included submodule.";
113       }
114       list deviation {
115         key "name revision";
116         description
117           "List of YANG deviation module names and revisions
118            used by this server to modify the conformance of
119            the module associated with this entry.  Note that
120            the same module can be used for deviations for
121            multiple modules, so the same entry MAY appear
122            within multiple 'module' entries.
123            The deviation module MUST be present in the 'module'
124            list, with the same name and revision values.
125            The 'conformance-type' value will be 'implement' for
126            the deviation module.";
127         uses common-leafs;
128       }
129       leaf conformance-type {
130         type enumeration {
131           enum implement {
132             description
133               "Indicates that the server implements one or more
134                protocol-accessible objects defined in the YANG module
135                identified in this entry.  This includes deviation
136                statements defined in the module.
137                For YANG version 1.1 modules, there is at most one
138                module entry with conformance type 'implement' for a
139                particular module name, since YANG 1.1 requires that,
140                at most, one revision of a module is implemented.
141                For YANG version 1 modules, there SHOULD NOT be more
142                than one module entry for a particular module name.";
143           }
144           enum import {
145             description
146               "Indicates that the server imports reusable definitions
147                from the specified revision of the module but does
148                not implement any protocol-accessible objects from
149                this revision.
150                Multiple module entries for the same module name MAY
151                exist.  This can occur if multiple modules import the
152                same module but specify different revision dates in
153                the import statements.";
154           }
155         }
156         mandatory true;
157         description
158           "Indicates the type of conformance the server is claiming
159            for the YANG module identified by this entry.";
160       }
161       list submodule {
162         key "name revision";
163         description
164           "Each entry represents one submodule within the
165            parent module.";
166         uses common-leafs;
167         uses schema-leaf;
168       }
169     }
170   }
171   /*
172    * Operational state data nodes
173    */
174   container modules-state {
175     config false;
176     description
177       "Contains YANG module monitoring information.";
178     leaf module-set-id {
179       type string;
180       mandatory true;
181       description
182         "Contains a server-specific identifier representing
183          the current set of modules and submodules.  The
184          server MUST change the value of this leaf if the
185          information represented by the 'module' list instances
186          has changed.";
187     }
188     uses module-list;
189   }
190   /*
191    * Notifications
192    */
193   notification yang-library-change {
194     description
195       "Generated when the set of modules and submodules supported
196        by the server has changed.";
197     leaf module-set-id {
198       type leafref {
199         path "/yanglib:modules-state/yanglib:module-set-id";
200       }
201       mandatory true;
202       description
203         "Contains the module-set-id value representing the
204          set of modules and submodules supported at the server at
205          the time the notification is generated.";
206     }
207   }
208 }