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