blob: 01713b3a13b3e3473ec2665f78119ec8f135be25 [file] [log] [blame]
hiroki096259b2018-12-07 09:33:24 -08001module openconfig-types {
2 yang-version "1";
3
4 namespace "http://openconfig.net/yang/openconfig-types";
5
6 prefix "oc-types";
7
8 // import statements
9 import openconfig-extensions { prefix oc-ext; }
10
11 // meta
12 organization
13 "OpenConfig working group";
14
15 contact
16 "OpenConfig working group
17 netopenconfig@googlegroups.com";
18
19 description
20 "This module contains a set of general type definitions that
21 are used across OpenConfig models. It can be imported by modules
22 that make use of these types.";
23
24 oc-ext:openconfig-version "0.5.0";
25
26 revision "2018-05-05" {
27 description
28 "Add grouping of min-max-time and
29 included them to all stats with min/max/avg";
30 reference "0.5.0";
31 }
32
33 revision "2018-01-16" {
34 description
35 "Add interval to min/max/avg stats; add percentage stat";
36 reference "0.4.0";
37 }
38
39 revision "2017-08-16" {
40 description
41 "Apply fix for ieetfloat32 length parameter";
42 reference "0.3.3";
43 }
44
45 revision "2017-01-13" {
46 description
47 "Add ADDRESS_FAMILY identity";
48 reference "0.3.2";
49 }
50
51 revision "2016-11-14" {
52 description
53 "Correct length of ieeefloat32";
54 reference "0.3.1";
55 }
56
57 revision "2016-11-11" {
58 description
59 "Additional types - ieeefloat32 and routing-password";
60 reference "0.3.0";
61 }
62
63 revision "2016-05-31" {
64 description
65 "OpenConfig public release";
66 reference "0.2.0";
67 }
68
69 typedef percentage {
70 type uint8 {
71 range "0..100";
72 }
73 description
74 "Integer indicating a percentage value";
75 }
76
77 typedef std-regexp {
78 type string;
79 description
80 "This type definition is a placeholder for a standard
81 definition of a regular expression that can be utilised in
82 OpenConfig models. Further discussion is required to
83 consider the type of regular expressions that are to be
84 supported. An initial proposal is POSIX compatible.";
85 }
86
87 typedef timeticks64 {
88 type uint64;
89 description
90 "This type is based on the timeticks type defined in
91 RFC 6991, but with 64-bit width. It represents the time,
92 modulo 2^64, in hundredths of a second between two epochs.";
93 reference
94 "RFC 6991 - Common YANG Data Types";
95 }
96
97 typedef ieeefloat32 {
98 type binary {
99 length "4";
100 }
101 description
102 "An IEEE 32-bit floating point number. The format of this number
103 is of the form:
104 1-bit sign
105 8-bit exponent
106 23-bit fraction
107 The floating point value is calculated using:
108 (-1)**S * 2**(Exponent-127) * (1+Fraction)";
109 }
110
111 typedef routing-password {
112 type string;
113 description
114 "This type is indicative of a password that is used within
115 a routing protocol which can be returned in plain text to the
116 NMS by the local system. Such passwords are typically stored
117 as encrypted strings. Since the encryption used is generally
118 well known, it is possible to extract the original value from
119 the string - and hence this format is not considered secure.
120 Leaves specified with this type should not be modified by
121 the system, and should be returned to the end-user in plain
122 text. This type exists to differentiate passwords, which
123 may be sensitive, from other string leaves. It could, for
124 example, be used by the NMS to censor this data when
125 viewed by particular users.";
126 }
127
128 typedef stat-interval {
129 type uint64;
130 units nanoseconds;
131 description
132 "A time interval over which a set of statistics is computed.
133 A common usage is to report the interval over which
134 avg/min/max stats are computed and reported.";
135 }
136
137 grouping stat-interval-state {
138 description
139 "Reusable leaf definition for stats computation interval";
140
141 leaf interval {
142 type oc-types:stat-interval;
143 description
144 "If supported by the system, this reports the time interval
145 over which the min/max/average statistics are computed by
146 the system.";
147 }
148 }
149
150 grouping min-max-time {
151 description
152 "Common grouping for recording the absolute time at which
153 the minimum and maximum values occurred in the statistics";
154
155 leaf min-time {
156 type oc-types:timeticks64;
157 description
158 "The absolute time at which the minimum value occurred.
159 The value is the timestamp in nanoseconds relative to
160 the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
161 }
162
163 leaf max-time {
164 type oc-types:timeticks64;
165 description
166 "The absolute time at which the maximum value occurred.
167 The value is the timestamp in nanoseconds relative to
168 the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
169 }
170 }
171
172 grouping avg-min-max-stats-precision1 {
173 description
174 "Common nodes for recording average, minimum, and
175 maximum values for a statistic. These values all have
176 fraction-digits set to 1. Statistics are computed
177 and reported based on a moving time interval (e.g., the last
178 30s). If supported by the device, the time interval over which
179 the statistics are computed is also reported.";
180
181 leaf avg {
182 type decimal64 {
183 fraction-digits 1;
184 }
185 description
186 "The arithmetic mean value of the statistic over the
187 time interval.";
188 }
189
190 leaf min {
191 type decimal64 {
192 fraction-digits 1;
193 }
194 description
195 "The minimum value of the statistic over the time
196 interval.";
197 }
198
199 leaf max {
200 type decimal64 {
201 fraction-digits 1;
202 }
203 description
204 "The maximum value of the statitic over the time
205 interval.";
206 }
207
208 uses stat-interval-state;
209 uses min-max-time;
210 }
211
212 grouping avg-min-max-instant-stats-precision1 {
213 description
214 "Common grouping for recording an instantaneous statistic value
215 in addition to avg-min-max stats";
216
217 leaf instant {
218 type decimal64 {
219 fraction-digits 1;
220 }
221 description
222 "The instantaneous value of the statistic.";
223 }
224
225 uses avg-min-max-stats-precision1;
226 }
227
228 grouping avg-min-max-instant-stats-precision2-dB {
229 description
230 "Common grouping for recording dB values with 2 decimal
231 precision. Values include the instantaneous, average,
232 minimum, and maximum statistics. Statistics are computed
233 and reported based on a moving time interval (e.g., the last
234 30s). If supported by the device, the time interval over which
235 the statistics are computed, and the times at which the minimum
236 and maximum values occurred, are also reported.";
237
238 leaf instant {
239 type decimal64 {
240 fraction-digits 2;
241 }
242 units dB;
243 description
244 "The instantaneous value of the statistic.";
245 }
246
247 leaf avg {
248 type decimal64 {
249 fraction-digits 2;
250 }
251 units dB;
252 description
253 "The arithmetic mean value of the statistic over the
254 time interval.";
255 }
256
257 leaf min {
258 type decimal64 {
259 fraction-digits 2;
260 }
261 units dB;
262 description
263 "The minimum value of the statistic over the time interval.";
264 }
265
266 leaf max {
267 type decimal64 {
268 fraction-digits 2;
269 }
270 units dB;
271 description
272 "The maximum value of the statistic over the time
273 interval.";
274 }
275
276 uses stat-interval-state;
277 uses min-max-time;
278 }
279
280 grouping avg-min-max-instant-stats-precision2-dBm {
281 description
282 "Common grouping for recording dBm values with 2 decimal
283 precision. Values include the instantaneous, average,
284 minimum, and maximum statistics. Statistics are computed
285 and reported based on a moving time interval (e.g., the last
286 30s). If supported by the device, the time interval over which
287 the statistics are computed, and the times at which the minimum
288 and maximum values occurred, are also reported.";
289
290 leaf instant {
291 type decimal64 {
292 fraction-digits 2;
293 }
294 units dBm;
295 description
296 "The instantaneous value of the statistic.";
297 }
298
299 leaf avg {
300 type decimal64 {
301 fraction-digits 2;
302 }
303 units dBm;
304 description
305 "The arithmetic mean value of the statistic over the
306 time interval.";
307 }
308
309 leaf min {
310 type decimal64 {
311 fraction-digits 2;
312 }
313 units dBm;
314 description
315 "The minimum value of the statistic over the time
316 interval.";
317 }
318
319 leaf max {
320 type decimal64 {
321 fraction-digits 2;
322 }
323 units dBm;
324 description
325 "The maximum value of the statistic over the time interval.";
326 }
327
328 uses stat-interval-state;
329 uses min-max-time;
330 }
331
332 grouping avg-min-max-instant-stats-precision2-mA {
333 description
334 "Common grouping for recording mA values with 2 decimal
335 precision. Values include the instantaneous, average,
336 minimum, and maximum statistics. Statistics are computed
337 and reported based on a moving time interval (e.g., the last
338 30s). If supported by the device, the time interval over which
339 the statistics are computed, and the times at which the minimum
340 and maximum values occurred, are also reported.";
341
342 leaf instant {
343 type decimal64 {
344 fraction-digits 2;
345 }
346 units mA;
347 description
348 "The instantaneous value of the statistic.";
349 }
350
351 leaf avg {
352 type decimal64 {
353 fraction-digits 2;
354 }
355 units mA;
356 description
357 "The arithmetic mean value of the statistic over the
358 time interval.";
359 }
360
361 leaf min {
362 type decimal64 {
363 fraction-digits 2;
364 }
365 units mA;
366 description
367 "The minimum value of the statistic over the time
368 interval.";
369 }
370
371 leaf max {
372 type decimal64 {
373 fraction-digits 2;
374 }
375 units mA;
376 description
377 "The maximum value of the statistic over the time
378 interval.";
379 }
380
381 uses stat-interval-state;
382 uses min-max-time;
383 }
384
385 grouping avg-min-max-instant-stats-pct {
386 description
387 "Common grouping for percentage statistics.
388 Values include the instantaneous, average,
389 minimum, and maximum statistics. Statistics are computed
390 and reported based on a moving time interval (e.g., the last
391 30s). If supported by the device, the time interval over which
392 the statistics are computed, and the times at which the minimum
393 and maximum values occurred, are also reported.";
394
395 leaf instant {
396 type oc-types:percentage;
397 description
398 "The instantaneous percentage value.";
399 }
400
401 leaf avg {
402 type oc-types:percentage;
403 description
404 "The arithmetic mean value of the percentage measure of the
405 statistic over the time interval.";
406 }
407
408 leaf min {
409 type oc-types:percentage;
410 description
411 "The minimum value of the percentage measure of the
412 statistic over the time interval.";
413 }
414
415 leaf max {
416 type oc-types:percentage;
417 description
418 "The maximum value of the percentage measure of the
419 statistic over the time interval.";
420 }
421
422 uses stat-interval-state;
423 uses min-max-time;
424 }
425
426 identity ADDRESS_FAMILY {
427 description
428 "A base identity for all address families";
429 }
430
431 identity IPV4 {
432 base ADDRESS_FAMILY;
433 description
434 "The IPv4 address family";
435 }
436
437 identity IPV6 {
438 base ADDRESS_FAMILY;
439 description
440 "The IPv6 address family";
441 }
442
443 identity MPLS {
444 base ADDRESS_FAMILY;
445 description
446 "The MPLS address family";
447 }
448
449 identity L2_ETHERNET {
450 base ADDRESS_FAMILY;
451 description
452 "The 802.3 Ethernet address family";
453 }
454
455}