30a2fe6d2f29488defa17be08071de756722cbf6
[genius.git] / itm / itm-api / src / main / yang / itm-rpc.yang
1 module itm-rpc {
2     namespace "urn:opendaylight:genius:itm:rpcs";
3     prefix "itmrpcs";
4
5     import ietf-inet-types {
6         prefix inet;
7         revision-date "2013-07-15";
8     }
9
10     import odl-interface {
11         prefix odlif;
12         revision-date "2016-04-06";
13     }
14
15     import opendaylight-action-types {prefix action;revision-date "2013-11-12";}
16     import opendaylight-flow-types {prefix offlow;revision-date "2013-10-26";}
17
18
19     revision "2016-04-06" {
20         description "ODL Specific Itm Manager Rpcs Module";
21     }
22
23     /* RPCs */
24
25     rpc get-tunnel-interface-name {
26         description "used to retrieve tunnel interface id between Dpns";
27         input {
28             leaf source-dpid {
29                 type uint64;
30             }
31             leaf destination-dpid {
32                 type uint64;
33             }
34             leaf tunnel-type {
35                 type identityref {
36                     base odlif:tunnel-type-base;
37                 }
38             }
39         }
40         output {
41             leaf interface-name {
42                 type string;
43             }
44         }
45     }
46
47     rpc get-internal-or-external-interface-name {
48         description "used to retrieve tunnel interface id with src Dpn and destination ip/dpn";
49         input {
50             leaf source-dpid {
51                 type uint64;
52             }
53             leaf destination-ip {
54                 type inet:ip-address;
55             }
56             leaf destination-dpid {
57                 type uint64;
58                 description "Optional. if destination-dpid is abesnt,"
59                     + "the destination-ip will be used to get the tunnel name";
60             }
61             leaf tunnel-type {
62                 type identityref {
63                     base odlif:tunnel-type-base;
64                 }
65             }
66         }
67         output {
68             leaf interface-name {
69                 type string;
70             }
71         }
72     }
73
74     rpc get-external-tunnel-interface-name {
75         description "used to retrieve external tunnel interface id between Dpns/TORs";
76         input {
77             leaf source-node {
78                 type string;
79             }
80             leaf destination-node {
81                 type string;
82             }
83             leaf tunnel-type {
84                 type identityref {
85                     base odlif:tunnel-type-base;
86                 }
87             }
88         }
89
90         output {
91             leaf interface-name {
92                 type string;
93             }
94         }
95     }
96
97     rpc build-external-tunnel-from-dpns {
98         description "used for building tunnels between a Dpn and external node";
99         input {
100             leaf-list dpn-id {
101                 type uint64;
102             }
103             leaf destination-ip {
104                 type inet:ip-address;
105             }
106             leaf tunnel-type {
107                 type identityref {
108                     base odlif:tunnel-type-base;
109                 }
110             }
111         }
112     }
113
114     rpc add-external-tunnel-endpoint {
115         description "used for building tunnels between teps on all Dpns and external node";
116         input {
117             leaf destination-ip {
118                 type inet:ip-address;
119             }
120             leaf tunnel-type {
121                 type identityref {
122                     base odlif:tunnel-type-base;
123                 }
124             }
125         }
126     }
127
128     rpc remove-external-tunnel-from-dpns {
129         description "used for building tunnels between a Dpn and external node";
130         input {
131             leaf-list dpn-id {
132                 type uint64;
133             }
134             leaf destination-ip {
135                 type inet:ip-address;
136             }
137             leaf tunnel-type {
138                 type identityref {
139                     base odlif:tunnel-type-base;
140                 }
141             }
142         }
143     }
144
145     rpc remove-external-tunnel-endpoint {
146         description "used for building tunnels between teps on all Dpns and external node";
147         input {
148             leaf destination-ip {
149                 type inet:ip-address;
150             }
151             leaf tunnel-type {
152                 type identityref {
153                     base odlif:tunnel-type-base;
154                 }
155             }
156         }
157     }
158
159     rpc create-terminating-service-actions {
160         description  "used for programming the terminating service actions";
161         input {
162             leaf dpn-id {
163                 type uint64;
164             }
165             leaf service-id {
166                 type uint16;
167             }
168             uses offlow:instruction-list;
169         }
170     }
171
172     rpc remove-terminating-service-actions {
173         description  "used for removing the terminating service actions";
174         input {
175             leaf dpn-id {
176                 type uint64;
177             }
178             leaf service-id {
179                 type uint16;
180             }
181         }
182     }
183
184     rpc add-l2-gw-device {
185         description "used for building tunnels between teps on all Dpns and hwVtep";
186         input {
187             leaf topology-id {
188                 type string;
189             }
190             leaf node-id {
191                 type string;
192             }
193             leaf ip-address {
194                 type inet:ip-address;
195             }
196         }
197     }
198
199     rpc add-l2-gw-mlag-device {
200         description "used for building tunnels between teps on all Dpns and hwVtep";
201         input {
202             leaf topology-id {
203                 type string;
204             }
205             leaf-list node-id {
206                 type string;
207             }
208             leaf ip-address {
209                 type inet:ip-address;
210             }
211         }
212     }
213
214     rpc delete-l2-gw-device {
215         description "used for deleting tunnels between teps on all Dpns and hwVtep";
216         input {
217             leaf topology-id {
218                 type string;
219             }
220             leaf node-id {
221                 type string;
222             }
223             leaf ip-address {
224                 type inet:ip-address;
225             }
226         }
227     }
228
229     rpc delete-l2-gw-mlag-device {
230         description "used for deleting tunnels between teps on all Dpns and hwVtep";
231         input {
232             leaf topology-id {
233                 type string;
234             }
235             leaf-list node-id {
236                 type string;
237             }
238             leaf ip-address {
239                 type inet:ip-address;
240             }
241         }
242     }
243
244     rpc is-tunnel-internal-or-external {
245         description "Used for determining whether tunnel is an internal or an external tunnel";
246         input {
247             leaf tunnel-interface-name {
248                 type string;
249             }
250         }
251         output {
252             leaf tunnel-type {
253                 type uint32;
254             }
255         }
256     }
257
258     rpc is-dcgw-present {
259         description "Used for determining whether tunnel is an internal or an external tunnel";
260         input {
261             leaf dcgw-ip {
262                 type string;
263             }
264         }
265         output {
266             leaf retVal {
267                 type uint32;
268             }
269         }
270     }
271
272     rpc get-dpn-endpoint-ips {
273         description "used to retrieve tunnel end point IPs of a Dpn";
274         input {
275             leaf source-dpid {
276             type uint64;
277             }
278         }
279         output {
280             leaf-list nexthopip-list {
281                 type inet:ip-address;
282             }
283         }
284     }
285
286     rpc get-egress-actions-for-tunnel {
287     description "used to retrieve group actions to use from interface name";
288         input {
289             leaf intf-name {
290                 type string;
291                 mandatory true;
292             }
293
294             leaf tunnel-key {
295                 description "It can be VNI for VxLAN tunnel ifaces, Gre Key for GRE tunnels, etc.";
296                 type uint32;
297                 mandatory false;
298             }
299
300             leaf action-key {
301                 description "By default action keys are incremented from zero, for custom initial value set action-key";
302                 type int32;
303                 mandatory false;
304             }
305         }
306         output {
307             uses action:action-list;
308         }
309     }
310
311     rpc get-tunnel-type {
312         description "to get the type of the tunnel interface(vxlan, vxlan-gpe, gre, etc.)";
313         input {
314             leaf intf-name {
315                 type string;
316                 mandatory true;
317             }
318         }
319         output {
320             leaf tunnel-type {
321                 type identityref {
322                     base odlif:tunnel-type-base;
323                 }
324             }
325         }
326     }
327
328     rpc set-bfd-param-on-tunnel {
329         description "used for turning ON/OFF to monitor individual tunnels";
330         input {
331             leaf source-node {
332                 type string;
333                 mandatory true;
334             }
335             leaf destination-node {
336                 type string;
337                 mandatory true;
338             }
339             leaf monitoring-enabled {
340                 type boolean;
341                 mandatory true;
342             }
343             leaf monitoring-interval {
344                 type uint16 {
345                     range "1000..30000";
346                 }
347             }
348         }
349     }
350
351
352     rpc get-dpn-info {
353         description "Gets the dpn id and tep ip information of compute nodes";
354         input {
355             leaf-list compute-names {
356                 type string;
357             }
358         }
359         output {
360             list computes {
361                 key "compute-name";
362                 leaf compute-name {
363                     type string;
364                 }
365                 leaf zone-name {
366                     type string;
367                 }
368                 leaf prefix {
369                     type inet:ip-prefix;
370                 }
371                 leaf dpn-id {
372                     type uint64;
373                 }
374                 leaf-list tep-ip {
375                     type inet:ip-address;
376                 }
377                 leaf port-name {
378                     type string;
379                 }
380                 leaf node-id {
381                     type string;
382                 }
383             }
384         }
385     }
386
387     rpc get-watch-port-for-tunnel {
388         description "retrieve the watch port for the BFD enabled point to point tunnel";
389         input {
390             leaf source-node {
391                 type string;
392             }
393
394             leaf destination-node {
395                 type string;
396             }
397
398         }
399         output {
400             leaf port-no {
401                 type uint32;
402             }
403             leaf portname {
404                 type string;
405             }
406         }
407     }
408 }