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