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