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