Change logical-switch-ref to iid in hwvtep.yang
[ovsdb.git] / hwvtepsouthbound / hwvtepsouthbound-api / src / main / yang / hwvtep.yang
1 module hwvtep {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:ovsdb:hwvtep";
4     prefix "hwvtepsb";
5
6     import network-topology {prefix "topo"; revision-date "2013-10-21"; }
7     import yang-ext { prefix "ext"; }
8     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
9     import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
10     import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
11
12     revision "2015-09-01" {
13         description "1st revision of southbound model for hwvtep";
14     }
15
16     typedef hwvtep-physical-switch-ref {
17         description "A reference to a hwvtep based physical switch";
18         type instance-identifier;
19     }
20
21     typedef hwvtep-logical-switch-ref {
22         description "A reference to a logical switch in hwvtep based switches";
23         type instance-identifier;
24     }
25
26     typedef hwvtep-physical-locator-ref {
27         description "A reference to an endpoint to which logical switch traffic may be encapsulated and forwarded";
28         type instance-identifier;
29     }
30
31     typedef hwvtep-global-ref {
32         description "A reference to an hwvtep global node";
33         type instance-identifier;
34     }
35
36     typedef hwvtep-node-name {
37         type string;
38     }
39
40     grouping hwvtep-node-identification {
41         leaf hwvtep-node-name {
42             description "The name of the node";
43             type hwvtep-node-name;
44         }
45         leaf hwvtep-node-description {
46             description "The description of the node";
47             type string;
48         }
49     }
50
51     grouping hwvtep-mac-table-generic-attributes {
52         leaf mac-entry-key {
53             description "MAC address entry";
54             type yang:mac-address;
55         }
56         leaf logical-switch-ref {
57             description "The logical switch to which this mapping applies";
58             type hwvtep-logical-switch-ref;
59         }
60     }
61
62     grouping hwvtep-ucast-mac-table-attributes {
63         description "Unicast mac table attributes";
64         leaf ipaddr {
65             description "Optional IP address associated with the mac";
66             type inet:ip-address;
67         }
68         leaf locator-ref {
69             description "Reference to the physical locator to reach this entry";
70             type hwvtep-physical-locator-ref;
71         }
72     }
73
74     grouping hwvtep-mcast-mac-table-attributes {
75         description "Multicast mac table attributes";
76         leaf ipaddr {
77             description "Optional IP address associated with the mac";
78             type inet:ip-address;
79         }
80         uses hwvtep-physical-locator-set-attributes;
81     }
82
83     grouping hwvtep-tunnel-attributes {
84         leaf tunnel-uuid {
85             description "The unique identifier of the tunnel";
86             type yang:uuid;
87         }
88         leaf local-locator-ref {
89             description "Reference to the physical locator to reach this entry";
90             type hwvtep-physical-locator-ref;
91         }
92         leaf remote-locator-ref {
93             description "Reference to the physical locator to reach this entry";
94             type hwvtep-physical-locator-ref;
95         }
96         leaf bfd-config-local {
97             type string;
98         }
99         leaf bfd-config-remote {
100             type string;
101         }
102         leaf bfd-params {
103             type string;
104         }
105     }
106
107     grouping hwvtep-physical-switch-attributes {
108         uses hwvtep-node-identification;
109         leaf physical-switch-uuid {
110             description "The unique identifier of the physical-switch";
111             type yang:uuid;
112         }
113         list management-ips {
114             key "management-ips-key";
115             leaf management-ips-key {
116                description "Management IP address of the switch";
117                type inet:ip-address;
118             }
119         }
120         leaf managed-by {
121             description "The hwvtep global node to which this physical switch belongs to";
122             type hwvtep-global-ref;
123         }
124         list tunnel-ips {
125             key "tunnel-ips-key";
126             leaf tunnel-ips-key {
127                description "Management IP address of the switch";
128                type inet:ip-address;
129             }
130         }
131         list tunnels {
132             uses hwvtep-tunnel-attributes ;
133         }
134     }
135
136     grouping hwvtep-connection-info-attributes {
137         leaf remote-ip {
138             type inet:ip-address;
139             description "Hwvtep Connection Remote IP";
140         }
141         leaf remote-port {
142             type inet:port-number;
143             description "Hwvtep Connection Remote Port Number";
144         }
145         leaf local-ip {
146             type inet:ip-address;
147             description "Hwvtep Connection Local IP";
148         }
149         leaf local-port {
150             type inet:port-number;
151             description "Hwvtep Connection Local Port Number IP";
152         }
153     }
154
155     grouping hwvtep-global-attributes {
156         description "global node for the hwvtep";
157         container connection-info {
158             uses hwvtep-connection-info-attributes;
159         }
160         list managers {
161             description "";
162             key "target";
163             leaf target {
164                 description "Uri indicating connection method to the Manager";
165                 type inet:uri;
166             }
167             leaf manager-uuid {
168                 description "The unique identifier of the manager";
169                 type yang:uuid;
170             }
171             leaf is-connected {
172                 type boolean;
173             }
174             list manager-other-configs {
175                 description "Key-value pairs for configuring rarely used features.
176                     other_config : dscp : optional string
177                     contains an integer, in the range 0 - 63. DSCP value to be used when establishing a connection to the switch. Default value of 48 if none specified.";
178                 key "other-config-key";
179                 leaf other-config-key {
180                     description "other-config name/key";
181                     type string;
182                 }
183                 leaf other-config-value {
184                     description "other-config value";
185                     type string;
186                 }
187             }
188         }
189         list switches {
190             description "List of physical switches managed by this node";
191             key "switch-ref";
192             leaf switch-ref {
193                 type hwvtep-physical-switch-ref;
194             }
195         }
196         list logical-switches {
197             key "hwvtep-node-name";
198             uses hwvtep-logical-switch-attributes;
199         }
200         list local-ucast-macs {
201             key "mac-entry-key";
202             uses hwvtep-mac-table-generic-attributes;
203             uses hwvtep-ucast-mac-table-attributes;
204         }
205         list remote-ucast-macs {
206             key "mac-entry-key";
207             uses hwvtep-mac-table-generic-attributes;
208             uses hwvtep-ucast-mac-table-attributes;
209         }
210         list local-mcast-macs {
211             key "mac-entry-key";
212             uses hwvtep-mac-table-generic-attributes;
213             uses hwvtep-mcast-mac-table-attributes;
214         }
215         list remote-mcast-macs{
216             key "mac-entry-key";
217             uses hwvtep-mac-table-generic-attributes;
218             uses hwvtep-mcast-mac-table-attributes;
219         }
220     }
221
222     identity encapsulation-type-base {
223         description "Base Encapsulation type";
224     }
225
226     identity encapsulation-type-vxlan-over-ipv4 {
227         base encapsulation-type-base;
228         description "Encapsulation type vxlan-over-ipv4";
229     }
230
231     typedef encapsulation-type {
232         type identityref {
233             base encapsulation-type-base;
234         }
235         description "This type is used to refer to an Encapsulation Type.";
236     }
237
238     grouping hwvtep-physical-locator-attributes {
239         leaf physical-locator-uuid {
240             description "The unique identifier of the physical-locator";
241             type yang:uuid;
242         }
243         leaf encapsulation-type {
244             type encapsulation-type;
245             description "Encapsulation type used by this locator";
246         }
247         leaf dst-ip {
248             type inet:ip-address;
249             description "IP address of the locator";
250         }
251     }
252
253     grouping hwvtep-physical-locator-set-attributes {
254         list locator-set {
255             leaf locator-ref {
256                 type hwvtep-physical-locator-ref;
257             }
258         }
259     }
260
261     grouping hwvtep-logical-switch-attributes {
262         uses hwvtep-node-identification;
263         leaf logical-switch-uuid {
264             description "A unique identifier of the logical switch";
265             type yang:uuid;
266         }
267         leaf tunnel-key {
268             description "Per Logical Switch tunnel key";
269             type string;
270         }
271     }
272
273     grouping hwvtep-physical-port-attributes {
274         uses hwvtep-node-identification;
275         leaf physical-port-uuid {
276             description "The unique identifier of the physical-port";
277             type yang:uuid;
278         }
279         list vlan-bindings {
280             description "A map of vlan ID to logical switch pairs";
281             key "vlan-id-key";
282             leaf vlan-id-key {
283                 description "vlan ids in the range 0 - 4095";
284                 type ethertype:vlan-id;
285             }
286             leaf logical-switch-ref {
287                 description "Reference to logical switch for the vlan";
288                 type hwvtep-logical-switch-ref;
289             }
290         }
291     }
292
293     augment "/topo:network-topology/topo:topology/topo:node" {
294         description "Augmentation for physical switch nodes managed by hwvtep";
295         ext:augment-identifier "physical-switch-augmentation";
296         uses hwvtep-physical-switch-attributes;
297     }
298
299     augment "/topo:network-topology/topo:topology/topo:node" {
300         description "Augment topology node for a hwvtep node";
301         ext:augment-identifier "hwvtep-global-augmentation";
302         uses hwvtep-global-attributes;
303     }
304
305     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
306         description "Augment topology node termination-point for a hwvtep physical-locator";
307         ext:augment-identifier "hwvtep-physical-locator-augmentation";
308         uses hwvtep-physical-locator-attributes;
309     }
310
311     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
312         description "Augment topology node termination-point for a hwvtep physical-port";
313         ext:augment-identifier "hwvtep-physical-port-augmentation";
314         uses hwvtep-physical-port-attributes;
315     }
316 }