Fix and renable FlowBasedServicesConfigurationtTest tests
[genius.git] / interfacemanager / interfacemanager-api / src / main / yang / odl-interface.yang
1 module odl-interface {
2     namespace "urn:opendaylight:genius:interfacemanager";
3
4     prefix "odlif";
5
6     import ietf-interfaces {
7         prefix if;
8     }
9
10     import yang-ext {
11         prefix ext;
12     }
13
14     import iana-if-type {
15         prefix ianaift;
16     }
17
18     import ietf-inet-types {
19         prefix inet;
20         revision-date "2013-07-15";
21     }
22
23     import opendaylight-inventory {
24         prefix inv; revision-date 2013-08-19;
25     }
26
27     import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
28
29     import config {
30         prefix config; revision-date 2013-04-05;
31     }
32
33     revision "2016-04-06" {
34         description "ODL Interface Manager Module";
35     }
36
37     identity odl-interface {
38         base "config:service-type";
39         config:java-class "org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager";
40     }
41
42     identity stacked-vlan {
43         base if:interface-type;
44         reference "Q-in-Q interface";
45     }
46
47     identity mpls {
48         base if:interface-type;
49         reference "MPLS interface";
50     }
51
52     /* Tunnel (GRE, VxLAN) logical port */
53     identity l3tunnel {
54         status deprecated;
55         base if:interface-type;
56         reference "l3 tunnel interface";
57     }
58
59     identity tunnel-type-base {
60         description "Base identity for all tunnel-types";
61     }
62
63     identity tunnel-type-vxlan {
64         description "Tunnel type for vxlan tunnels";
65         base tunnel-type-base;
66     }
67     
68     identity tunnel-type-vxlan-gpe {
69         description "Tunnel type for vxlan-gpe";
70         base tunnel-type-base;
71     }
72
73     identity tunnel-type-gre {
74         description "Tunnel type for gre tunnels";
75         base tunnel-type-base;
76     }
77
78     identity tunnel-type-mpls-over-gre {
79         description "Tunnel type for mpls over gre tunnels";
80         base tunnel-type-base;
81     }
82
83     identity tunnel-monitoring-type-base {
84         description "Base identity for all tunnel-monitoring-types";
85     }
86
87     identity tunnel-monitoring-type-lldp {
88         description "Tunnel monitoring using lldp";
89         base tunnel-monitoring-type-base;
90     }
91
92     identity tunnel-monitoring-type-bfd {
93         description "Tunnel monitoring using bfd support on OVS";
94         base tunnel-monitoring-type-base;
95     }
96
97     grouping monitor-params {
98         leaf monitor-enabled {
99             type boolean;
100             default false;
101         }
102
103         leaf monitor-interval {
104             type uint32;
105             default 10000;
106         }
107
108         leaf monitor-protocol {
109             type identityref {
110                 base tunnel-monitoring-type-base;
111             }
112             default tunnel-monitoring-type-bfd;
113         }
114
115         list monitor-config {
116             key "monitor-config-key";
117             leaf monitor-config-key {
118                 type string;
119             }
120             leaf monitor-config-value {
121                 type string;
122             }
123         }
124     }
125
126     /* base/common properties */
127     augment "/if:interfaces/if:interface" {
128         status deprecated;
129         ext:augment-identifier "base-ids";
130         leaf of-port-id {
131             type inv:node-connector-id;
132             description "can be a physical switch port or virtual switch port e.g. neutron port";
133         }
134     }
135
136     augment "/if:interfaces/if:interface" {
137         ext:augment-identifier "parent-refs";
138         leaf datapath-node-identifier {
139             type uint64;
140             description "can be a physical switch identifier (optional)";
141         }
142
143         leaf parent-interface {
144             type string;
145             description "can be a physical switch port or virtual switch port e.g. neutron port";
146         }
147
148         list node-identifier {
149             key "topology-id";
150             description "an identifier of the dependant underlying configuration protocol";
151             leaf "topology-id" {
152                 type string;
153                 description "can be ovsdb configuration protocol";
154             }
155             leaf "node-id" {
156                 type string;
157                 description "can be hwvtep configuration protocol";
158             }
159         }
160     }
161
162     /* interface type specific properties */
163
164     /* VLAN logical port */
165     augment "/if:interfaces/if:interface" {
166         ext:augment-identifier "if-l2vlan";
167         when "if:type = 'ianaift:l2vlan'";
168         leaf vlan-id {
169             type ethertype:vlan-id;
170         }
171
172         leaf l2vlan-mode {
173             description "The VLAN mode of the L2Vlan Interface.";
174             type enumeration {
175                 enum "access" {
176                     value 1;
177                     description
178                         "The VLAN mode access.";
179                 }
180                 enum "native-tagged" {
181                     value 2;
182                     description
183                         "The VLAN mode native-tagged.";
184                 }
185                 enum "native-untagged" {
186                     value 3;
187                     description
188                         "The VLAN mode native-untagged.";
189                 }
190                 enum "trunk" {
191                     value 4;
192                     description
193                         "The VLAN mode trunk.";
194                 }
195                 enum "trunk-member" {
196                     value 5;
197                     description
198                         "The VLAN mode trunk-member.";
199                 }
200                 enum "transparent" {
201                     value 6;
202                     description
203                         "The VLAN mode transparent.";
204                 }
205             }
206             default "trunk";
207         }
208     }
209
210     /* Q-in-Q logical port */
211     augment "/if:interfaces/if:interface" {
212         ext:augment-identifier "if-stacked-vlan";
213         when "if:type = 'stacked-vlan'";
214         leaf stacked_vlan-id {
215             type uint16 {
216                 range "1..4094";
217             }
218         }
219     }
220
221     augment "/if:interfaces/if:interface" {
222         ext:augment-identifier "if-tunnel";
223         when "if:type = 'ianaift:tunnel'";
224
225         leaf internal {
226             type boolean;
227             default "false";
228             description
229               "represents whether this is an internal or external tunnel.";
230         }
231         
232         leaf tunnel-interface-type {
233             type identityref {
234                 base tunnel-type-base;
235             }
236         }
237
238         leaf tunnel-source {
239             type inet:ip-address;
240             description "Local Endpoint IP address";
241         }
242
243         leaf tunnel-destination {
244             type inet:ip-address;
245             description "Remote Endpoint IP address";
246         }
247
248         leaf tunnel-gateway {
249             type inet:ip-address;
250             description "gateway IP address";
251         }
252
253         uses monitor-params;
254     }
255
256     augment "/if:interfaces/if:interface" {
257         status deprecated;
258         ext:augment-identifier "if-l3tunnel";
259         when "if:type = 'ianaift:l3tunnel'";
260
261         leaf tunnel-type {
262             type identityref {
263                 base tunnel-type-base;
264             }
265         }
266
267         leaf local-ip {
268             type inet:ip-address;
269             description "Local Endpoint IP address";
270         }
271
272         leaf remote-ip {
273             type inet:ip-address;
274             description "Remote Endpoint IP address";
275         }
276
277         leaf gateway-ip {
278             type inet:ip-address;
279             description "gateway IP address";
280         }
281     }
282
283     /* MPLS logical port */
284     augment "/if:interfaces/if:interface" {
285         ext:augment-identifier "if-mpls";
286         when "if:type = 'mpls'";
287         leaf-list labelStack {
288             type uint32 {
289                 range "15..1048575";
290             }
291         }
292         leaf numLabels{
293             type uint8 {
294                 range "1..7";
295             }
296         }
297     }
298 }