35c1c17f2f1673df1bda0950d4f094b09990fb29
[mdsal.git] / binding2 / mdsal-binding2-test-model / src / main / yang / opendaylight-mdsal-binding-test.yang
1 module opendaylight-mdsal-binding-test {
2
3     namespace "urn:opendaylight:params:xml:ns:yang:mdsal: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     typedef int32-string-union {
17         type union {
18             type int32;
19             type string;
20         }
21     }
22
23     identity test-root;
24
25     identity test-one {
26         base test-root;
27     }
28
29     identity test-two {
30         base test-root;
31     }
32
33     typedef test-identityref {
34         type identityref {
35             base test-root;
36         }
37     }
38
39     grouping two-level-list {
40         list top-level-list {
41             description
42                 "Top Level List";
43             key "name";
44             leaf name {
45                 type string;
46             }
47
48             choice choice-in-list {
49                 case simple-case {
50                     leaf simple {
51                         type string;
52                     }
53                 }
54             }
55
56             list nested-list {
57                 key "name";
58                 leaf name {
59                     type string;
60                 }
61                 leaf type {
62                     type string;
63                     mandatory true;
64                     description
65                         "Mandatory type of list.";
66                 }
67                 ordered-by user;
68                 description
69                     "A list of service functions that compose the service chain";
70             }
71         }
72         leaf-list top-level-leaf-list {
73             type string;
74         }
75
76         leaf-list top-level-ordered-leaf-list {
77             type string;
78             ordered-by user;
79         }
80
81         list choice-list {
82             key "name";
83             leaf name {
84                 type string;
85             }
86
87             choice choice-in-choice-list {
88
89             }
90         }
91     }
92
93     grouping choice {
94         choice identifier {
95             case simple {
96                 container simple-id {
97                     leaf id {
98                         type int32;
99                     }
100                 }
101             }
102             case extended {
103                 container extended-id {
104                     leaf id {
105                         type string;
106                     }
107                 }
108             }
109         }
110     }
111
112     container top {
113         uses two-level-list;
114     }
115
116     container choice-container {
117         uses choice;
118     }
119
120     rpc put-top {
121         input {
122             uses two-level-list;
123         }
124     }
125
126     notification two-level-list-changed {
127         uses two-level-list;
128     }
129
130     rpc get-top {
131         output {
132             uses two-level-list;
133         }
134     }
135
136     augment "/list-test:top" {
137         leaf augmented-string {
138             type string;
139         }
140     }
141
142     augment "/list-test:top" {
143         leaf augmented-int {
144             type int32;
145         }
146     }
147 }