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