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