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