Merge "L2 Gw create changes related to ITM Tunnels creation in neutronvpn module"
[vpnservice.git] / interfacemgr / interfacemgr-api / src / main / yang / odl-interface-rpc.yang
1 module odl-interface-rpc {
2     namespace "urn:opendaylight:vpnservice:interfacemgr:rpcs";
3     prefix "odlifrpc";
4
5     import ietf-inet-types {
6         prefix inet;
7     }
8
9     import odl-interface {
10         prefix odlif; revision-date 2015-03-31;
11     }
12
13     import opendaylight-inventory {
14         prefix inv; revision-date 2013-08-19;
15     }
16
17     import ietf-interfaces {
18         prefix if; revision-date 2014-05-08;
19     }
20
21     import opendaylight-action-types {prefix action;}
22     import opendaylight-flow-types {prefix offlow;revision-date "2013-10-26";}
23
24     revision "2015-10-03" {
25         description "ODL Specific Interface Manager Rpcs Module";
26     }
27
28     /* RPCs */
29
30     rpc get-dpid-from-interface {
31         description "used to retrieve dpid from interface name";
32         input {
33             leaf intf-name {
34                 type string;
35             }
36         }
37         output {
38             leaf dpid {
39                 type uint64;
40             }
41         }
42     }
43
44     rpc get-port-from-interface {
45         description "used to retrieve dpid from interface name";
46         input {
47             leaf intf-name {
48                 type string;
49             }
50         }
51         output {
52             leaf dpid {
53                 type uint64;
54             }
55             leaf portno {
56                 type uint32;
57             }
58             leaf portname {
59                 type string;
60             }
61         }
62     }
63
64     rpc get-egress-actions-for-interface {
65         description "used to retrieve group actions to use from interface name";
66         input {
67             leaf intf-name {
68                 type string;
69                 mandatory true;
70             }
71
72             leaf tunnel-key {
73                 description "It can be VNI for VxLAN tunnel ifaces, Gre Key for GRE tunnels, etc.";
74                 type uint32;
75                 mandatory false;
76             }
77         }
78         output {
79             uses action:action-list;
80         }
81     }
82
83     rpc get-egress-instructions-for-interface {
84         description "used to retrieve flow instructions to use from interface name";
85         input {
86             leaf intf-name {
87                 type string;
88                 mandatory true;
89             }
90
91             leaf tunnel-key {
92                 description "It can be VNI for VxLAN tunnel ifaces, Gre Key for GRE tunnels, etc.";
93                 type uint32;
94                 mandatory false;
95             }
96         }
97         output {
98             uses offlow:instruction-list;
99         }
100     }
101
102     rpc get-endpoint-ip-for-dpn {
103         description "to get the local ip of the tunnel/trunk interface";
104         input {
105             leaf dpid {
106                 type uint64;
107             }
108         }
109         output {
110             leaf-list local-ips {
111                 type inet:ip-address;
112             }
113         }
114     }
115
116     rpc get-interface-type {
117     description "to get the type of the interface(vlan/vxlan or gre)";
118         input {
119             leaf intf-name {
120                 type string;
121             }
122         }
123         output {
124             leaf interface-type {
125                 type identityref {
126                     base if:interface-type;
127                 }
128             }
129         }
130     }
131
132     rpc get-tunnel-type {
133     description "to get the type of the tunnel interface(vxlan or gre)";
134         input {
135             leaf intf-name {
136                 type string;
137             }
138         }
139         output {
140             leaf tunnel-type {
141                 type identityref {
142                     base odlif:tunnel-type-base;
143                 }
144             }
145         }
146     }
147
148
149     rpc get-nodeconnector-id-from-interface {
150     description "to get nodeconnector id associated with an interface";
151         input {
152             leaf intf-name {
153                 type string;
154             }
155         }
156         output {
157             leaf nodeconnector-id {
158                 type inv:node-connector-id;
159             }
160         }
161     }
162
163     rpc get-interface-from-if-index {
164         description "to get interface associated with an if-index";
165             input {
166                 leaf if-index {
167                     type int32;
168                 }
169             }
170             output {
171                 leaf interface-name {
172                     type string;
173                 }
174             }
175         }
176
177     rpc create-terminating-service-actions {
178     description "create the ingress terminating service table entries";
179         input {
180              leaf dpid {
181                  type uint64;
182              }
183              leaf tunnel-key {
184                  type uint64;
185              }
186              leaf interface-name {
187                  type string;
188              }
189              uses offlow:instruction-list;
190         }
191     }
192
193     rpc remove-terminating-service-actions {
194     description "remove the ingress terminating service table entries";
195         input {
196              leaf dpid {
197                  type uint64;
198              }
199              leaf interface-name {
200                  type string;
201              }
202              leaf tunnel-key {
203                  type uint64;
204              }
205         }
206     }
207 }