BUG-624 make netconf tcp address optional in config.ini with default value set to...
[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             leaf binaryLeaf {
166                 type binary;
167                 default ZGVmYXVsdEJpbg==;
168             }
169
170             leaf type {
171                 type string;
172                 default "default-string";
173             }
174
175             leaf extended {
176                 type tt:extend-once;
177                 default 1;
178             }
179
180             leaf extended-twice {
181                 type tt:extend-twice;
182                 default 2;
183             }
184
185             leaf extended-enum {
186                 type tt:extend-enum;
187                 default ONE;
188             }
189
190             leaf ip {
191                 type inet:ip-address;
192                 default 0:0:0:0:0:0:0:1;
193             }
194
195             leaf union-test-attr {
196                 type tt:unionTest;
197                 default 456;
198             }
199
200             leaf sleep-factor {
201                 type decimal64 {
202                     fraction-digits 2;
203                 }
204                 default 2.00;
205             }
206
207            container dto-c {
208                 leaf simple-arg {
209                     type uint32;
210                 }
211
212                 container dto-a-inner {
213                     leaf simple-arg {
214                         type uint32;
215                     }
216
217                     container dto-a-inner-inner {
218                         leaf simple-arg {
219                             type uint32;
220                         }
221                     }
222                 }
223             }
224
225             leaf simpleInt {
226                 type uint32;
227             }
228
229             leaf simpleBoolean {
230                 type boolean;
231                 default false;
232             }
233
234             leaf simple-long {
235                 type int64;
236                 default -45;
237             }
238
239             leaf simple-long-2 {
240                 type uint32;
241                 default 445;
242             }
243
244             leaf simple-BigInteger {
245                 type uint64;
246                 default 545454;
247             }
248
249             leaf simple-byte {
250                 type int8;
251                 default -4;
252             }
253
254             leaf simple-short {
255                 type uint8;
256                 default 45;
257             }
258
259             leaf simple-test {
260                 type uint16;
261                 default 99;
262             }
263
264             leaf-list simple-list {
265                 type uint16;
266             }
267
268             container dto_d {
269                 leaf simple-int1 {
270                     type uint32;
271                 }
272
273                 leaf simple-int2 {
274                     type uint32;
275                 }
276
277                 leaf simple-int3 {
278                     type uint16;
279                 }
280
281                 leaf-list simple-list {
282                     type uint16;
283                 }
284
285                 list complex-dto-bInner {
286                     leaf-list simple-list {
287                         type uint16;
288                     }
289                     leaf simple-int3 {
290                         type uint16;
291                     }
292
293                     container deep {
294                         leaf simple-int3 {
295                             type uint16;
296                             default 0;
297                         }
298                     }
299                 }
300             }
301
302             list complex-list {
303                 list simple-list {
304                     leaf simple-int3 {
305                         type uint16;
306                     }
307                 }
308             }
309
310             list peers {
311                     leaf port {
312                         type string;
313                     }
314                     leaf core-size {
315                         type uint32;
316                     }
317                     leaf simple-int3 {
318                         type uint16;
319                     }
320             }
321
322             container testing-dep {
323                 uses config:service-ref {
324                     refine type {
325                         mandatory true;
326                         config:required-identity test:testing;
327                     }
328                 }
329             }
330
331             list testing-deps {
332                 uses config:service-ref {
333                     refine type {
334                         mandatory true;
335                         config:required-identity test:testing;
336                     }
337                 }
338             }
339         }
340     }
341
342     augment "/config:modules/config:module/config:state" {
343         case impl-netconf {
344             when "/config:modules/config:module/config:type = 'impl-netconf'";
345             // rpc
346             rpcx:rpc-context-instance "test-rpc";
347
348             // root runtime bean
349             leaf created-sessions {
350                 type uint32;
351             }
352
353             container asdf {
354                 leaf simpleInt {
355                     type uint16;
356                 }
357
358                 leaf simpleString {
359                     type string;
360                 }
361             }
362
363
364             list inner-running-data-additional {
365                 config:inner-state-bean;
366
367                 // rpc
368                 rpcx:rpc-context-instance "inner-test-rpc";
369
370                 key "simpleString";
371
372                 leaf simple-int3 {
373                         type uint16;
374                 }
375
376                 leaf simpleString {
377                     type string;
378                 }
379
380                 container deep4 {
381                     leaf boool {
382                         type boolean;
383                     }
384                 }
385             }
386
387              list inner-running-data {
388                 config:inner-state-bean;
389
390                 key "simple-int3";
391
392                 leaf simple-int3 {
393                         type uint16;
394                     }
395
396                     container deep2 {
397                     leaf boool {
398                         type boolean;
399                     }
400                  }
401
402                 list inner-inner-running-data {
403                     config:inner-state-bean;
404
405                     rpcx:rpc-context-instance "inner-inner-test-rpc";
406                     rpcx:rpc-context-instance "complex-output-rpc";
407
408                     key "simple-int3";
409
410                     leaf simple-int3 {
411                         type uint16;
412                     }
413
414                     leaf-list list-of-strings {
415                         type string;
416                     }
417
418                     list not-state-bean {
419                         leaf element {
420                             type string;
421                         }
422
423                         list not-state-bean-internal {
424                             // This should be ignored
425                             config:inner-state-bean;
426
427                             leaf element2 {
428                                 type string;
429                             }
430                         }
431                     }
432
433                     container deep3 {
434                         leaf boool {
435                             type boolean;
436                         }
437                     }
438                 }
439             }
440         }
441     }
442
443     identity test-rpc;
444     identity inner-test-rpc;
445     identity inner-inner-test-rpc;
446
447     identity complex-output-rpc;
448
449     rpc no-arg {
450         input {
451             uses rpcx:rpc-context-ref {
452                 refine context-instance {
453                     rpcx:rpc-context-instance test-rpc;
454                 }
455             }
456             leaf arg1 {
457                 type string;
458             }
459         }
460
461         output {
462             leaf result {
463                 type string;
464             }
465         }
466     }
467
468     rpc container-output {
469         input {
470             uses rpcx:rpc-context-ref {
471                 refine context-instance {
472                     rpcx:rpc-context-instance complex-output-rpc;
473                 }
474             }
475         }
476
477         output {
478             container retValContainer {
479                 leaf v1 {
480                     type string;
481                     default "from rpc";
482                 }
483
484                 leaf v2 {
485                     type uint32;
486                 }
487             }
488         }
489     }
490
491     rpc leaf-list-output {
492         input {
493             uses rpcx:rpc-context-ref {
494                 refine context-instance {
495                     rpcx:rpc-context-instance complex-output-rpc;
496                 }
497             }
498         }
499
500         output {
501             leaf-list result {
502                 type string;
503             }
504         }
505     }
506
507     rpc list-output {
508         input {
509             uses rpcx:rpc-context-ref {
510                 refine context-instance {
511                     rpcx:rpc-context-instance complex-output-rpc;
512                 }
513             }
514         }
515
516         output {
517             list ret-val-list {
518                 leaf v2 {
519                     type uint32;
520                 }
521
522                 leaf v1 {
523                     type boolean;
524                 }
525             }
526         }
527     }
528
529     rpc noArgInner {
530         input {
531             uses rpcx:rpc-context-ref {
532                 refine context-instance {
533                     rpcx:rpc-context-instance inner-test-rpc;
534                 }
535             }
536         }
537     }
538
539     rpc noArgInnerInner {
540         input {
541             uses rpcx:rpc-context-ref {
542                 refine context-instance {
543                     rpcx:rpc-context-instance inner-inner-test-rpc;
544                 }
545             }
546
547             leaf arg1 {
548                 type uint16;
549             }
550
551             leaf arg2 {
552                 type boolean;
553             }
554         }
555          output {
556             leaf result {
557                 type boolean;
558             }
559         }
560     }
561 }