YANGTOOLS-706: Split out yang-parser-rfc7950
[yangtools.git] / yang / 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 "if:ifType='ds0'";
31         container augment-holder {
32             description "Description for augment holder";
33         }
34     }
35
36     augment "/br:interfaces/br:ifEntry" {
37         when "if: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     extension c-define {
62         description "Takes as argument a name string. Makes the code generator use the given name in the #define.";
63         argument "name" {
64             yin-element "true";
65         }
66     }
67
68     notification event {
69         leaf event-class {
70             type string;
71         }
72         anyxml reporting-entity;
73         leaf severity {
74             type string;
75         }
76     }
77
78     rpc get-config {
79         description "Retrieve all or part of a specified configuration.";
80         reference "RFC 6241, Section 7.1";
81
82         input {
83             container source {
84                 description
85                   "Particular configuration to retrieve.";
86
87                 choice config-source {
88                     mandatory true;
89                     description
90                       "The configuration to retrieve.";
91                     case a {
92                         leaf candidate {
93                             if-feature candidate;
94                             type empty;
95                             description
96                               "The candidate configuration is the config source.";
97                         }
98                     }
99                     case b {
100                         leaf running {
101                             type empty;
102                             description
103                               "The running configuration is the config source.";
104                         }
105                     }
106                     case c {
107                         leaf startup {
108                             if-feature startup;
109                             type empty;
110                             description
111                               "The startup configuration is the config source.
112                                This is optional-to-implement on the server because
113                                not all servers will support filtering for this
114                                datastore.";
115                         }
116                     }
117                 }
118             }
119
120             anyxml filter {
121                 description "Subtree or XPath filter to use.";
122                 baz:c-define element-attributes;
123             }
124         }
125
126         output {
127             anyxml data {
128                 description
129                   "Copy of the source datastore subset that matched
130                    the filter criteria (if any).  An empty data container
131                    indicates that the request did not produce any results.";
132             }
133         }
134     }
135
136     grouping target {
137         anyxml data {
138             config true;
139             description "Copy of the source datastore subset.";
140             mandatory false;
141             must "test-condition-text";
142             reference "test-no-reference";
143             status "obsolete";
144             when "test-when-text";
145         }
146         choice how {
147             description "test choice description";
148             default interval;
149             case interval {
150                 leaf interval {
151                     type uint16;
152                     default 30;
153                     units minutes;
154                 }
155             }
156             case daily {
157                 leaf daily {
158                     type empty;
159                 }
160                 leaf time-of-day {
161                     type string;
162                     units 24-hour-clock;
163                     default 1am;
164                 }
165             }
166         }
167         leaf address {
168             type string;
169             description "Target IP address";
170             mandatory true;
171         }
172         container port {
173             description "Target port container";
174         }
175         list addresses {
176             key "id";
177             leaf id {
178                 type int8;
179             }
180         }
181         grouping target-inner {
182             description "target-inner default description";
183             leaf inner-grouping-id {
184                 type int8;
185             }
186         }
187         typedef group-type {
188             type br:my-decimal-type;
189         }
190         
191         br:opendaylight awesome;
192     }
193
194 }