Merge "Fixed add/delete/modify RPC for group/flow/remove reach the test provider"
[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             leaf sleep-factor {
123                 type decimal64 {
124                     fraction-digits 2;
125                 }
126             }
127
128            container dto-c {
129                 leaf simple-arg {
130                     type uint32;
131                 }
132
133                 container dto-a-inner {
134                     leaf simple-arg {
135                         type uint32;
136                     }
137
138                     container dto-a-inner-inner {
139                         leaf simple-arg {
140                             type uint32;
141                         }
142                     }
143                 }
144             }
145
146             leaf simpleInt {
147                 type uint32;
148             }
149
150             leaf simpleBoolean {
151                 type boolean;
152                 default false;
153             }
154
155             leaf simple-long {
156                 type int64  ;
157             }
158
159             leaf simple-long-2 {
160                 type uint32;
161             }
162
163             leaf simple-BigInteger {
164                 type uint64;
165             }
166
167             leaf simple-byte {
168                 type int8;
169             }
170
171             leaf simple-short {
172                 type uint8;
173             }
174
175             leaf simple-test {
176                 type uint16;
177                 default 99;
178             }
179
180             leaf-list simple-list {
181                 type uint16;
182             }
183
184             container dto_d {
185                 leaf simple-int1 {
186                     type uint32;
187                 }
188
189                 leaf simple-int2 {
190                     type uint32;
191                 }
192
193                 leaf simple-int3 {
194                     type uint16;
195                 }
196
197                 leaf-list simple-list {
198                     type uint16;
199                 }
200
201                 list complex-dto-bInner {
202                     leaf-list simple-list {
203                         type uint16;
204                     }
205                     leaf simple-int3 {
206                         type uint16;
207                     }
208
209                     container deep {
210                         leaf simple-int3 {
211                             type uint16;
212                         }
213                     }
214                 }
215             }
216
217             list complex-list {
218                 list simple-list {
219                     leaf simple-int3 {
220                         type uint16;
221                     }
222                 }
223             }
224
225             list peers {
226                     leaf port {
227                         type string;
228                     }
229                     leaf core-size {
230                         type uint32;
231                     }
232                     leaf simple-int3 {
233                         type uint16;
234                     }
235             }
236
237             container testing-dep {
238                 uses config:service-ref {
239                     refine type {
240                         mandatory true;
241                         config:required-identity test:testing;
242                     }
243                 }
244             }
245
246             list testing-deps {
247                 uses config:service-ref {
248                     refine type {
249                         mandatory true;
250                         config:required-identity test:testing;
251                     }
252                 }
253             }
254         }
255     }
256
257     augment "/config:modules/config:module/config:state" {
258         case impl-netconf {
259             when "/config:modules/config:module/config:type = 'impl-netconf'";
260             // rpc
261             rpcx:rpc-context-instance "test-rpc";
262
263             // root runtime bean
264             leaf created-sessions {
265                 type uint32;
266             }
267
268             container asdf {
269                 leaf simpleInt {
270                     type uint16;
271                 }
272
273                 leaf simpleString {
274                     type string;
275                 }
276             }
277
278
279             list inner-running-data-additional {
280                 config:inner-state-bean;
281
282                 // rpc
283                 rpcx:rpc-context-instance "inner-test-rpc";
284
285                 key "simpleString";
286
287                 leaf simple-int3 {
288                         type uint16;
289                 }
290
291                 leaf simpleString {
292                     type string;
293                 }
294
295                 container deep4 {
296                     leaf boool {
297                         type boolean;
298                     }
299                 }
300             }
301
302              list inner-running-data {
303                 config:inner-state-bean;
304
305                 key "simple-int3";
306
307                 leaf simple-int3 {
308                         type uint16;
309                     }
310
311                     container deep2 {
312                     leaf boool {
313                         type boolean;
314                     }
315                  }
316
317                 list inner-inner-running-data {
318                     config:inner-state-bean;
319
320                     rpcx:rpc-context-instance "inner-inner-test-rpc";
321                     rpcx:rpc-context-instance "complex-output-rpc";
322
323                     key "simple-int3";
324
325                     leaf simple-int3 {
326                         type uint16;
327                     }
328
329                     leaf-list list-of-strings {
330                         type string;
331                     }
332
333                     list not-state-bean {
334                         leaf element {
335                             type string;
336                         }
337
338                         list not-state-bean-internal {
339                             // This should be ignored
340                             config:inner-state-bean;
341
342                             leaf element2 {
343                                 type string;
344                             }
345                         }
346                     }
347
348                     container deep3 {
349                         leaf boool {
350                             type boolean;
351                         }
352                     }
353                 }
354             }
355         }
356     }
357
358     identity test-rpc;
359     identity inner-test-rpc;
360     identity inner-inner-test-rpc;
361
362     identity complex-output-rpc;
363
364     rpc no-arg {
365         input {
366             uses rpcx:rpc-context-ref {
367                 refine context-instance {
368                     rpcx:rpc-context-instance test-rpc;
369                 }
370             }
371             leaf arg1 {
372                 type string;
373             }
374         }
375
376         output {
377             leaf result {
378                 type string;
379             }
380         }
381     }
382
383     rpc container-output {
384         input {
385             uses rpcx:rpc-context-ref {
386                 refine context-instance {
387                     rpcx:rpc-context-instance complex-output-rpc;
388                 }
389             }
390         }
391
392         output {
393             container retValContainer {
394                 leaf v1 {
395                     type string;
396                 }
397
398                 leaf v2 {
399                     type uint32;
400                 }
401             }
402         }
403     }
404
405     rpc leaf-list-output {
406         input {
407             uses rpcx:rpc-context-ref {
408                 refine context-instance {
409                     rpcx:rpc-context-instance complex-output-rpc;
410                 }
411             }
412         }
413
414         output {
415             leaf-list result {
416                 type string;
417             }
418         }
419     }
420
421     rpc list-output {
422         input {
423             uses rpcx:rpc-context-ref {
424                 refine context-instance {
425                     rpcx:rpc-context-instance complex-output-rpc;
426                 }
427             }
428         }
429
430         output {
431             list ret-val-list {
432                 leaf v2 {
433                     type uint32;
434                 }
435
436                 leaf v1 {
437                     type boolean;
438                 }
439             }
440         }
441     }
442
443     rpc noArgInner {
444         input {
445             uses rpcx:rpc-context-ref {
446                 refine context-instance {
447                     rpcx:rpc-context-instance inner-test-rpc;
448                 }
449             }
450         }
451     }
452
453     rpc noArgInnerInner {
454         input {
455             uses rpcx:rpc-context-ref {
456                 refine context-instance {
457                     rpcx:rpc-context-instance inner-inner-test-rpc;
458                 }
459             }
460
461             leaf arg1 {
462                 type uint16;
463             }
464
465             leaf arg2 {
466                 type boolean;
467             }
468         }
469          output {
470             leaf result {
471                 type boolean;
472             }
473         }
474     }
475 }