Populate parser/ hierarchy
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / resources / semantic-statement-parser / model / baz.yang
1 module baz {
2     yang-version 1;
3     namespace "urn:opendaylight.baz";
4     prefix "baz";
5
6     import bar {
7         prefix "br";
8         revision-date 2013-07-03;
9     }
10
11     organization "opendaylight";
12     contact "http://www.opendaylight.org/";
13
14     revision "2013-02-27" {
15         reference " WILL BE DEFINED LATER";
16     }
17
18     typedef union1 {
19         type union2;
20     }
21
22     typedef union2 {
23         type union {
24             type int32;
25             type br:nested-union2;
26         }
27     }
28
29     augment "/br:interfaces/br:ifEntry" {
30         when "br:ifType='ds0'";
31         container augment-holder {
32             description "Description for augment holder";
33         }
34     }
35
36     augment "/br:interfaces/br:ifEntry" {
37         when "br:ifType='ds2'";
38         container augment-holder2 {
39             description "Description for augment holder";
40         }
41     }
42
43     container network {
44         baz:c-define point {
45         }
46
47         description "network-description";
48         reference "network-reference";
49         status obsolete;
50         config true;
51         presence "some presence text";
52     }
53
54     feature local-storage {
55         description
56             "This feature means the device supports local
57              storage (memory, flash or disk) that can be used to
58              store syslog messages.";
59     }
60
61     feature candidate;
62     feature startup;
63
64     extension c-define {
65         description "Takes as argument a name string. Makes the code generator use the given name in the #define.";
66         argument "name" {
67             yin-element "true";
68         }
69     }
70
71     notification event {
72         leaf event-class {
73             type string;
74         }
75         anyxml reporting-entity;
76         leaf severity {
77             type string;
78         }
79     }
80
81     rpc get-config {
82         description "Retrieve all or part of a specified configuration.";
83         reference "RFC 6241, Section 7.1";
84
85         input {
86             container source {
87                 description
88                   "Particular configuration to retrieve.";
89
90                 choice config-source {
91                     mandatory true;
92                     description
93                       "The configuration to retrieve.";
94                     case a {
95                         leaf candidate {
96                             if-feature candidate;
97                             type empty;
98                             description
99                               "The candidate configuration is the config source.";
100                         }
101                     }
102                     case b {
103                         leaf running {
104                             type empty;
105                             description
106                               "The running configuration is the config source.";
107                         }
108                     }
109                     case c {
110                         leaf startup {
111                             if-feature startup;
112                             type empty;
113                             description
114                               "The startup configuration is the config source.
115                                This is optional-to-implement on the server because
116                                not all servers will support filtering for this
117                                datastore.";
118                         }
119                     }
120                 }
121             }
122
123             anyxml filter {
124                 description "Subtree or XPath filter to use.";
125                 baz:c-define element-attributes;
126             }
127         }
128
129         output {
130             anyxml data {
131                 description
132                   "Copy of the source datastore subset that matched
133                    the filter criteria (if any).  An empty data container
134                    indicates that the request did not produce any results.";
135             }
136         }
137     }
138
139     grouping target {
140         anyxml data {
141             config true;
142             description "Copy of the source datastore subset.";
143             mandatory false;
144             must "test-condition-text";
145             reference "test-no-reference";
146             status "obsolete";
147             when "test-when-text";
148         }
149         choice how {
150             description "test choice description";
151             default interval;
152             case interval {
153                 leaf interval {
154                     type uint16;
155                     default 30;
156                     units minutes;
157                 }
158             }
159             case daily {
160                 leaf daily {
161                     type empty;
162                 }
163                 leaf time-of-day {
164                     type string;
165                     units 24-hour-clock;
166                     default 1am;
167                 }
168             }
169         }
170         leaf address {
171             type string;
172             description "Target IP address";
173             mandatory true;
174         }
175         container port {
176             description "Target port container";
177         }
178         list addresses {
179             key "id";
180             leaf id {
181                 type int8;
182             }
183         }
184         grouping target-inner {
185             description "target-inner default description";
186             leaf inner-grouping-id {
187                 type int8;
188             }
189         }
190         typedef group-type {
191             type br:my-decimal-type;
192         }
193         
194         br:opendaylight awesome;
195     }
196
197 }