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