Get rid of some Eclipse warnings
[lispflowmapping.git] / mappingservice / api / src / main / yang / mappingservice.yang
1 module 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 lisp-proto { prefix lisp-proto; revision-date 2015-08-20; }
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 iid-uri {
52         description "IID 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 instance-id-context {
70         description "A classifier for instance-id 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 lisp-prefix {
78         uses lisp-proto:LispAddress;
79         leaf mask-length {
80             type uint8;
81         }
82     }
83
84     grouping mapping-authkey {
85         leaf key-type {
86             type uint16;
87         }
88         leaf authkey {
89             type string;
90         }
91     }
92
93     grouping db-instance {
94         description "Describes the mappings belonging to the same Instance ID";
95         leaf iid {
96             description "The 24-bit Instance ID";
97             type iid-uri;
98         }
99         list mapping {
100             description "A list of EID-to-RLOC mappings within the same Instance ID";
101             key "eid origin";
102             ext:context-instance "eid-context";
103             leaf eid {
104                 type eid-uri;
105             }
106             leaf origin {
107                 description "Mapping origin";
108                 type mapping-origin;
109             }
110             leaf-list site-id {
111                 description "Site ID";
112                 type site-id;
113             }
114             uses lisp-proto:EidToLocatorRecord;
115         }
116         list authentication-key {
117             description "A list of authentication keys for EID prefixes within the same Instance ID";
118             key "eid";
119             ext:context-instance "eid-context";
120             leaf eid {
121                 type eid-uri;
122             }
123             uses lisp-prefix;
124             uses mapping-authkey;
125         }
126     }
127
128     container mapping-database {
129         description "The LISP EID-to-RLOC mapping database";
130         list instance-id {
131             description "A list of LISP Instance IDs";
132             key "iid";
133             ext:context-instance "instance-id-context";
134             uses db-instance;
135         }
136     }
137
138     rpc add-key {
139         input {
140             uses lisp-prefix;
141             uses mapping-authkey;
142         }
143     }
144
145     rpc get-key {
146         input {
147             uses lisp-prefix;
148         }
149         output {
150             uses mapping-authkey;
151         }
152     }
153
154     rpc update-key {
155         input {
156             container eid {
157                 uses lisp-prefix;
158             }
159             container key {
160                 uses mapping-authkey;
161             }
162         }
163     }
164
165     rpc remove-key {
166         input {
167             uses lisp-prefix;
168         }
169     }
170
171     rpc add-mapping {
172         input {
173             uses lisp-proto:EidToLocatorRecord;
174         }
175     }
176
177     rpc get-mapping {
178         input {
179             uses lisp-prefix;
180         }
181         output {
182             uses lisp-proto:EidToLocatorRecords;
183         }
184     }
185
186     rpc update-mapping {
187         input {
188             uses lisp-proto:EidToLocatorRecord;
189         }
190     }
191
192     rpc remove-mapping {
193         input {
194             uses lisp-prefix;
195         }
196     }
197
198     notification mapping-changed {
199         description "Notification sent when a mapping is changed";
200         container mapping {
201             description "Mapping that has been changed";
202             uses lisp-proto:EidToLocatorRecord;
203         }
204         leaf change {
205             description "The type of change";
206             type mapping-change;
207         }
208     }
209 }