L2 Gw create changes related to ITM Tunnels creation in neutronvpn module
[vpnservice.git] / interfacemgr / interfacemgr-api / src / main / yang / odl-interface.yang
1 module odl-interface {
2     namespace "urn:opendaylight:vpnservice:interfacemgr";
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 "2010-09-24";
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 "2015-03-31" {
34         description "ODL Interface Manager Module";
35     }
36
37     identity odl-interface {
38         status deprecated;
39         base "config:service-type";
40         config:java-class "org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager";
41     }
42
43     identity stacked-vlan {
44         base if:interface-type;
45         reference "Q-in-Q interface";
46     }
47
48     identity mpls {
49         base if:interface-type;
50         reference "MPLS interface";
51     }
52
53     /* Tunnel (GRE, VxLAN) logical port */
54     identity l3tunnel {
55         status deprecated;
56         base if:interface-type;
57         reference "l3 tunnel interface";
58     }
59
60     identity tunnel-type-base {
61         description "Base identity for all tunnel-types";
62     }
63
64     identity tunnel-type-vxlan {
65         description "Tunnel type for vxlan tunnels";
66         base tunnel-type-base;
67     }
68
69     identity tunnel-type-gre {
70         description "Tunnel type for gre tunnels";
71         base tunnel-type-base;
72     }
73
74     identity tunnel-type-mpls-over-gre {
75         description "Tunnel type for mpls over gre tunnels";
76         base tunnel-type-base;
77     }
78
79     /* base/common properties */
80     augment "/if:interfaces/if:interface" {
81         status deprecated;
82         ext:augment-identifier "base-ids";
83         leaf of-port-id {
84             type inv:node-connector-id;
85             description "can be a physical switch port or virtual switch port e.g. neutron port";
86         }
87     }
88
89     augment "/if:interfaces/if:interface" {
90         ext:augment-identifier "parent-refs";
91         leaf datapath-node-identifier {
92             type uint64;
93             description "can be a physical switch identifier (optional)";
94         }
95
96         leaf parent-interface {
97             type string;
98             description "can be a physical switch port or virtual switch port e.g. neutron port";
99         }
100
101         list node-identifier {
102             key "topology-id";
103             description "an identifier of the dependant underlying configuration protocol";
104             leaf "topology-id" {
105                 type string;
106                 description "A reference to the type of the network node.
107                 For example, an ovsdb node will take the format ovsdb:1";
108             }
109             leaf "node-id" {
110                 type string;
111                 description "A reference to a network node. A node can be
112                 of type ovsdb,hwvtep or openflow";
113             }
114         }
115     }
116
117     /* interface type specific properties */
118
119     /* VLAN logical port */
120     augment "/if:interfaces/if:interface" {
121         ext:augment-identifier "if-l2vlan";
122         when "if:type = 'ianaift:l2vlan'";
123         leaf vlan-id {
124             type ethertype:vlan-id;
125         }
126
127         leaf l2vlan-mode {
128             description "The VLAN mode of the L2Vlan Interface.";
129             type enumeration {
130                 enum "access" {
131                     value 1;
132                     description
133                         "The VLAN mode access.";
134                 }
135                 enum "native-tagged" {
136                     value 2;
137                     description
138                         "The VLAN mode native-tagged.";
139                 }
140                 enum "native-untagged" {
141                     value 3;
142                     description
143                         "The VLAN mode native-untagged.";
144                 }
145                 enum "trunk" {
146                     value 4;
147                     description
148                         "The VLAN mode trunk.";
149                 }
150                 enum "trunk-member" {
151                     value 5;
152                     description
153                         "The VLAN mode trunk-member.";
154                 }
155                 enum "transparent" {
156                     value 6;
157                     description
158                         "The VLAN mode transparent.";
159                 }
160             }
161             default "trunk";
162         }
163     }
164
165     /* Q-in-Q logical port */
166     augment "/if:interfaces/if:interface" {
167         ext:augment-identifier "if-stacked-vlan";
168         when "if:type = 'stacked-vlan'";
169         leaf stacked_vlan-id {
170             type uint16 {
171                 range "1..4094";
172             }
173         }
174     }
175
176     augment "/if:interfaces/if:interface" {
177         ext:augment-identifier "if-tunnel";
178         when "if:type = 'ianaift:tunnel'";
179
180         leaf internal {
181             type boolean;
182             default "false";
183             description
184               "represents whether this is an internal or external tunnel.";
185         }
186         
187         leaf tunnel-interface-type {
188             type identityref {
189                 base tunnel-type-base;
190             }
191         }
192
193         leaf tunnel-source {
194             type inet:ip-address;
195             description "Local Endpoint IP address";
196         }
197
198         leaf tunnel-destination {
199             type inet:ip-address;
200             description "Remote Endpoint IP address";
201         }
202
203         leaf tunnel-gateway {
204             type inet:ip-address;
205             description "gateway IP address";
206         }
207
208         leaf monitor-enabled {
209             type boolean;
210             default false;
211         }
212
213         leaf monitor-interval {
214              type uint32;
215               default 10000;
216         }
217     }
218
219     augment "/if:interfaces/if:interface" {
220         status deprecated;
221         ext:augment-identifier "if-l3tunnel";
222         when "if:type = 'ianaift:l3tunnel'";
223
224         leaf tunnel-type {
225             type identityref {
226                 base tunnel-type-base;
227             }
228         }
229
230         leaf local-ip {
231             type inet:ip-address;
232             description "Local Endpoint IP address";
233         }
234
235         leaf remote-ip {
236             type inet:ip-address;
237             description "Remote Endpoint IP address";
238         }
239
240         leaf gateway-ip {
241             type inet:ip-address;
242             description "gateway IP address";
243         }
244     }
245
246     /* MPLS logical port */
247     augment "/if:interfaces/if:interface" {
248         ext:augment-identifier "if-mpls";
249         when "if:type = 'mpls'";
250         leaf-list labelStack {
251             type uint32 {
252                 range "15..1048575";
253             }
254         }
255         leaf numLabels{
256             type uint8 {
257                 range "1..7";
258             }
259         }
260     }
261 }