Merge "JUnit test - MultiTableMapCacheTest"
[lispflowmapping.git] / mappingservice / api / src / main / yang / odl-mappingservice.yang
1 module odl-mappingservice {
2
3     yang-version 1;
4     namespace "urn:opendaylight:lfm:mappingservice";
5     prefix "mappingservice";
6
7     import config { prefix config; revision-date 2013-04-05; }
8     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
9     import yang-ext { prefix ext; revision-date 2013-07-09; }
10     import odl-lisp-proto { prefix lisp-proto; revision-date 2015-11-05; }
11
12     contact "Lorand Jakab <lojakab@cisco.com";
13
14     description
15         "An MD-SAL based implementation of a LISP Map-Server database";
16
17     revision "2015-09-06" {
18         description "Renamed and moved module to mappingservice.api.";
19     }
20
21     identity mappingservice {
22         base config:service-type;
23         config:java-class "org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService";
24     }
25
26     identity mappingservice-shell {
27         base config:service-type;
28         config:java-class "org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingServiceShell";
29     }
30
31     identity lisp-mappingservice {
32         base config:service-type;
33         config:java-class "org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping";
34     }
35
36     typedef mapping-origin {
37         description "The originating entity of an EID-to-RLOC mapping";
38         type enumeration {
39             enum northbound;
40             enum southbound;
41         }
42     }
43
44     typedef vni-uri {
45         description "VNI as a string lookup key in a URI";
46         type inet:uri;
47     }
48
49     typedef eid-uri {
50         description "EID as a string lookup key in a URI";
51         type inet:uri;
52     }
53
54     typedef xtr-id-uri {
55         description "xTR-ID as a string lookup key in a URI";
56         type inet:uri;
57     }
58
59     typedef mapping-change {
60         description "Type of mapping update";
61         type enumeration {
62             enum created;
63             enum updated;
64             enum removed;
65         }
66     }
67
68     identity vni-context {
69         description "A classifier for virtual-network-identifier elements which allows direct access to a particular element in the data tree.";
70     }
71
72     identity eid-context {
73         description "A classifier for endpoint-id elements which allows direct access to a particular element in the data tree.";
74     }
75
76     identity xtrid-context {
77         description "A classifier for xtr-id elements which allows direct access to a particular element in the data tree.";
78     }
79
80     grouping mapping-authkey-container {
81         container mapping-authkey {
82             leaf key-string {
83                 type string;
84             }
85             leaf key-type {
86                 type uint16;
87             }
88         }
89     }
90
91     grouping mapping-authkey-list {
92         list mapping-authkey-item {
93             key "mapping-authkey-item-id";
94             leaf mapping-authkey-item-id {
95                 type string;
96             }
97             uses mapping-authkey-container;
98         }
99     }
100
101     grouping eid-authkey-list {
102         list eid-authkey-item {
103             key "eid-authkey-item-id";
104             leaf eid-authkey-item-id {
105                 type string;
106             }
107             uses lisp-proto:eid-container;
108             uses mapping-authkey-container;
109         }
110     }
111
112     grouping db-instance {
113         description "Describes the mappings belonging to the same Virtual Network Identifier";
114         leaf vni {
115             description "The 24-bit Virtual Network Identifier";
116             type vni-uri;
117         }
118         list mapping {
119             description "A list of EID-to-RLOC mappings within the same Instance ID";
120             key "eid-uri origin";
121             ext:context-instance "eid-context";
122             leaf eid-uri {
123                 type eid-uri;
124             }
125             leaf origin {
126                 description "Mapping origin";
127                 type mapping-origin;
128             }
129             leaf-list site-id {
130                 description "Site ID";
131                 type lisp-proto:site-id;
132             }
133             uses lisp-proto:mapping-record-container;
134             list xtr-id-mapping {
135                 description "A list of xTR-IDs with their associated mappings";
136                 config false;
137                 key "xtr-id-uri";
138                 ext:context-instance "xtrid-context";
139                 leaf xtr-id-uri {
140                     type xtr-id-uri;
141                 }
142                 uses lisp-proto:mapping-record-container;
143             }
144         }
145         list authentication-key {
146             description "A list of authentication keys for EID prefixes within the same Virtual Network Identifier";
147             key "eid-uri";
148             ext:context-instance "eid-context";
149             leaf eid-uri {
150                 type eid-uri;
151             }
152             uses lisp-proto:eid-container;
153             uses mapping-authkey-container;
154         }
155     }
156
157     container mapping-database {
158         description "The LISP EID-to-RLOC mapping database";
159         list virtual-network-identifier {
160             description "A list of Virtual Network Identifiers";
161             key "vni";
162             ext:context-instance "vni-context";
163             uses db-instance;
164         }
165     }
166
167     rpc add-key {
168         input {
169             uses lisp-proto:eid-container;
170             uses mapping-authkey-container;
171         }
172     }
173
174     rpc get-key {
175         input {
176             uses lisp-proto:eid-container;
177         }
178         output {
179             uses mapping-authkey-container;
180         }
181     }
182
183     rpc update-key {
184         input {
185             uses lisp-proto:eid-container;
186             uses mapping-authkey-container;
187         }
188     }
189
190     rpc remove-key {
191         input {
192             uses lisp-proto:eid-container;
193         }
194     }
195
196     rpc add-mapping {
197         input {
198             uses lisp-proto:mapping-record-container;
199         }
200     }
201
202     rpc get-mapping {
203         input {
204             uses lisp-proto:eid-container;
205         }
206         output {
207             uses lisp-proto:mapping-record-container;
208         }
209     }
210
211     rpc update-mapping {
212         input {
213             uses lisp-proto:mapping-record-container;
214         }
215     }
216
217     rpc remove-mapping {
218         input {
219             uses lisp-proto:eid-container;
220         }
221     }
222
223     rpc add-keys {
224         input {
225             uses eid-authkey-list;
226         }
227     }
228
229     rpc get-keys {
230         input {
231             uses lisp-proto:eid-list;
232         }
233         output {
234             uses eid-authkey-list;
235         }
236     }
237
238     rpc update-keys {
239         input {
240             uses eid-authkey-list;
241         }
242     }
243
244     rpc remove-keys {
245         input {
246             uses lisp-proto:eid-list;
247         }
248     }
249
250     rpc add-mappings {
251         input {
252             uses lisp-proto:mapping-record-list;
253         }
254     }
255
256     rpc get-mappings {
257         input {
258             uses lisp-proto:eid-list;
259         }
260         output {
261             uses lisp-proto:mapping-record-list;
262         }
263     }
264
265     rpc update-mappings {
266         input {
267             uses lisp-proto:mapping-record-list;
268         }
269     }
270
271     rpc remove-mappings {
272         input {
273             uses lisp-proto:eid-list;
274         }
275     }
276
277     rpc get-all-keys {
278         output {
279             uses eid-authkey-list;
280         }
281     }
282
283     rpc get-all-mappings {
284         output {
285             uses lisp-proto:mapping-record-list;
286         }
287     }
288
289     rpc remove-all-keys {
290     }
291
292     rpc remove-all-mappings {
293     }
294
295     notification mapping-changed {
296         description "Notification sent when a mapping is changed";
297         leaf change-type {
298             description "The type of change";
299             type mapping-change;
300         }
301         uses lisp-proto:mapping-record-container;
302     }
303 }