aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-yang-types@2018-11-21.yang
blob: 1c2a7f59326a1eee379e2c642b51d2984721ac30 (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
module openconfig-yang-types {

  yang-version "1";
  namespace "http://openconfig.net/yang/types/yang";
  prefix "oc-yang";

  import openconfig-extensions { prefix "oc-ext"; }

  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "This module contains a set of extension types to the
    YANG builtin types that are used across multiple
    OpenConfig models.

    Portions of this code were derived from IETF RFC 6021.
    Please reproduce this note if possible.

    IETF code is subject to the following copyright and license:
    Copyright (c) IETF Trust and the persons identified as authors of
    the code.
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, is permitted pursuant to, and subject to the license
    terms contained in, the Simplified BSD License set forth in
    Section 4.c of the IETF Trust's Legal Provisions Relating
    to IETF Documents (http://trustee.ietf.org/license-info).";

  oc-ext:openconfig-version "0.2.1";

  revision "2018-11-21" {
    description
      "Add OpenConfig module metadata extensions.";
    reference "0.2.1";
  }

  revision 2018-04-24 {
    description
      "Add date typedef";
    reference "0.2.0";
  }

  revision 2017-07-30 {
    description
      "Fixed unprintable character";
    reference "0.1.2";
  }

  revision 2017-04-03 {
    description
      "Update copyright notice.";
    reference "0.1.1";
  }

  revision 2017-01-26 {
    description
      "Initial module for inet types";
    reference "0.1.0";
  }

  // OpenConfig specific extensions for module metadata.
  oc-ext:regexp-posix;
  oc-ext:catalog-organization "openconfig";
  oc-ext:origin "openconfig";

  typedef dotted-quad {
    type string {
      pattern '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|'       +
              '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4]' +
              '[0-9]|25[0-5])$';
    }
    description
      "An unsigned 32-bit integer expressed as a dotted quad. The
      format is four octets written as decimal numbers separated
      with a period character.";
  }

  typedef hex-string {
    type string {
      pattern '^[0-9a-fA-F]*$';
    }
    description
      "A string consisting of a hexadecimal characters.";
  }

  typedef counter32 {
    type uint32;
    description

      "A 32-bit counter. A counter value is a monotonically increasing
      value which is used to express a count of a number of
      occurrences of a particular event or entity. When the counter
      reaches its maximum value, in this case 2^32-1, it wraps to 0.

      Discontinuities in the counter are generally triggered only when
      the counter is reset to zero.";
  }

  typedef counter64 {
    type uint64;
    description

      "A 64-bit counter. A counter value is a monotonically increasing
      value which is used to express a count of a number of
      occurrences of a particular event or entity. When a counter64
      reaches its maximum value, 2^64-1, it loops to zero.
      Discontinuities in a counter are generally triggered only when
      the counter is reset to zero, through operator or system
      intervention.";
  }

  typedef date-and-time {
    type string {
      pattern
        '^[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' +
        '(\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$';
    }
    description
      "A date and time, expressed in the format described in RFC3339.
      That is to say:

      YYYY-MM-DDTHH:MM:SSZ+-hh:mm

      where YYYY is the year, MM is the month expressed as a two-digit
      month (zero padding if required), DD is the day of the month,
      expressed as a two digit value. T is the literal character 'T',
      HH is the hour of the day expressed as a two digit number, using
      the 24-hour clock, MM is the minute of the hour expressed as a
      two digit number. Z is the literal character 'Z', followed by a
      timezone offset expressed in hours (hh) and minutes (mm), both
      expressed as two digit numbers. The time offset is specified as
      a positive or negative offset to UTC using the '+' or '-'
      character preceding the offset.

      Optionally, fractional seconds can be expressed after the minute
      of the hour as a decimal number of unspecified precision
      reflecting fractions of a second.";
    reference
      "RFC3339 - Date and Time on the Internet: Timestamps";
  }

  typedef date {
    type string {
      pattern '^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$';
    }
    description
      "A full UTC date, expressed in the format described in RFC3339.
      That is to say:

      YYYY-MM-DD

      where YYYY is the year, MM is the month expressed as a two-digit
      month (zero padding if required), DD is the day of the month,
      expressed as a two digit value.";

    reference
      "RFC3339 - Date and Time on the Internet: full-date";
  }

  typedef gauge64 {
    type uint64;
    description
      "A gauge value may increase or decrease - and reflects a value
      at a particular point in time. If the value of the variable
      being modeled using the gauge exceeds its maximum - 2^64-1 in
      this case - the gauge is set to its maximum value.";
  }

  typedef phys-address {
    type string {
      pattern '^([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?$';
    }
    description
      "A physical layer address, expressed as a series of pairs of
      hexadecimal digits.";
  }

  typedef mac-address {
    type string {
      pattern '^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$';
    }
    description
      "An IEEE 802 MAC address";
  }
}