114700161530e8059017b1fe1d58dfcdcf310454
[genius.git] / itm / itm-api / src / main / yang / itm-state.yang
1 module itm-state {
2
3       namespace "urn:opendaylight:genius:itm:op";
4
5       prefix itm-state;
6
7       import ietf-inet-types {
8           prefix inet;
9           revision-date "2013-07-15";
10       }
11       import odl-interface {
12           prefix odlif; revision-date "2016-04-06";
13       }
14
15
16       description "This YANG module defines operation part of the model.";
17
18       revision "2016-04-06";
19
20         /* Operational state */
21
22       identity tep-type-base {
23           description "Base TEP device type";
24       }
25
26       identity tep-type-internal {
27           base tep-type-base;
28           description "TEP type internal e.g. Compute OVS";
29       }
30
31       identity tep-type-external {
32           base tep-type-base;
33           description "TEP type external e.g. DC Gateway";
34       }
35
36       identity tep-type-hwvtep {
37           base tep-type-base;
38           description "TEP type Hwvtep e.g. TOR devices";
39       }
40
41       typedef tep-type {
42           type identityref {
43               base tep-type-base;
44           }
45           description "This type is used to refer to an TEP Device Type.";
46       }
47
48       grouping tep-info-attributes {
49           leaf tep-device-type {
50               type identityref {
51                   base tep-type-base;
52               }
53           }
54           leaf tep-device-id {
55               type string; //dpnid or node-id
56           }
57           leaf tep-ip {
58               type inet:ip-address; //dpnid or node-id
59           }
60       }
61
62       typedef tunnel-oper-status {
63           type enumeration {
64                enum up;
65                enum down;
66                enum unknown;
67                enum ignore;
68            }
69       }
70
71       container dpn-endpoints {
72           list DPN-TEPs-info {
73           key "DPN-ID";
74
75           leaf DPN-ID {
76               type uint64;
77           }
78
79           leaf dst-id {
80               description "Identifier to get to a this DPN, which will be used in programming Egress flows ";
81               type int32 {
82                   range "1..2147483647";
83               }
84           }
85
86           leaf up {
87               status deprecated;
88               type boolean;
89               config false;
90           }
91
92           /* Minimum 1 port. We may for now support only two ports */
93           list tunnel-end-points {
94               ordered-by user;
95               key "ip-address tunnel-type"; /* Multiple tunnels on the same physical port but on different VLAN can be supported */
96
97               leaf ip-address {
98                   type inet:ip-address;
99               }
100               list tz-membership {
101                   key "zone-name";
102                   leaf zone-name {
103                       type string;
104                   }
105               }
106               leaf interface-name {
107                   type string;
108               }
109               leaf tunnel-type {
110                   type identityref {
111                       base odlif:tunnel-type-base;
112                   }
113               }
114               leaf option-of-tunnel {
115                   description "Use flow based tunnels for remote-ip";
116                   type boolean;
117                   default false;
118               }
119               leaf option-tunnel-tos {
120                   description "Value of ToS bits to be set on the encapsulating
121                       packet. The value of 'inherit' will copy the DSCP value
122                       from inner IPv4 or IPv6 packets.  When ToS is given as
123                       a numberic value, the least significant two bits will
124                       be ignored.";
125                   type string {
126                       length "1..8";
127                   }
128               }
129           }
130        }
131     }
132
133
134     container tunnel-list {
135         list internal-tunnel {
136
137             key  "source-DPN destination-DPN transport-type";
138
139             leaf source-DPN {
140                 type uint64;
141             }
142
143             leaf destination-DPN {
144                 type uint64;
145             }
146
147             leaf transport-type {
148                 type identityref {
149                     base odlif:tunnel-type-base;
150                 }
151             }
152
153             /* logical-group interface id */
154
155             leaf-list tunnel-interface-names {
156                 type string;
157             }
158         }
159     }
160
161     container external-tunnel-list {
162         list external-tunnel {
163             key  "source-device destination-device transport-type";
164
165             leaf source-device {
166                 type string; //dpnid or node-id
167             }
168
169             leaf destination-device {
170                 type string; //dpn-id or node-id or ip
171             }
172
173             leaf transport-type {
174                  type identityref {
175                      base odlif:tunnel-type-base;
176                  }
177             }
178
179             /* logical-group interface id */
180
181             leaf tunnel-interface-name {
182                  type string;
183             }
184
185         }
186     }
187
188     container tunnels_state {
189         config false;
190         list state-tunnel-list {
191             key  "tunnel-interface-name";
192
193             leaf tunnel-interface-name {
194                 type string;
195             }
196
197             leaf tunnel-state {
198                 type boolean;
199                 config false;
200                 status deprecated;
201             }
202
203             leaf oper-state { type tunnel-oper-status; }
204
205             container src-info {
206                 uses tep-info-attributes;
207             }
208
209             container dst-info {
210                 uses tep-info-attributes;
211             }
212
213             leaf transport-type {
214                 type identityref {
215                     base odlif:tunnel-type-base;
216                 }
217             }
218
219             leaf port-number {
220                 type string;
221             }
222
223             leaf if-index {
224                 type uint16;
225             }
226         }
227     }
228
229     container dpn-teps-state {
230         list dpns-teps {
231             key "source-dpn-id";
232             leaf source-dpn-id {
233                 type uint64;
234                 mandatory true;
235             }
236
237             leaf ip-address {
238                 type inet:ip-address;
239             }
240
241             leaf tunnel-type {
242                 type identityref {
243                     base odlif:tunnel-type-base;
244                 }
245                 mandatory true;
246             }
247
248             leaf of-tunnel {
249                 description "Specifies OFTunnel port name when OFTunnel is enabled on ITM Direct Tunnels";
250                 type string;
251             }
252
253             /* Remote DPNs to which this DPN-Tep has a tunnel */
254             list remote-dpns {
255                 key "destination-dpn-id";
256                 leaf destination-dpn-id {
257                     type uint64;
258                     mandatory true;
259                 }
260
261                 leaf tunnel-name {
262                     type string;
263                     mandatory true;
264                 }
265
266                 /* This will later be changed to monitor profile id */
267                 /* The monitor profile will contain monitoring related params */
268                 leaf monitoring-enabled {
269                     type boolean;
270                 }
271
272                 leaf monitoring-interval {
273                     type uint16 {
274                         range "1000..30000";
275                     }
276                 }
277
278                 leaf internal {
279                     type boolean;
280                     mandatory true;
281                     description "represents whether this is an internal or external tunnel.";
282                 }
283             }
284         }
285     }
286
287     container monitoring-ref-count {
288         config false;
289         description "The container for maintaing the reference count for monitoring requests
290                       between a src and dst DPN pair.";
291         list monitored-tunnels {
292             key "source-dpn destination-dpn";
293             leaf source-dpn {
294                 type uint64;
295             }
296             leaf destination-dpn {
297                 type uint64;
298             }
299             leaf reference-count {
300                 type uint16;
301             }
302         }
303     }
304 }