Switch to using lisp-address instead of LispAddress
[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-address-types { prefix lisp-address; revision-date 2015-03-09; }
11     import lisp-proto { prefix lisp-proto; revision-date 2015-08-20; }
12
13     contact "Lorand Jakab <lojakab@cisco.com";
14
15     description
16         "An MD-SAL based implementation of a LISP Map-Server database";
17
18     revision "2015-09-06" {
19         description "Renamed and moved module to mappingservice.api.";
20     }
21
22     identity mappingservice {
23         base config:service-type;
24         config:java-class "org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingService";
25     }
26
27     identity mappingservice-shell {
28         base config:service-type;
29         config:java-class "org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingServiceShell";
30     }
31
32     identity lisp-mappingservice {
33         base config:service-type;
34         config:java-class "org.opendaylight.lispflowmapping.interfaces.lisp.IFlowMapping";
35     }
36
37     typedef mapping-origin {
38         description "The originating entity of an EID-to-RLOC mapping";
39         type enumeration {
40             enum northbound;
41             enum southbound;
42         }
43     }
44
45     typedef site-id {
46         description "64 bit site identifier";
47         type binary {
48             length "8";
49         }
50     }
51
52     typedef iid-uri {
53         description "IID as a string lookup key in a URI";
54         type inet:uri;
55     }
56
57     typedef eid-uri {
58         description "EID as a string lookup key in a URI";
59         type inet:uri;
60     }
61
62     typedef mapping-change {
63         description "Type of mapping update";
64         type enumeration {
65             enum updated;
66             enum removed;
67         }
68     }
69
70     identity instance-id-context {
71         description "A classifier for instance-id elements which allows direct access to a particular element in the data tree.";
72     }
73
74     identity eid-context {
75         description "A classifier for endpoint-id elements which allows direct access to a particular element in the data tree.";
76     }
77
78     grouping mapping-authkey {
79         leaf key-type {
80             type uint16;
81         }
82         leaf authkey {
83             type string;
84         }
85     }
86
87     grouping db-instance {
88         description "Describes the mappings belonging to the same Instance ID";
89         leaf iid {
90             description "The 24-bit Instance ID";
91             type iid-uri;
92         }
93         list mapping {
94             description "A list of EID-to-RLOC mappings within the same Instance ID";
95             key "eid origin";
96             ext:context-instance "eid-context";
97             leaf eid {
98                 type eid-uri;
99             }
100             leaf origin {
101                 description "Mapping origin";
102                 type mapping-origin;
103             }
104             leaf-list site-id {
105                 description "Site ID";
106                 type site-id;
107             }
108             uses lisp-proto:EidToLocatorRecord;
109         }
110         list authentication-key {
111             description "A list of authentication keys for EID prefixes within the same Instance ID";
112             key "eid";
113             ext:context-instance "eid-context";
114             leaf eid {
115                 type eid-uri;
116             }
117             uses lisp-address:lisp-address;
118             uses mapping-authkey;
119         }
120     }
121
122     container mapping-database {
123         description "The LISP EID-to-RLOC mapping database";
124         list instance-id {
125             description "A list of LISP Instance IDs";
126             key "iid";
127             ext:context-instance "instance-id-context";
128             uses db-instance;
129         }
130     }
131
132     rpc add-key {
133         input {
134             uses lisp-address:lisp-address;
135             uses mapping-authkey;
136         }
137     }
138
139     rpc get-key {
140         input {
141             uses lisp-address:lisp-address;
142         }
143         output {
144             uses mapping-authkey;
145         }
146     }
147
148     rpc update-key {
149         input {
150             container eid {
151                 uses lisp-address:lisp-address;
152             }
153             container key {
154                 uses mapping-authkey;
155             }
156         }
157     }
158
159     rpc remove-key {
160         input {
161             uses lisp-address:lisp-address;
162         }
163     }
164
165     rpc add-mapping {
166         input {
167             uses lisp-proto:EidToLocatorRecord;
168         }
169     }
170
171     rpc get-mapping {
172         input {
173             uses lisp-address:lisp-address;
174         }
175         output {
176             uses lisp-proto:EidToLocatorRecords;
177         }
178     }
179
180     rpc update-mapping {
181         input {
182             uses lisp-proto:EidToLocatorRecord;
183         }
184     }
185
186     rpc remove-mapping {
187         input {
188             uses lisp-address:lisp-address;
189         }
190     }
191
192     notification mapping-changed {
193         description "Notification sent when a mapping is changed";
194         container mapping {
195             description "Mapping that has been changed";
196             uses lisp-proto:EidToLocatorRecord;
197         }
198         leaf change {
199             description "The type of change";
200             type mapping-change;
201         }
202     }
203 }