Prepare the YANG models for RESTCONF
[lispflowmapping.git] / mappingservice / yangmodel / src / main / yang / lfm-mapping-database.yang
1 module lfm-mapping-database {
2
3     yang-version 1;
4     namespace "urn:opendaylight:lfm-mapping-database";
5     prefix "lfm-mapping-database";
6
7     import lfm-control-plane { prefix lfm-cp; revision-date 2015-03-14; }
8
9     contact "Lorand Jakab <lojakab@cisco.com";
10
11     description
12         "An MD-SAL based implementation of a LISP Map-Server database";
13
14     revision "2015-03-14" {
15         description "Initial revision.";
16     }
17
18     typedef key-ref {
19         type instance-identifier;
20     }
21
22     typedef mapping-ref {
23         type instance-identifier;
24     }
25
26     grouping mapping-key {
27         uses lfm-cp:LispAddress;
28         leaf key-type {
29             type uint16;
30         }
31         leaf key {
32             type string;
33         }
34     }
35
36     rpc add-key {
37         input {
38             uses mapping-key;
39         }
40         output {
41             leaf key-ref {
42                 type key-ref;
43             }
44         }
45     }
46
47     rpc get-key {
48         input {
49             uses lfm-cp:LispAddress;
50         }
51         output {
52             leaf key-ref {
53                 type key-ref;
54             }
55             uses mapping-key;
56         }
57     }
58
59     rpc update-key {
60         input {
61             container eid {
62                 uses lfm-cp:LispAddress;
63             }
64             container key {
65                 uses mapping-key;
66             }
67         }
68     }
69
70     rpc remove-key {
71         input {
72             uses lfm-cp:LispAddress;
73         }
74     }
75
76     rpc get-key-with-ref {
77         input {
78             leaf key-ref {
79                 type key-ref;
80             }
81         }
82         output {
83             uses mapping-key;
84         }
85     }
86
87     rpc update-key-with-ref {
88         input {
89             leaf key-ref {
90                 type key-ref;
91             }
92             uses mapping-key;
93         }
94     }
95
96     rpc remove-key-with-ref {
97         input {
98             leaf key-ref {
99                 type key-ref;
100             }
101         }
102     }
103
104     rpc add-mapping {
105         input {
106             uses lfm-cp:EidToLocatorRecord;
107         }
108         output {
109             leaf map-ref {
110                 type mapping-ref;
111             }
112         }
113     }
114
115     rpc get-mapping {
116         input {
117             uses lfm-cp:LispAddress;
118         }
119         output {
120             leaf map-ref {
121                 type mapping-ref;
122             }
123             uses lfm-cp:EidToLocatorRecord;
124         }
125     }
126
127     rpc update-mapping {
128         input {
129             container eid {
130                 uses lfm-cp:LispAddress;
131             }
132             container mapping {
133                 uses lfm-cp:EidToLocatorRecord;
134             }
135         }
136     }
137
138     rpc remove-mapping {
139         input {
140             uses lfm-cp:LispAddress;
141         }
142     }
143
144     rpc get-mapping-with-ref {
145         input {
146             leaf map-ref {
147                 type mapping-ref;
148             }
149         }
150         output {
151             uses lfm-cp:EidToLocatorRecord;
152         }
153     }
154
155     rpc update-mapping-with-ref {
156         input {
157             leaf map-ref {
158                 type mapping-ref;
159             }
160             uses lfm-cp:EidToLocatorRecord;
161         }
162     }
163
164     rpc remove-mapping-with-ref {
165         input {
166             leaf map-ref {
167                 type mapping-ref;
168             }
169         }
170     }
171 }