Add support for BigDecimal to netconf mapping.
[controller.git] / opendaylight / config / yang-test / src / main / yang / config-test-impl.yang
1 module config-test-impl {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:test:impl";
4     prefix "it-impl";
5
6     import config-test { prefix test; revision-date 2013-06-13;}
7     import config { prefix config; revision-date 2013-04-05; }
8     import ietf-inet-types { prefix inet; revision-date 2010-09-24;}
9     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
10     import test-types { prefix tt; revision-date 2013-11-27; }
11
12     description
13         "Testing IMPL";
14
15     revision "2013-04-03" {
16         description
17             "Initial revision";
18     }
19
20     identity impl {
21         base config:module-type;
22         config:provided-service test:testing;
23         config:java-name-prefix TestImpl;
24     }
25
26     identity impl-dep {
27         base config:module-type;
28         config:provided-service test:testing;
29         config:java-name-prefix DepTestImpl;
30     }
31
32     identity impl-netconf {
33         base config:module-type;
34         config:provided-service test:testing;
35         config:java-name-prefix NetconfTestImpl;
36     }
37
38
39     augment "/config:modules/config:module/config:configuration" {
40         case impl {
41             when "/config:modules/config:module/config:type = 'impl'";
42
43            leaf-list allow-user  {
44                 type string;
45                 description "A list of user name patterns to allow";
46            }
47
48            container dto-a {
49                 leaf simple-arg {
50                     type uint32;
51                 }
52
53                 leaf port {
54                     type inet:port-number;
55                 }
56
57             }
58
59             leaf as-number {
60                 mandatory true;
61                 type inet:as-number;
62             }
63
64
65             leaf simpleInt {
66                 type uint32;
67                 default 99L;
68             }
69
70             container dto_b {
71                 leaf simple-int1 {
72                     type uint32;
73                 }
74
75                 leaf simple-int2 {
76                     type uint32;
77                 }
78             }
79
80         }
81     }
82
83     augment "/config:modules/config:module/config:state" {
84         case impl {
85             when "/config:modules/config:module/config:type = 'impl'";
86             // root runtime bean
87             leaf created-sessions {
88                 type uint32;
89             }
90         }
91     }
92
93     augment "/config:modules/config:module/config:configuration" {
94         case impl-dep {
95             when "/config:modules/config:module/config:type = 'impl-dep'";
96         }
97     }
98
99     augment "/config:modules/config:module/config:configuration" {
100         case impl-netconf {
101             when "/config:modules/config:module/config:type = 'impl-netconf'";
102             leaf binaryLeaf {
103                 type binary;
104             }
105
106             leaf type {
107                 type string;
108             }
109
110             leaf extended {
111                 type tt:extend-once;
112             }
113
114             leaf extended-twice {
115                 type tt:extend-twice;
116             }
117
118             leaf extended-enum {
119                 type tt:extend-enum;
120             }
121
122             leaf sleep-factor {
123                 type decimal64 {
124                     fraction-digits 2;
125                 }
126             }
127
128            container dto-c {
129                 leaf simple-arg {
130                     type uint32;
131                 }
132
133                 container dto-a-inner {
134                     leaf simple-arg {
135                         type uint32;
136                     }
137
138                     container dto-a-inner-inner {
139                         leaf simple-arg {
140                             type uint32;
141                         }
142                     }
143                 }
144             }
145
146             leaf simpleInt {
147                 type uint32;
148             }
149
150             leaf simpleBoolean {
151                 type boolean;
152                 default false;
153             }
154
155             leaf simple-long {
156                 type int64  ;
157             }
158
159             leaf simple-long-2 {
160                 type uint32;
161             }
162
163             leaf simple-BigInteger {
164                 type uint64;
165             }
166
167             leaf simple-byte {
168                 type int8;
169             }
170
171             leaf simple-short {
172                 type uint8;
173             }
174
175             leaf simple-test {
176                 type uint16;
177                 default 99;
178             }
179
180             leaf-list simple-list {
181                 type uint16;
182             }
183
184             container dto_d {
185                 leaf simple-int1 {
186                     type uint32;
187                 }
188
189                 leaf simple-int2 {
190                     type uint32;
191                 }
192
193                 leaf simple-int3 {
194                     type uint16;
195                 }
196
197                 leaf-list simple-list {
198                     type uint16;
199                 }
200
201                 list complex-dto-bInner {
202                     leaf-list simple-list {
203                         type uint16;
204                     }
205                     leaf simple-int3 {
206                         type uint16;
207                     }
208
209                     container deep {
210                         leaf simple-int3 {
211                             type uint16;
212                         }
213                     }
214                 }
215             }
216
217             list complex-list {
218                 list simple-list {
219                     leaf simple-int3 {
220                         type uint16;
221                     }
222                 }
223             }
224
225             list peers {
226                     leaf port {
227                         type string;
228                     }
229                     leaf core-size {
230                         type uint32;
231                     }
232                     leaf simple-int3 {
233                         type uint16;
234                     }
235             }
236
237             container testing-dep {
238                 uses config:service-ref {
239                     refine type {
240                         mandatory true;
241                         config:required-identity test:testing;
242                     }
243                 }
244             }
245         }
246     }
247
248     augment "/config:modules/config:module/config:state" {
249         case impl-netconf {
250             when "/config:modules/config:module/config:type = 'impl-netconf'";
251             // rpc
252             rpcx:rpc-context-instance "test-rpc";
253
254             // root runtime bean
255             leaf created-sessions {
256                 type uint32;
257             }
258
259             container asdf {
260                 leaf simpleInt {
261                     type uint16;
262                 }
263
264                 leaf simpleString {
265                     type string;
266                 }
267             }
268
269
270             list inner-running-data-additional {
271                 config:inner-state-bean;
272
273                 // rpc
274                 rpcx:rpc-context-instance "inner-test-rpc";
275
276                 key "simpleString";
277
278                 leaf simple-int3 {
279                         type uint16;
280                 }
281
282                 leaf simpleString {
283                     type string;
284                 }
285
286                 container deep4 {
287                     leaf boool {
288                         type boolean;
289                     }
290                 }
291             }
292
293              list inner-running-data {
294                 config:inner-state-bean;
295
296                 key "simple-int3";
297
298                 leaf simple-int3 {
299                         type uint16;
300                     }
301
302                     container deep2 {
303                     leaf boool {
304                         type boolean;
305                     }
306                  }
307
308                 list inner-inner-running-data {
309                     config:inner-state-bean;
310
311                     rpcx:rpc-context-instance "inner-inner-test-rpc";
312                     rpcx:rpc-context-instance "complex-output-rpc";
313
314                     key "simple-int3";
315
316                     leaf simple-int3 {
317                         type uint16;
318                     }
319
320                     leaf-list list-of-strings {
321                         type string;
322                     }
323
324                     list not-state-bean {
325                         leaf element {
326                             type string;
327                         }
328
329                         list not-state-bean-internal {
330                             // This should be ignored
331                             config:inner-state-bean;
332
333                             leaf element2 {
334                                 type string;
335                             }
336                         }
337                     }
338
339                     container deep3 {
340                         leaf boool {
341                             type boolean;
342                         }
343                     }
344                 }
345             }
346         }
347     }
348
349     identity test-rpc;
350     identity inner-test-rpc;
351     identity inner-inner-test-rpc;
352
353     identity complex-output-rpc;
354
355     rpc no-arg {
356         input {
357             uses rpcx:rpc-context-ref {
358                 refine context-instance {
359                     rpcx:rpc-context-instance test-rpc;
360                 }
361             }
362             leaf arg1 {
363                 type string;
364             }
365         }
366
367         output {
368             leaf result {
369                 type string;
370             }
371         }
372     }
373
374     rpc container-output {
375         input {
376             uses rpcx:rpc-context-ref {
377                 refine context-instance {
378                     rpcx:rpc-context-instance complex-output-rpc;
379                 }
380             }
381         }
382
383         output {
384             container retValContainer {
385                 leaf v1 {
386                     type string;
387                 }
388
389                 leaf v2 {
390                     type uint32;
391                 }
392             }
393         }
394     }
395
396     rpc leaf-list-output {
397         input {
398             uses rpcx:rpc-context-ref {
399                 refine context-instance {
400                     rpcx:rpc-context-instance complex-output-rpc;
401                 }
402             }
403         }
404
405         output {
406             leaf-list result {
407                 type string;
408             }
409         }
410     }
411
412     rpc list-output {
413         input {
414             uses rpcx:rpc-context-ref {
415                 refine context-instance {
416                     rpcx:rpc-context-instance complex-output-rpc;
417                 }
418             }
419         }
420
421         output {
422             list ret-val-list {
423                 leaf v2 {
424                     type uint32;
425                 }
426
427                 leaf v1 {
428                     type boolean;
429                 }
430             }
431         }
432     }
433
434     rpc noArgInner {
435         input {
436             uses rpcx:rpc-context-ref {
437                 refine context-instance {
438                     rpcx:rpc-context-instance inner-test-rpc;
439                 }
440             }
441         }
442     }
443
444     rpc noArgInnerInner {
445         input {
446             uses rpcx:rpc-context-ref {
447                 refine context-instance {
448                     rpcx:rpc-context-instance inner-inner-test-rpc;
449                 }
450             }
451
452             leaf arg1 {
453                 type uint16;
454             }
455
456             leaf arg2 {
457                 type boolean;
458             }
459         }
460          output {
461             leaf result {
462                 type boolean;
463             }
464         }
465     }
466 }