Merge branch 'master' into topic/ietf_yang
[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 site-id {
45         description "64 bit site identifier";
46         type binary {
47             length "8";
48         }
49     }
50
51     typedef vni-uri {
52         description "VNI as a string lookup key in a URI";
53         type inet:uri;
54     }
55
56     typedef eid-uri {
57         description "EID as a string lookup key in a URI";
58         type inet:uri;
59     }
60
61     typedef mapping-change {
62         description "Type of mapping update";
63         type enumeration {
64             enum updated;
65             enum removed;
66         }
67     }
68
69     identity vni-context {
70         description "A classifier for virtual-network-identifier elements which allows direct access to a particular element in the data tree.";
71     }
72
73     identity eid-context {
74         description "A classifier for endpoint-id elements which allows direct access to a particular element in the data tree.";
75     }
76
77     grouping mapping-authkey-container {
78         container mapping-authkey {
79             leaf key-string {
80                 type string;
81             }
82             leaf key-type {
83                 type uint16;
84             }
85         }
86     }
87
88     grouping mapping-authkey-list {
89         list mapping-authkey-item {
90             key "mapping-authkey-item-id";
91             leaf mapping-authkey-item-id {
92                 type string;
93             }
94             uses mapping-authkey-container;
95         }
96     }
97
98     grouping eid-authkey-list {
99         list eid-authkey-item {
100             key "eid-authkey-item-id";
101             leaf eid-authkey-item-id {
102                 type string;
103             }
104             uses lisp-proto:eid-container;
105             uses mapping-authkey-container;
106         }
107     }
108
109     grouping db-instance {
110         description "Describes the mappings belonging to the same Virtual Network Identifier";
111         leaf vni {
112             description "The 24-bit Virtual Network Identifier";
113             type vni-uri;
114         }
115         list mapping {
116             description "A list of EID-to-RLOC mappings within the same Instance ID";
117             key "eid-uri origin";
118             ext:context-instance "eid-context";
119             leaf eid-uri {
120                 type eid-uri;
121             }
122             leaf origin {
123                 description "Mapping origin";
124                 type mapping-origin;
125             }
126             leaf-list site-id {
127                 description "Site ID";
128                 type site-id;
129             }
130             uses lisp-proto:mapping-record-container;
131         }
132         list authentication-key {
133             description "A list of authentication keys for EID prefixes within the same Virtual Network Identifier";
134             key "eid-uri";
135             ext:context-instance "eid-context";
136             leaf eid-uri {
137                 type eid-uri;
138             }
139             uses lisp-proto:eid-container;
140             uses mapping-authkey-container;
141         }
142     }
143
144     container mapping-database {
145         description "The LISP EID-to-RLOC mapping database";
146         list virtual-network-identifier {
147             description "A list of Virtual Network Identifiers";
148             key "vni";
149             ext:context-instance "vni-context";
150             uses db-instance;
151         }
152     }
153
154     rpc add-key {
155         input {
156             uses lisp-proto:eid-container;
157             uses mapping-authkey-container;
158         }
159     }
160
161     rpc get-key {
162         input {
163             uses lisp-proto:eid-container;
164         }
165         output {
166             uses mapping-authkey-container;
167         }
168     }
169
170     rpc update-key {
171         input {
172             uses lisp-proto:eid-container;
173             uses mapping-authkey-container;
174         }
175     }
176
177     rpc remove-key {
178         input {
179             uses lisp-proto:eid-container;
180         }
181     }
182
183     rpc add-mapping {
184         input {
185             uses lisp-proto:mapping-record-container;
186         }
187     }
188
189     rpc get-mapping {
190         input {
191             uses lisp-proto:eid-container;
192         }
193         output {
194             uses lisp-proto:mapping-record-container;
195         }
196     }
197
198     rpc update-mapping {
199         input {
200             uses lisp-proto:mapping-record-container;
201         }
202     }
203
204     rpc remove-mapping {
205         input {
206             uses lisp-proto:eid-container;
207         }
208     }
209
210     rpc add-keys {
211         input {
212             uses eid-authkey-list;
213         }
214     }
215
216     rpc get-keys {
217         input {
218             uses lisp-proto:eid-list;
219         }
220         output {
221             uses eid-authkey-list;
222         }
223     }
224
225     rpc update-keys {
226         input {
227             uses eid-authkey-list;
228         }
229     }
230
231     rpc remove-keys {
232         input {
233             uses lisp-proto:eid-list;
234         }
235     }
236
237     rpc add-mappings {
238         input {
239             uses lisp-proto:mapping-record-list;
240         }
241     }
242
243     rpc get-mappings {
244         input {
245             uses lisp-proto:eid-list;
246         }
247         output {
248             uses lisp-proto:mapping-record-list;
249         }
250     }
251
252     rpc update-mappings {
253         input {
254             uses lisp-proto:mapping-record-list;
255         }
256     }
257
258     rpc remove-mappings {
259         input {
260             uses lisp-proto:eid-list;
261         }
262     }
263
264     rpc get-all-keys {
265         output {
266             uses eid-authkey-list;
267         }
268     }
269
270     rpc get-all-mappings {
271         output {
272             uses lisp-proto:mapping-record-list;
273         }
274     }
275
276     rpc remove-all-keys {
277     }
278
279     rpc remove-all-mappings {
280     }
281
282     notification mapping-changed {
283         description "Notification sent when a mapping is changed";
284         leaf change-type {
285             description "The type of change";
286             type mapping-change;
287         }
288         uses lisp-proto:mapping-record-container;
289     }
290 }