BUG:5042 LLDP Tunnel Monitoring should update the interface operational
[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
102     /* interface type specific properties */
103
104     /* VLAN logical port */
105     augment "/if:interfaces/if:interface" {
106         ext:augment-identifier "if-l2vlan";
107         when "if:type = 'ianaift:l2vlan'";
108         leaf vlan-id {
109             type ethertype:vlan-id;
110         }
111
112         leaf l2vlan-mode {
113             description "The VLAN mode of the L2Vlan Interface.";
114             type enumeration {
115                 enum "access" {
116                     value 1;
117                     description
118                         "The VLAN mode access.";
119                 }
120                 enum "native-tagged" {
121                     value 2;
122                     description
123                         "The VLAN mode native-tagged.";
124                 }
125                 enum "native-untagged" {
126                     value 3;
127                     description
128                         "The VLAN mode native-untagged.";
129                 }
130                 enum "trunk" {
131                     value 4;
132                     description
133                         "The VLAN mode trunk.";
134                 }
135                 enum "trunk-member" {
136                     value 5;
137                     description
138                         "The VLAN mode trunk-member.";
139                 }
140                 enum "transparent" {
141                     value 6;
142                     description
143                         "The VLAN mode transparent.";
144                 }
145             }
146         }
147     }
148
149     /* Q-in-Q logical port */
150     augment "/if:interfaces/if:interface" {
151         ext:augment-identifier "if-stacked-vlan";
152         when "if:type = 'stacked-vlan'";
153         leaf stacked_vlan-id {
154             type uint16 {
155                 range "1..4094";
156             }
157         }
158     }
159
160     augment "/if:interfaces/if:interface" {
161         ext:augment-identifier "if-tunnel";
162         when "if:type = 'ianaift:tunnel'";
163
164         leaf internal {
165             type boolean;
166             default "false";
167             description
168               "represents whether this is an internal or external tunnel.";
169         }
170         
171         leaf tunnel-interface-type {
172             type identityref {
173                 base tunnel-type-base;
174             }
175         }
176
177         leaf tunnel-source {
178             type inet:ip-address;
179             description "Local Endpoint IP address";
180         }
181
182         leaf tunnel-destination {
183             type inet:ip-address;
184             description "Remote Endpoint IP address";
185         }
186
187         leaf tunnel-gateway {
188             type inet:ip-address;
189             description "gateway IP address";
190         }
191
192         leaf monitor-enabled {
193             type boolean;
194             default false;
195         }
196
197         leaf monitor-interval {
198              type uint32;
199               default 10000;
200         }
201     }
202
203     augment "/if:interfaces/if:interface" {
204         status deprecated;
205         ext:augment-identifier "if-l3tunnel";
206         when "if:type = 'ianaift:l3tunnel'";
207
208         leaf tunnel-type {
209             type identityref {
210                 base tunnel-type-base;
211             }
212         }
213
214         leaf local-ip {
215             type inet:ip-address;
216             description "Local Endpoint IP address";
217         }
218
219         leaf remote-ip {
220             type inet:ip-address;
221             description "Remote Endpoint IP address";
222         }
223
224         leaf gateway-ip {
225             type inet:ip-address;
226             description "gateway IP address";
227         }
228     }
229
230     /* MPLS logical port */
231     augment "/if:interfaces/if:interface" {
232         ext:augment-identifier "if-mpls";
233         when "if:type = 'mpls'";
234         leaf-list labelStack {
235             type uint32 {
236                 range "15..1048575";
237             }
238         }
239         leaf numLabels{
240             type uint8 {
241                 range "1..7";
242             }
243         }
244     }
245 }