Delete netconf
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / resources / full-versions / yangs / ietf-yang-types@2013-05-16.yang
1 module ietf-yang-types {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
4   prefix "yang";
5
6   organization
7    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
8
9   contact
10    "WG Web:   <http://tools.ietf.org/wg/netmod/>
11     WG List:  <mailto:netmod@ietf.org>
12
13     WG Chair: David Kessens
14               <mailto:david.kessens@nsn.com>
15
16     WG Chair: Juergen Schoenwaelder
17               <mailto:j.schoenwaelder@jacobs-university.de>
18
19     Editor:   Juergen Schoenwaelder
20               <mailto:j.schoenwaelder@jacobs-university.de>";
21
22   description
23    "This module contains a collection of generally useful derived
24     YANG data types.
25
26     Copyright (c) 2013 IETF Trust and the persons identified as
27     authors of the code.  All rights reserved.
28
29     Redistribution and use in source and binary forms, with or
30     without modification, is permitted pursuant to, and subject
31     to the license terms contained in, the Simplified BSD License
32     set forth in Section 4.c of the IETF Trust's Legal Provisions
33     Relating to IETF Documents
34     (http://trustee.ietf.org/license-info).
35
36     This version of this YANG module is part of RFC XXXX; see
37     the RFC itself for full legal notices.";
38
39   revision 2013-05-16 {
40     description
41      "This revision adds the following new data types:
42       - yang-identifier
43       - hex-string
44       - uuid
45       - dotted-quad";
46     reference
47      "RFC XXXX: Common YANG Data Types";
48   }
49
50   revision 2010-09-24 {
51     description
52      "Initial revision.";
53     reference
54      "RFC 6021: Common YANG Data Types";
55   }
56
57   /*** collection of counter and gauge types ***/
58
59   typedef counter32 {
60     type uint32;
61     description
62      "The counter32 type represents a non-negative integer
63       that monotonically increases until it reaches a
64       maximum value of 2^32-1 (4294967295 decimal), when it
65       wraps around and starts increasing again from zero.
66
67       Counters have no defined 'initial' value, and thus, a
68       single value of a counter has (in general) no information
69       content.  Discontinuities in the monotonically increasing
70       value normally occur at re-initialization of the
71       management system, and at other times as specified in the
72       description of a schema node using this type.  If such
73       other times can occur, for example, the creation of
74       a schema node of type counter32 at times other than
75       re-initialization, then a corresponding schema node
76       should be defined, with an appropriate type, to indicate
77       the last discontinuity.
78
79       The counter32 type should not be used for configuration
80       schema nodes.  A default statement SHOULD NOT be used in
81       combination with the type counter32.
82
83       In the value set and its semantics, this type is equivalent
84       to the Counter32 type of the SMIv2.";
85     reference
86      "RFC 2578: Structure of Management Information Version 2
87                 (SMIv2)";
88   }
89
90   typedef zero-based-counter32 {
91     type yang:counter32;
92     default "0";
93     description
94      "The zero-based-counter32 type represents a counter32
95       that has the defined 'initial' value zero.
96
97       A schema node of this type will be set to zero (0) on creation
98       and will thereafter increase monotonically until it reaches
99       a maximum value of 2^32-1 (4294967295 decimal), when it
100       wraps around and starts increasing again from zero.
101
102       Provided that an application discovers a new schema node
103       of this type within the minimum time to wrap, it can use the
104       'initial' value as a delta.  It is important for a management
105       station to be aware of this minimum time and the actual time
106       between polls, and to discard data if the actual time is too
107       long or there is no defined minimum time.
108
109       In the value set and its semantics, this type is equivalent
110       to the ZeroBasedCounter32 textual convention of the SMIv2.";
111     reference
112       "RFC 4502: Remote Network Monitoring Management Information
113                  Base Version 2";
114   }
115
116   typedef counter64 {
117     type uint64;
118     description
119      "The counter64 type represents a non-negative integer
120       that monotonically increases until it reaches a
121       maximum value of 2^64-1 (18446744073709551615 decimal),
122       when it wraps around and starts increasing again from zero.
123
124       Counters have no defined 'initial' value, and thus, a
125       single value of a counter has (in general) no information
126       content.  Discontinuities in the monotonically increasing
127       value normally occur at re-initialization of the
128       management system, and at other times as specified in the
129       description of a schema node using this type.  If such
130       other times can occur, for example, the creation of
131       a schema node of type counter64 at times other than
132       re-initialization, then a corresponding schema node
133       should be defined, with an appropriate type, to indicate
134       the last discontinuity.
135
136       The counter64 type should not be used for configuration
137       schema nodes.  A default statement SHOULD NOT be used in
138       combination with the type counter64.
139
140       In the value set and its semantics, this type is equivalent
141       to the Counter64 type of the SMIv2.";
142     reference
143      "RFC 2578: Structure of Management Information Version 2
144                 (SMIv2)";
145   }
146
147   typedef zero-based-counter64 {
148     type yang:counter64;
149     default "0";
150     description
151      "The zero-based-counter64 type represents a counter64 that
152       has the defined 'initial' value zero.
153
154       A schema node of this type will be set to zero (0) on creation
155       and will thereafter increase monotonically until it reaches
156       a maximum value of 2^64-1 (18446744073709551615 decimal),
157       when it wraps around and starts increasing again from zero.
158
159       Provided that an application discovers a new schema node
160       of this type within the minimum time to wrap, it can use the
161       'initial' value as a delta.  It is important for a management
162       station to be aware of this minimum time and the actual time
163       between polls, and to discard data if the actual time is too
164       long or there is no defined minimum time.
165
166       In the value set and its semantics, this type is equivalent
167       to the ZeroBasedCounter64 textual convention of the SMIv2.";
168     reference
169      "RFC 2856: Textual Conventions for Additional High Capacity
170                 Data Types";
171   }
172
173   typedef gauge32 {
174     type uint32;
175     description
176      "The gauge32 type represents a non-negative integer, which
177       may increase or decrease, but shall never exceed a maximum
178       value, nor fall below a minimum value.  The maximum value
179       cannot be greater than 2^32-1 (4294967295 decimal), and
180       the minimum value cannot be smaller than 0.  The value of
181       a gauge32 has its maximum value whenever the information
182       being modeled is greater than or equal to its maximum
183       value, and has its minimum value whenever the information
184       being modeled is smaller than or equal to its minimum value.
185       If the information being modeled subsequently decreases
186       below (increases above) the maximum (minimum) value, the
187       gauge32 also decreases (increases).
188
189       In the value set and its semantics, this type is equivalent
190       to the Gauge32 type of the SMIv2.";
191     reference
192      "RFC 2578: Structure of Management Information Version 2
193                 (SMIv2)";
194   }
195
196   typedef gauge64 {
197     type uint64;
198     description
199      "The gauge64 type represents a non-negative integer, which
200       may increase or decrease, but shall never exceed a maximum
201       value, nor fall below a minimum value.  The maximum value
202       cannot be greater than 2^64-1 (18446744073709551615), and
203       the minimum value cannot be smaller than 0.  The value of
204       a gauge64 has its maximum value whenever the information
205       being modeled is greater than or equal to its maximum
206       value, and has its minimum value whenever the information
207       being modeled is smaller than or equal to its minimum value.
208       If the information being modeled subsequently decreases
209       below (increases above) the maximum (minimum) value, the
210       gauge64 also decreases (increases).
211
212       In the value set and its semantics, this type is equivalent
213       to the CounterBasedGauge64 SMIv2 textual convention defined
214       in RFC 2856";
215     reference
216      "RFC 2856: Textual Conventions for Additional High Capacity
217                 Data Types";
218   }
219
220   /*** collection of identifier related types ***/
221
222   typedef object-identifier {
223     type string {
224       pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'
225             + '(\.(0|([1-9]\d*)))*';
226     }
227     description
228      "The object-identifier type represents administratively
229       assigned names in a registration-hierarchical-name tree.
230
231       Values of this type are denoted as a sequence of numerical
232       non-negative sub-identifier values.  Each sub-identifier
233       value MUST NOT exceed 2^32-1 (4294967295).  Sub-identifiers
234       are separated by single dots and without any intermediate
235       whitespace.
236
237       The ASN.1 standard restricts the value space of the first
238       sub-identifier to 0, 1, or 2.  Furthermore, the value space
239       of the second sub-identifier is restricted to the range
240       0 to 39 if the first sub-identifier is 0 or 1.  Finally,
241       the ASN.1 standard requires that an object identifier
242       has always at least two sub-identifier.  The pattern
243       captures these restrictions.
244
245       Although the number of sub-identifiers is not limited,
246       module designers should realize that there may be
247       implementations that stick with the SMIv2 limit of 128
248       sub-identifiers.
249
250       This type is a superset of the SMIv2 OBJECT IDENTIFIER type
251       since it is not restricted to 128 sub-identifiers.  Hence,
252       this type SHOULD NOT be used to represent the SMIv2 OBJECT
253       IDENTIFIER type, the object-identifier-128 type SHOULD be
254       used instead.";
255     reference
256      "ISO9834-1: Information technology -- Open Systems
257       Interconnection -- Procedures for the operation of OSI
258       Registration Authorities: General procedures and top
259       arcs of the ASN.1 Object Identifier tree";
260   }
261
262   typedef object-identifier-128 {
263     type object-identifier {
264       pattern '\d*(\.\d*){1,127}';
265     }
266     description
267      "This type represents object-identifiers restricted to 128
268       sub-identifiers.
269
270       In the value set and its semantics, this type is equivalent
271       to the OBJECT IDENTIFIER type of the SMIv2.";
272     reference
273      "RFC 2578: Structure of Management Information Version 2
274                 (SMIv2)";
275   }
276
277   typedef yang-identifier {
278     type string {
279       length "1..max";
280       pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
281       pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
282     }
283     description
284       "A YANG identifier string as defined in RFC 6020, page 163.
285        An identifier must start with an alphabetic character or
286        an underscore followed by an arbitrary sequence of
287        alphabetic or numeric characters, underscores, hyphens
288        or dots.
289
290        A YANG identifier MUST NOT start with any possible
291        combination of the lower-case or upper-case character
292        sequence 'xml'.";
293     reference
294       "RFC 6020: YANG - A Data Modeling Language for the Network
295                  Configuration Protocol (NETCONF)";
296   }
297
298   /*** collection of date and time related types ***/
299
300   typedef date-and-time {
301     type string {
302       pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
303             + '(Z|[\+\-]\d{2}:\d{2})';
304     }
305     description
306      "The date-and-time type is a profile of the ISO 8601
307       standard for representation of dates and times using the
308       Gregorian calendar.  The profile is defined by the
309       date-time production in Section 5.6 of RFC 3339.
310
311       The date-and-time type is compatible with the dateTime XML
312       schema type with the following notable exceptions:
313
314       (a) The date-and-time type does not allow negative years.
315
316       (b) The date-and-time time-offset -00:00 indicates an unknown
317           time zone (see RFC 3339) while -00:00 and +00:00 and Z all
318           represent the same time zone in dateTime.
319
320       (c) The canonical format (see below) of data-and-time values
321           differs from the canonical format used by the dateTime XML
322           schema type, which requires all times to be in UTC using
323           the time-offset 'Z'.
324
325       This type is not equivalent to the DateAndTime textual
326       convention of the SMIv2 since RFC 3339 uses a different
327       separator between full-date and full-time and provides
328       higher resolution of time-secfrac.
329       The canonical format for date-and-time values with a known time
330       zone uses a numeric time zone offset that is calculated using
331       the device's configured known offset to UTC time.  A change of
332       the device's offset to UTC time will cause date-and-time values
333       to change accordingly.  Such changes might happen periodically
334       in case a server follows automatically daylight saving time
335       (DST) time zone offset changes.  The canonical format for
336       date-and-time values with an unknown time zone (usually
337       referring to the notion of local time) uses the time-offset
338       -00:00.";
339     reference
340      "RFC 3339: Date and Time on the Internet: Timestamps
341       RFC 2579: Textual Conventions for SMIv2
342       XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
343   }
344
345   typedef timeticks {
346     type uint32;
347     description
348      "The timeticks type represents a non-negative integer that
349       represents the time, modulo 2^32 (4294967296 decimal), in
350       hundredths of a second between two epochs.  When a schema
351       node is defined that uses this type, the description of
352       the schema node identifies both of the reference epochs.
353
354       In the value set and its semantics, this type is equivalent
355       to the TimeTicks type of the SMIv2.";
356     reference
357      "RFC 2578: Structure of Management Information Version 2
358                 (SMIv2)";
359   }
360
361   typedef timestamp {
362     type yang:timeticks;
363     description
364      "The timestamp type represents the value of an associated
365       timeticks schema node at which a specific occurrence
366       happened. The specific occurrence must be defined in the
367       description of any schema node defined using this type.  When
368       the specific occurrence occurred prior to the last time the
369       associated timeticks attribute was zero, then the timestamp
370       value is zero.  Note that this requires all timestamp values
371       to be reset to zero when the value of the associated timeticks
372       attribute reaches 497+ days and wraps around to zero.
373
374       The associated timeticks schema node must be specified
375       in the description of any schema node using this type.
376       In the value set and its semantics, this type is equivalent
377       to the TimeStamp textual convention of the SMIv2.";
378     reference
379      "RFC 2579: Textual Conventions for SMIv2";
380   }
381
382   /*** collection of generic address types ***/
383
384   typedef phys-address {
385     type string {
386       pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
387     }
388     description
389      "Represents media- or physical-level addresses represented
390       as a sequence octets, each octet represented by two hexadecimal
391       numbers.  Octets are separated by colons.  The canonical
392       representation uses lowercase characters.
393
394       In the value set and its semantics, this type is equivalent
395       to the PhysAddress textual convention of the SMIv2.";
396     reference
397      "RFC 2579: Textual Conventions for SMIv2";
398   }
399
400   typedef mac-address {
401     type string {
402       pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
403     }
404     description
405      "The mac-address type represents an IEEE 802 MAC address.
406       The canonical representation uses lowercase characters.
407
408       In the value set and its semantics, this type is equivalent
409       to the MacAddress textual convention of the SMIv2.";
410     reference
411      "IEEE 802: IEEE Standard for Local and Metropolitan Area
412                 Networks: Overview and Architecture
413       RFC 2579: Textual Conventions for SMIv2";
414   }
415
416   /*** collection of XML specific types ***/
417
418   typedef xpath1.0 {
419     type string;
420     description
421      "This type represents an XPATH 1.0 expression.
422
423       When a schema node is defined that uses this type, the
424       description of the schema node MUST specify the XPath
425       context in which the XPath expression is evaluated.";
426     reference
427      "XPATH: XML Path Language (XPath) Version 1.0";
428   }
429
430   /*** collection of string types ***/
431
432   typedef hex-string {
433     type string {
434       pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
435     }
436     description
437      "A hexadecimal string with octets represented as hex digits
438       separated by colons.  The canonical representation uses
439       lowercase characters.";
440   }
441
442   typedef uuid {
443     type string {
444       pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'
445             + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
446     }
447     description
448      "A Universally Unique IDentifier in the string representation
449       defined in RFC 4122.  The canonical representation uses
450       lowercase characters.
451
452       The following is an example of a UUID in string representation:
453       f81d4fae-7dec-11d0-a765-00a0c91e6bf6
454       ";
455     reference
456      "RFC 4122: A Universally Unique IDentifier (UUID) URN
457                 Namespace";
458   }
459
460   typedef dotted-quad {
461     type string {
462       pattern
463         '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
464       + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
465     }
466     description
467       "An unsigned 32-bit number expressed in the dotted-quad
468        notation, i.e., four octets written as decimal numbers
469        and separated with the '.' (full stop) character.";
470   }
471 }