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