aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-types@2018-05-05.yang
blob: 01713b3a13b3e3473ec2665f78119ec8f135be25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
module openconfig-types {
  yang-version "1";

  namespace "http://openconfig.net/yang/openconfig-types";

  prefix "oc-types";

  // import statements
  import openconfig-extensions { prefix oc-ext; }

  // meta
  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This module contains a set of general type definitions that
    are used across OpenConfig models. It can be imported by modules
    that make use of these types.";

  oc-ext:openconfig-version "0.5.0";

  revision "2018-05-05" {
    description
      "Add grouping of min-max-time and
       included them to all stats with min/max/avg";
    reference "0.5.0";
  }

  revision "2018-01-16" {
    description
      "Add interval to min/max/avg stats; add percentage stat";
    reference "0.4.0";
  }

  revision "2017-08-16" {
    description
      "Apply fix for ieetfloat32 length parameter";
    reference "0.3.3";
  }

  revision "2017-01-13" {
    description
      "Add ADDRESS_FAMILY identity";
    reference "0.3.2";
  }

  revision "2016-11-14" {
    description
      "Correct length of ieeefloat32";
    reference "0.3.1";
  }

  revision "2016-11-11" {
    description
      "Additional types - ieeefloat32 and routing-password";
    reference "0.3.0";
  }

  revision "2016-05-31" {
    description
      "OpenConfig public release";
    reference "0.2.0";
  }

  typedef percentage {
    type uint8 {
      range "0..100";
    }
    description
      "Integer indicating a percentage value";
  }

  typedef std-regexp {
    type string;
    description
      "This type definition is a placeholder for a standard
      definition of a regular expression that can be utilised in
      OpenConfig models. Further discussion is required to
      consider the type of regular expressions that are to be
      supported. An initial proposal is POSIX compatible.";
  }

  typedef timeticks64 {
    type uint64;
    description
     "This type is based on the timeticks type defined in
     RFC 6991, but with 64-bit width.  It represents the time,
     modulo 2^64, in hundredths of a second between two epochs.";
    reference
      "RFC 6991 - Common YANG Data Types";
  }

  typedef ieeefloat32 {
    type binary {
      length "4";
    }
    description
      "An IEEE 32-bit floating point number. The format of this number
      is of the form:
        1-bit  sign
        8-bit  exponent
        23-bit fraction
      The floating point value is calculated using:
        (-1)**S * 2**(Exponent-127) * (1+Fraction)";
  }

  typedef routing-password {
    type string;
    description
      "This type is indicative of a password that is used within
      a routing protocol which can be returned in plain text to the
      NMS by the local system. Such passwords are typically stored
      as encrypted strings. Since the encryption used is generally
      well known, it is possible to extract the original value from
      the string - and hence this format is not considered secure.
      Leaves specified with this type should not be modified by
      the system, and should be returned to the end-user in plain
      text. This type exists to differentiate passwords, which
      may be sensitive, from other string leaves. It could, for
      example, be used by the NMS to censor this data when
      viewed by particular users.";
  }

  typedef stat-interval {
    type uint64;
    units nanoseconds;
    description
      "A time interval over which a set of statistics is computed.
      A common usage is to report the interval over which
      avg/min/max stats are computed and reported.";
  }

  grouping stat-interval-state {
    description
      "Reusable leaf definition for stats computation interval";

    leaf interval {
      type oc-types:stat-interval;
      description
        "If supported by the system, this reports the time interval
        over which the min/max/average statistics are computed by
        the system.";
    }
  }

  grouping min-max-time {
    description
      "Common grouping for recording the absolute time at which
      the minimum and maximum values occurred in the statistics";

    leaf min-time {
      type oc-types:timeticks64;
      description
        "The absolute time at which the minimum value occurred.
         The value is the timestamp in nanoseconds relative to
          the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
    }

    leaf max-time {
      type oc-types:timeticks64;
      description
        "The absolute time at which the maximum value occurred.
         The value is the timestamp in nanoseconds relative to
          the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
    }
  }

  grouping avg-min-max-stats-precision1 {
    description
      "Common nodes for recording average, minimum, and
      maximum values for a statistic.  These values all have
      fraction-digits set to 1.  Statistics are computed
      and reported based on a moving time interval (e.g., the last
      30s).  If supported by the device, the time interval over which
      the statistics are computed is also reported.";

    leaf avg {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The arithmetic mean value of the statistic over the
        time interval.";
    }

    leaf min {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The minimum value of the statistic over the time
        interval.";
    }

    leaf max {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The maximum value of the statitic over the time
        interval.";
    }

    uses stat-interval-state;
    uses min-max-time;
  }

  grouping avg-min-max-instant-stats-precision1 {
    description
      "Common grouping for recording an instantaneous statistic value
      in addition to avg-min-max stats";

    leaf instant {
      type decimal64 {
        fraction-digits 1;
      }
      description
        "The instantaneous value of the statistic.";
    }

    uses avg-min-max-stats-precision1;
  }

  grouping avg-min-max-instant-stats-precision2-dB {
    description
      "Common grouping for recording dB values with 2 decimal
      precision. Values include the instantaneous, average,
      minimum, and maximum statistics.  Statistics are computed
      and reported based on a moving time interval (e.g., the last
      30s).  If supported by the device, the time interval over which
      the statistics are computed, and the times at which the minimum
      and maximum values occurred, are also reported.";

    leaf instant {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "The instantaneous value of the statistic.";
    }

    leaf avg {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "The arithmetic mean value of the statistic over the
        time interval.";
    }

    leaf min {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "The minimum value of the statistic over the time interval.";
    }

    leaf max {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "The maximum value of the statistic over the time
        interval.";
    }

    uses stat-interval-state;
    uses min-max-time;
  }

  grouping avg-min-max-instant-stats-precision2-dBm {
    description
      "Common grouping for recording dBm values with 2 decimal
      precision. Values include the instantaneous, average,
      minimum, and maximum statistics.  Statistics are computed
      and reported based on a moving time interval (e.g., the last
      30s).  If supported by the device, the time interval over which
      the statistics are computed, and the times at which the minimum
      and maximum values occurred, are also reported.";

    leaf instant {
      type decimal64 {
        fraction-digits 2;
      }
      units dBm;
      description
        "The instantaneous value of the statistic.";
    }

    leaf avg {
      type decimal64 {
        fraction-digits 2;
      }
      units dBm;
      description
        "The arithmetic mean value of the statistic over the
        time interval.";
    }

    leaf min {
      type decimal64 {
        fraction-digits 2;
      }
      units dBm;
      description
        "The minimum value of the statistic over the time
        interval.";
    }

    leaf max {
      type decimal64 {
        fraction-digits 2;
      }
      units dBm;
      description
        "The maximum value of the statistic over the time interval.";
    }

    uses stat-interval-state;
    uses min-max-time;
  }

  grouping avg-min-max-instant-stats-precision2-mA {
    description
      "Common grouping for recording mA values with 2 decimal
      precision. Values include the instantaneous, average,
      minimum, and maximum statistics.  Statistics are computed
      and reported based on a moving time interval (e.g., the last
      30s).  If supported by the device, the time interval over which
      the statistics are computed, and the times at which the minimum
      and maximum values occurred, are also reported.";

    leaf instant {
      type decimal64 {
        fraction-digits 2;
      }
      units mA;
      description
        "The instantaneous value of the statistic.";
    }

    leaf avg {
      type decimal64 {
        fraction-digits 2;
      }
      units mA;
      description
        "The arithmetic mean value of the statistic over the
        time interval.";
    }

    leaf min {
      type decimal64 {
        fraction-digits 2;
      }
      units mA;
      description
        "The minimum value of the statistic over the time
        interval.";
    }

    leaf max {
      type decimal64 {
        fraction-digits 2;
      }
      units mA;
      description
        "The maximum value of the statistic over the time
        interval.";
    }

    uses stat-interval-state;
    uses min-max-time;
  }

  grouping avg-min-max-instant-stats-pct {
    description
      "Common grouping for percentage statistics.
      Values include the instantaneous, average,
      minimum, and maximum statistics.  Statistics are computed
      and reported based on a moving time interval (e.g., the last
      30s).  If supported by the device, the time interval over which
      the statistics are computed, and the times at which the minimum
      and maximum values occurred, are also reported.";

    leaf instant {
      type oc-types:percentage;
      description
        "The instantaneous percentage value.";
    }

    leaf avg {
      type oc-types:percentage;
      description
        "The arithmetic mean value of the percentage measure of the
        statistic over the time interval.";
    }

    leaf min {
      type oc-types:percentage;
      description
        "The minimum value of the percentage measure of the
        statistic over the time interval.";
    }

    leaf max {
      type oc-types:percentage;
      description
        "The maximum value of the percentage measure of the
        statistic over the time interval.";
    }

    uses stat-interval-state;
    uses min-max-time;
  }

  identity ADDRESS_FAMILY {
    description
      "A base identity for all address families";
  }

  identity IPV4 {
    base ADDRESS_FAMILY;
    description
      "The IPv4 address family";
  }

  identity IPV6 {
    base ADDRESS_FAMILY;
    description
      "The IPv6 address family";
  }

  identity MPLS {
    base ADDRESS_FAMILY;
    description
      "The MPLS address family";
  }

  identity L2_ETHERNET {
    base ADDRESS_FAMILY;
    description
      "The 802.3 Ethernet address family";
  }

}