Merge "Added tests for yang.model.util"
[yangtools.git] / code-generator / binding-test-model / src / main / yang / opendaylight-yangtools-binding-test.yang
1 module opendaylight-yangtools-binding-test {
2
3     namespace "urn:opendaylight:params:xml:ns:yang:yangtools:test:binding";
4     prefix list-test;
5
6
7     description
8         "This module contains a collection of YANG definitions used for
9         some test cases.";
10
11     revision 2014-07-01 {
12         description
13         "Test model for testing data broker with nested lists.";
14     }
15
16     grouping two-level-list {
17         list top-level-list {
18             description
19                 "Top Level List";
20             key "name";
21             leaf name {
22                 type string;
23             }
24
25             choice choice-in-list {
26                 case simple-case {
27                     leaf simple {
28                         type string;
29                     }
30                 }
31             }
32
33             list nested-list {
34                 key "name";
35                 leaf name {
36                     type string;
37                 }
38                 leaf type {
39                     type string;
40                     mandatory true;
41                     description
42                         "Mandatory type of list.";
43                 }
44                 ordered-by user;
45                 description
46                     "A list of service functions that compose the service chain";
47             }
48         }
49         leaf-list top-level-leaf-list {
50             type string;
51         }
52     }
53
54     grouping choice {
55         choice identifier {
56             case simple {
57                 container simple-id {
58                     leaf id {
59                         type int32;
60                     }
61                 }
62             }
63             case extended {
64                 container extended-id {
65                     leaf id {
66                         type string;
67                     }
68                 }
69             }
70         }
71     }
72
73     container top {
74         uses two-level-list;
75     }
76
77     container choice-container {
78         uses choice;
79     }
80
81     rpc put-top {
82         input {
83             uses two-level-list;
84         }
85     }
86 }