Reduce verbosity/criticality of inconsistent yangstore messages
[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                     default 1;
52                 }
53
54                 leaf port {
55                     type inet:port-number;
56                     default 8080;
57                 }
58
59                 leaf ip4 {
60                     type inet:ipv4-address;
61                     default 127.0.0.1;
62                 }
63
64             }
65
66             leaf as-number {
67                 type inet:as-number;
68                 default 44;
69             }
70
71
72             leaf simpleInt {
73                 type uint32;
74                 default 99;
75             }
76
77             container dto_b {
78                 leaf simple-int1 {
79                     type uint32;
80                     default 32;
81                 }
82
83                 leaf simple-int2 {
84                     type uint32;
85                 }
86             }
87
88         }
89     }
90
91     augment "/config:modules/config:module/config:state" {
92         case impl {
93             when "/config:modules/config:module/config:type = 'impl'";
94             // root runtime bean
95             leaf created-sessions {
96                 type uint32;
97             }
98         }
99     }
100
101     augment "/config:modules/config:module/config:configuration" {
102         case impl-dep {
103             when "/config:modules/config:module/config:type = 'impl-dep'";
104         }
105     }
106
107     augment "/config:modules/config:module/config:configuration" {
108         case impl-netconf {
109             when "/config:modules/config:module/config:type = 'impl-netconf'";
110             leaf binaryLeaf {
111                 type binary;
112                 default ZGVmYXVsdEJpbg==;
113             }
114
115             leaf type {
116                 type string;
117                 default "default-string";
118             }
119
120             leaf extended {
121                 type tt:extend-once;
122                 default 1;
123             }
124
125             leaf extended-twice {
126                 type tt:extend-twice;
127                 default 2;
128             }
129
130             leaf extended-enum {
131                 type tt:extend-enum;
132                 default ONE;
133             }
134
135             leaf ip {
136                 type inet:ip-address;
137                 default 0:0:0:0:0:0:0:1;
138             }
139
140             leaf union-test-attr {
141                 type tt:unionTest;
142                 default 456;
143             }
144
145             leaf sleep-factor {
146                 type decimal64 {
147                     fraction-digits 2;
148                 }
149                 default 2.00;
150             }
151
152            container dto-c {
153                 leaf simple-arg {
154                     type uint32;
155                 }
156
157                 container dto-a-inner {
158                     leaf simple-arg {
159                         type uint32;
160                     }
161
162                     container dto-a-inner-inner {
163                         leaf simple-arg {
164                             type uint32;
165                         }
166                     }
167                 }
168             }
169
170             leaf simpleInt {
171                 type uint32;
172             }
173
174             leaf simpleBoolean {
175                 type boolean;
176                 default false;
177             }
178
179             leaf simple-long {
180                 type int64;
181                 default -45;
182             }
183
184             leaf simple-long-2 {
185                 type uint32;
186                 default 445;
187             }
188
189             leaf simple-BigInteger {
190                 type uint64;
191                 default 545454;
192             }
193
194             leaf simple-byte {
195                 type int8;
196                 default -4;
197             }
198
199             leaf simple-short {
200                 type uint8;
201                 default 45;
202             }
203
204             leaf simple-test {
205                 type uint16;
206                 default 99;
207             }
208
209             leaf-list simple-list {
210                 type uint16;
211             }
212
213             container dto_d {
214                 leaf simple-int1 {
215                     type uint32;
216                 }
217
218                 leaf simple-int2 {
219                     type uint32;
220                 }
221
222                 leaf simple-int3 {
223                     type uint16;
224                 }
225
226                 leaf-list simple-list {
227                     type uint16;
228                 }
229
230                 list complex-dto-bInner {
231                     leaf-list simple-list {
232                         type uint16;
233                     }
234                     leaf simple-int3 {
235                         type uint16;
236                     }
237
238                     container deep {
239                         leaf simple-int3 {
240                             type uint16;
241                             default 0;
242                         }
243                     }
244                 }
245             }
246
247             list complex-list {
248                 list simple-list {
249                     leaf simple-int3 {
250                         type uint16;
251                     }
252                 }
253             }
254
255             list peers {
256                     leaf port {
257                         type string;
258                     }
259                     leaf core-size {
260                         type uint32;
261                     }
262                     leaf simple-int3 {
263                         type uint16;
264                     }
265             }
266
267             container testing-dep {
268                 uses config:service-ref {
269                     refine type {
270                         mandatory true;
271                         config:required-identity test:testing;
272                     }
273                 }
274             }
275
276             list testing-deps {
277                 uses config:service-ref {
278                     refine type {
279                         mandatory true;
280                         config:required-identity test:testing;
281                     }
282                 }
283             }
284         }
285     }
286
287     augment "/config:modules/config:module/config:state" {
288         case impl-netconf {
289             when "/config:modules/config:module/config:type = 'impl-netconf'";
290             // rpc
291             rpcx:rpc-context-instance "test-rpc";
292
293             // root runtime bean
294             leaf created-sessions {
295                 type uint32;
296             }
297
298             container asdf {
299                 leaf simpleInt {
300                     type uint16;
301                 }
302
303                 leaf simpleString {
304                     type string;
305                 }
306             }
307
308
309             list inner-running-data-additional {
310                 config:inner-state-bean;
311
312                 // rpc
313                 rpcx:rpc-context-instance "inner-test-rpc";
314
315                 key "simpleString";
316
317                 leaf simple-int3 {
318                         type uint16;
319                 }
320
321                 leaf simpleString {
322                     type string;
323                 }
324
325                 container deep4 {
326                     leaf boool {
327                         type boolean;
328                     }
329                 }
330             }
331
332              list inner-running-data {
333                 config:inner-state-bean;
334
335                 key "simple-int3";
336
337                 leaf simple-int3 {
338                         type uint16;
339                     }
340
341                     container deep2 {
342                     leaf boool {
343                         type boolean;
344                     }
345                  }
346
347                 list inner-inner-running-data {
348                     config:inner-state-bean;
349
350                     rpcx:rpc-context-instance "inner-inner-test-rpc";
351                     rpcx:rpc-context-instance "complex-output-rpc";
352
353                     key "simple-int3";
354
355                     leaf simple-int3 {
356                         type uint16;
357                     }
358
359                     leaf-list list-of-strings {
360                         type string;
361                     }
362
363                     list not-state-bean {
364                         leaf element {
365                             type string;
366                         }
367
368                         list not-state-bean-internal {
369                             // This should be ignored
370                             config:inner-state-bean;
371
372                             leaf element2 {
373                                 type string;
374                             }
375                         }
376                     }
377
378                     container deep3 {
379                         leaf boool {
380                             type boolean;
381                         }
382                     }
383                 }
384             }
385         }
386     }
387
388     identity test-rpc;
389     identity inner-test-rpc;
390     identity inner-inner-test-rpc;
391
392     identity complex-output-rpc;
393
394     rpc no-arg {
395         input {
396             uses rpcx:rpc-context-ref {
397                 refine context-instance {
398                     rpcx:rpc-context-instance test-rpc;
399                 }
400             }
401             leaf arg1 {
402                 type string;
403             }
404         }
405
406         output {
407             leaf result {
408                 type string;
409             }
410         }
411     }
412
413     rpc container-output {
414         input {
415             uses rpcx:rpc-context-ref {
416                 refine context-instance {
417                     rpcx:rpc-context-instance complex-output-rpc;
418                 }
419             }
420         }
421
422         output {
423             container retValContainer {
424                 leaf v1 {
425                     type string;
426                     default "from rpc";
427                 }
428
429                 leaf v2 {
430                     type uint32;
431                 }
432             }
433         }
434     }
435
436     rpc leaf-list-output {
437         input {
438             uses rpcx:rpc-context-ref {
439                 refine context-instance {
440                     rpcx:rpc-context-instance complex-output-rpc;
441                 }
442             }
443         }
444
445         output {
446             leaf-list result {
447                 type string;
448             }
449         }
450     }
451
452     rpc list-output {
453         input {
454             uses rpcx:rpc-context-ref {
455                 refine context-instance {
456                     rpcx:rpc-context-instance complex-output-rpc;
457                 }
458             }
459         }
460
461         output {
462             list ret-val-list {
463                 leaf v2 {
464                     type uint32;
465                 }
466
467                 leaf v1 {
468                     type boolean;
469                 }
470             }
471         }
472     }
473
474     rpc noArgInner {
475         input {
476             uses rpcx:rpc-context-ref {
477                 refine context-instance {
478                     rpcx:rpc-context-instance inner-test-rpc;
479                 }
480             }
481         }
482     }
483
484     rpc noArgInnerInner {
485         input {
486             uses rpcx:rpc-context-ref {
487                 refine context-instance {
488                     rpcx:rpc-context-instance inner-inner-test-rpc;
489                 }
490             }
491
492             leaf arg1 {
493                 type uint16;
494             }
495
496             leaf arg2 {
497                 type boolean;
498             }
499         }
500          output {
501             leaf result {
502                 type boolean;
503             }
504         }
505     }
506 }