Initial Code commit for OVS Support for vpnservice
[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     }
21
22     import opendaylight-inventory {
23         prefix inv; revision-date 2013-08-19;
24     }
25
26     import config {
27         prefix config; revision-date 2013-04-05;
28     }
29
30     revision "2015-03-31" {
31         description "ODL Interface Manager Module";
32     }
33
34     identity odl-interface {
35         status deprecated;
36         base "config:service-type";
37         config:java-class "org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager";
38     }
39
40     identity stacked-vlan {
41         base if:interface-type;
42         reference "Q-in-Q interface";
43     }
44
45     identity mpls {
46         base if:interface-type;
47         reference "MPLS interface";
48     }
49
50     identity l3tunnel {
51         status deprecated;
52         base if:interface-type;
53         reference
54         "l3 tunnel interface";
55     }
56
57     /* Tunnel (GRE, VxLAN) logical port */
58     identity tunnel-type-base {
59         description "Base identity for all tunnel-types";
60     }
61
62     identity tunnel-type-vxlan {
63         description "Tunnel type for vxlan tunnels";
64         base tunnel-type-base;
65     }
66
67     identity tunnel-type-gre {
68         description "Tunnel type for gre tunnels";
69         base tunnel-type-base;
70     }
71
72     /* base/common properties */
73     augment "/if:interfaces/if:interface" {
74         status deprecated;
75         ext:augment-identifier "base-ids";
76         leaf of-port-id {
77             type inv:node-connector-id;
78             description "can be a physical switch port or virtual switch port e.g. neutron port";
79         }
80     }
81
82     augment "/if:interfaces/if:interface" {
83         ext:augment-identifier "parent-refs";
84         leaf datapath-node-identifier {
85             type uint64;
86             description "can be a physical switch identifier (optional)";
87         }
88
89         leaf parent-interface {
90             type string;
91             description "can be a physical switch port or virtual switch port e.g. neutron port";
92         }
93     }
94
95     /* interface type specific properties */
96
97     /* VLAN logical port */
98     augment "/if:interfaces/if:interface" {
99         ext:augment-identifier "if-l2vlan";
100         when "if:type = 'ianaift:l2vlan'";
101         leaf vlan-id {
102             type uint16 {
103                 range "1..4094";
104             }
105         }
106     }
107
108     /* Q-in-Q logical port */
109     augment "/if:interfaces/if:interface" {
110         ext:augment-identifier "if-stacked-vlan";
111         when "if:type = 'stacked-vlan'";
112         leaf stacked_vlan-id {
113             type uint16 {
114                 range "1..4094";
115             }
116         }
117     }
118
119     augment "/if:interfaces/if:interface" {
120         ext:augment-identifier "if-tunnel";
121         when "if:type = 'ianaift:tunnel'";
122
123         leaf tunnel-interface-type {
124             type identityref {
125                 base tunnel-type-base;
126             }
127         }
128
129         leaf tunnel-source {
130             type inet:ip-address;
131             description "Local Endpoint IP address";
132         }
133
134         leaf tunnel-destination {
135             type inet:ip-address;
136             description "Remote Endpoint IP address";
137         }
138
139         leaf tunnel-gateway {
140             type inet:ip-address;
141             description "gateway IP address";
142         }
143     }
144
145     augment "/if:interfaces/if:interface" {
146         status deprecated;
147         ext:augment-identifier "if-l3tunnel";
148         when "if:type = 'ianaift:l3tunnel'";
149
150         leaf tunnel-type {
151             type identityref {
152                 base tunnel-type-base;
153             }
154         }
155         leaf local-ip {
156             type inet:ip-address;
157             description "Local Endpoint IP address";
158         }
159
160         leaf remote-ip {
161             type inet:ip-address;
162             description "Remote Endpoint IP address";
163         }
164
165         leaf gateway-ip {
166             type inet:ip-address;
167             description "gateway IP address";
168         }
169     }
170     /* MPLS logical port */
171     augment "/if:interfaces/if:interface" {
172         ext:augment-identifier "if-mpls";
173         when "if:type = 'mpls'";
174         leaf-list labelStack {
175             type uint32 {
176                 range "15..1048575";
177             }
178         }
179         leaf numLabels{
180             type uint8 {
181                 range "1..7";
182             }
183         }
184     }
185 }