ConfigurationService to create default config dir
[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     identity test-identity1 {
45
46     }
47
48     identity test-identity2 {
49         base test-identity1;
50     }
51
52     augment "/config:modules/config:module/config:configuration" {
53             case impl-identity-test {
54                 when "/config:modules/config:module/config:type = 'impl-identity-test'";
55
56                 leaf afi {
57                     type identityref {
58                         base test-identity1;
59                     }
60                 }
61
62                 container identities-container {
63                     leaf afi {
64                         type identityref {
65                             base test-identity1;
66                         }
67                     }
68                 }
69
70                 list identities {
71                     leaf afi {
72                         type identityref {
73                             base test-identity1;
74                         }
75                     }
76                     leaf safi {
77                         type identityref {
78                             base test-identity1;
79                         }
80                     }
81
82                     container identities-inner {
83                         leaf afi {
84                             type identityref {
85                                 base test-identity1;
86                             }
87                         }
88                     }
89                 }
90
91             }
92         }
93
94         augment "/config:modules/config:module/config:state" {
95             case impl-identity-test {
96                 when "/config:modules/config:module/config:type = 'impl-identity-test'";
97
98             }
99         }
100
101
102     augment "/config:modules/config:module/config:configuration" {
103         case impl {
104             when "/config:modules/config:module/config:type = 'impl'";
105
106            leaf-list allow-user  {
107                 type string;
108                 description "A list of user name patterns to allow";
109            }
110
111            container dto-a {
112                 leaf simple-arg {
113                     type uint32;
114                     default 1;
115                 }
116
117                 leaf port {
118                     type inet:port-number;
119                     default 8080;
120                 }
121
122                 leaf ip4 {
123                     type inet:ipv4-address;
124                     default 127.0.0.1;
125                 }
126
127             }
128
129             leaf as-number {
130                 type inet:as-number;
131                 default 44;
132             }
133
134
135             leaf simpleInt {
136                 type uint32;
137                 default 99;
138             }
139
140             container dto_b {
141                 leaf simple-int1 {
142                     type uint32;
143                     default 32;
144                 }
145
146                 leaf simple-int2 {
147                     type uint32;
148                 }
149             }
150
151         }
152     }
153
154     augment "/config:modules/config:module/config:state" {
155         case impl {
156             when "/config:modules/config:module/config:type = 'impl'";
157             // root runtime bean
158             leaf created-sessions {
159                 type uint32;
160             }
161         }
162     }
163
164     augment "/config:modules/config:module/config:configuration" {
165         case impl-dep {
166             when "/config:modules/config:module/config:type = 'impl-dep'";
167         }
168     }
169
170     augment "/config:modules/config:module/config:configuration" {
171         case impl-netconf {
172             when "/config:modules/config:module/config:type = '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     augment "/config:modules/config:module/config:state" {
351         case impl-netconf {
352             when "/config:modules/config:module/config:type = 'impl-netconf'";
353             // rpc
354             rpcx:rpc-context-instance "test-rpc";
355
356             // root runtime bean
357             leaf created-sessions {
358                 type uint32;
359             }
360
361             container asdf {
362                 leaf simpleInt {
363                     type uint16;
364                 }
365
366                 leaf simpleString {
367                     type string;
368                 }
369             }
370
371
372             list inner-running-data-additional {
373                 config:inner-state-bean;
374
375                 // rpc
376                 rpcx:rpc-context-instance "inner-test-rpc";
377
378                 key "simpleString";
379
380                 leaf simple-int3 {
381                         type uint16;
382                 }
383
384                 leaf simpleString {
385                     type string;
386                 }
387
388                 container deep4 {
389                     leaf boool {
390                         type boolean;
391                     }
392                 }
393             }
394
395              list inner-running-data {
396                 config:inner-state-bean;
397
398                 key "simple-int3";
399
400                 leaf simple-int3 {
401                         type uint16;
402                     }
403
404                     container deep2 {
405                     leaf boool {
406                         type boolean;
407                     }
408                  }
409
410                 list inner-inner-running-data {
411                     config:inner-state-bean;
412
413                     rpcx:rpc-context-instance "inner-inner-test-rpc";
414                     rpcx:rpc-context-instance "complex-output-rpc";
415
416                     key "simple-int3";
417
418                     leaf simple-int3 {
419                         type uint16;
420                     }
421
422                     leaf-list list-of-strings {
423                         type string;
424                     }
425
426                     list not-state-bean {
427                         leaf element {
428                             type string;
429                         }
430
431                         list not-state-bean-internal {
432                             // This should be ignored
433                             config:inner-state-bean;
434
435                             leaf element2 {
436                                 type string;
437                             }
438                         }
439                     }
440
441                     container deep3 {
442                         leaf boool {
443                             type boolean;
444                         }
445                     }
446                 }
447             }
448         }
449     }
450
451     identity test-rpc;
452     identity inner-test-rpc;
453     identity inner-inner-test-rpc;
454
455     identity complex-output-rpc;
456
457     rpc no-arg {
458         input {
459             uses rpcx:rpc-context-ref {
460                 refine context-instance {
461                     rpcx:rpc-context-instance test-rpc;
462                 }
463             }
464             leaf arg1 {
465                 type string;
466             }
467         }
468
469         output {
470             leaf result {
471                 type string;
472             }
473         }
474     }
475
476     rpc container-output {
477         input {
478             uses rpcx:rpc-context-ref {
479                 refine context-instance {
480                     rpcx:rpc-context-instance complex-output-rpc;
481                 }
482             }
483         }
484
485         output {
486             container retValContainer {
487                 leaf v1 {
488                     type string;
489                     default "from rpc";
490                 }
491
492                 leaf v2 {
493                     type uint32;
494                 }
495             }
496         }
497     }
498
499     rpc leaf-list-output {
500         input {
501             uses rpcx:rpc-context-ref {
502                 refine context-instance {
503                     rpcx:rpc-context-instance complex-output-rpc;
504                 }
505             }
506         }
507
508         output {
509             leaf-list result {
510                 type string;
511             }
512         }
513     }
514
515     rpc list-output {
516         input {
517             uses rpcx:rpc-context-ref {
518                 refine context-instance {
519                     rpcx:rpc-context-instance complex-output-rpc;
520                 }
521             }
522         }
523
524         output {
525             list ret-val-list {
526                 leaf v2 {
527                     type uint32;
528                 }
529
530                 leaf v1 {
531                     type boolean;
532                 }
533             }
534         }
535     }
536
537     rpc noArgInner {
538         input {
539             uses rpcx:rpc-context-ref {
540                 refine context-instance {
541                     rpcx:rpc-context-instance inner-test-rpc;
542                 }
543             }
544         }
545     }
546
547     rpc noArgInnerInner {
548         input {
549             uses rpcx:rpc-context-ref {
550                 refine context-instance {
551                     rpcx:rpc-context-instance inner-inner-test-rpc;
552                 }
553             }
554
555             leaf arg1 {
556                 type uint16;
557             }
558
559             leaf arg2 {
560                 type boolean;
561             }
562         }
563          output {
564             leaf result {
565                 type boolean;
566             }
567         }
568     }
569 }