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