0ca995bf45b33e4a0c0448de55781a7342cadd30
[vpnservice.git] / itm / itm-api / src / main / yang / itm-rpc.yang
1 module itm-rpc {
2     namespace "urn:opendaylight:vpnservice:itm:rpcs";
3     prefix "itmrpcs";
4
5     import ietf-inet-types {
6         prefix inet;
7         revision-date "2010-09-24";
8     }
9
10     import ietf-yang-types {
11               prefix yang;
12       }
13
14     import ietf-interfaces {
15         prefix if; revision-date 2014-05-08;
16     }
17
18     import odl-interface {
19         prefix odlif;
20         revision-date "2015-03-31";
21     }
22
23     import opendaylight-action-types {prefix action;revision-date "2013-11-12";}
24     import opendaylight-flow-types {prefix offlow;revision-date "2013-10-26";}
25
26
27     revision "2015-12-17" {
28         description "ODL Specific Itm Manager Rpcs Module";
29     }
30
31     /* RPCs */
32
33     rpc get-tunnel-interface-name {
34         description "used to retrieve tunnel interface id between Dpns";
35         input {
36             leaf source-dpid {
37                  type uint64;
38             }
39             leaf destination-dpid {
40                  type uint64;
41             }
42             leaf tunnel-type {
43                 type identityref {
44                     base odlif:tunnel-type-base;
45                 }
46             }
47         }
48         output {
49             leaf interface-name {
50                 type string;
51             }
52         }
53     }
54
55     rpc get-internal-or-external-interface-name {
56         description "used to retrieve tunnel interface id with src Dpn and destination ip";
57             input {
58                 leaf source-dpid {
59                 type uint64;
60                 }
61                 leaf destination-ip {
62                 type inet:ip-address;
63                 }
64                 leaf tunnel-type {
65                     type identityref {
66                         base odlif:tunnel-type-base;
67                     }
68                 }
69             }
70             output {
71                 leaf interface-name {
72                     type string;
73                 }
74         }
75     }
76
77     rpc get-external-tunnel-interface-name {
78         description "used to retrieve external tunnel interface id between Dpns/TORs";
79         input {
80             leaf source-node {
81             type string;
82             }
83             leaf destination-node {
84             type string;
85             }
86             leaf tunnel-type {
87                 type identityref {
88                     base odlif:tunnel-type-base;
89                 }
90             }
91         }
92         output {
93             leaf interface-name {
94                 type string;
95             }
96         }
97     }
98
99     rpc build-external-tunnel-from-dpns {
100         description "used for building tunnels between a Dpn and external node";
101         input {
102             leaf-list dpn-id {
103                 type uint64;
104             }
105             leaf destination-ip {
106                 type inet:ip-address;
107             }
108             leaf tunnel-type {
109             type identityref {
110                 base odlif:tunnel-type-base;
111             }
112             }
113         }
114      }
115
116     rpc add-external-tunnel-endpoint {
117         description "used for building tunnels between teps on all Dpns and external node";
118         input {
119             leaf destination-ip {
120                  type inet:ip-address;
121             }
122             leaf tunnel-type {
123             type identityref {
124                 base odlif:tunnel-type-base;
125             }
126             }
127         }
128     }
129     rpc remove-external-tunnel-from-dpns {
130         description "used for building tunnels between a Dpn and external node";
131         input {
132             leaf-list dpn-id {
133                 type uint64;
134             }
135             leaf destination-ip {
136                 type inet:ip-address;
137             }
138             leaf tunnel-type {
139             type identityref {
140                 base odlif:tunnel-type-base;
141             }
142             }
143         }
144      }
145
146      rpc remove-external-tunnel-endpoint {
147         description "used for building tunnels between teps on all Dpns and external node";
148         input {
149             leaf destination-ip {
150                  type inet:ip-address;
151             }
152             leaf tunnel-type {
153             type identityref {
154                 base odlif:tunnel-type-base;
155             }
156             }
157         }
158      }
159
160      rpc create-terminating-service-actions {
161          description  "used for programming the terminating service actions";
162          input {
163              leaf dpn-id {
164                type uint64;
165              }
166              leaf service-id {
167                 type uint16;
168              }
169              uses offlow:instruction-list;
170          }
171      }
172
173     rpc remove-terminating-service-actions {
174         description  "used for removing the terminating service actions";
175         input {
176             leaf dpn-id {
177                     type uint64;
178             }
179             leaf service-id {
180                 type uint16;
181             }
182         }
183     }
184
185     rpc add-l2-gw-device {
186         description "used for building tunnels between teps on all Dpns and hwVtep";
187         input {
188             leaf topology-id {
189                 type string;
190             }
191             leaf node-id {
192                 type string;
193             }
194             leaf ip-address {
195                 type inet:ip-address;
196             }
197         }
198     }
199
200     rpc add-l2-gw-mlag-device {
201             description "used for building tunnels between teps on all Dpns and hwVtep";
202             input {
203                 leaf topology-id {
204                     type string;
205                 }
206                 leaf-list node-id {
207                     type string;
208                 }
209                 leaf ip-address {
210                     type inet:ip-address;
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 }