Populate xpath/ hierarchy
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / resources / model-new / baz.yang
1 module baz {
2     yang-version 1;
3     namespace "urn:opendaylight.baz";
4     prefix "baz";
5
6     import bar { prefix "br"; revision-date 2013-07-03; }
7
8     organization "opendaylight";
9     contact "http://www.opendaylight.org/";
10
11     revision "2013-02-27" {
12         reference " WILL BE DEFINED LATER";
13     }
14
15     typedef union1 {
16         type union2;
17     }
18
19     typedef union2 {
20         type union {
21             type int32;
22             type br:nested-union2;
23         }
24     }
25
26     augment "/br:interfaces/br:ifEntry" {
27         when "br:ifType='ds0'";
28         container augment-holder {
29             description "Description for augment holder";
30         }
31     }
32
33     augment "/br:interfaces/br:ifEntry" {
34         when "br:ifType='ds2'";
35         container augment-holder2 {
36             description "Description for augment holder";
37         }
38     }
39
40     container network {
41         baz:c-define point {
42         }
43
44         description "network-description";
45         reference "network-reference";
46         status obsolete;
47         config true;
48         presence "some presence text";
49     }
50
51     feature local-storage {
52         description
53                 "This feature means the device supports local storage (memory,
54                 flash or disk) that can be used to store syslog messages.";
55     }
56
57     feature candidate;
58     feature startup;
59
60     extension c-define {
61         description "Takes as argument a name string. Makes the code generator use
62                 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. This is optional-to-implement
112                                                         on the server because not all servers will support filtering for
113                                                         this datastore.";
114                         }
115                     }
116                 }
117             }
118
119             anyxml filter {
120                 description "Subtree or XPath filter to use.";
121                 baz:c-define element-attributes;
122             }
123         }
124
125         output {
126             anyxml data {
127                 description
128                                 "Copy of the source datastore subset that matched the filter criteria
129                                 (if any). An empty data container indicates that the request did
130                                 not produce any results.";
131             }
132         }
133     }
134
135     grouping target {
136         anyxml data {
137             config true;
138             description "Copy of the source datastore subset.";
139             mandatory false;
140             must "test-condition-text";
141             reference "test-no-reference";
142             status "obsolete";
143             when "test-when-text";
144         }
145         choice how {
146             description "test choice description";
147             default interval;
148             case interval {
149                 leaf interval {
150                     type uint16;
151                     default 30;
152                     units minutes;
153                 }
154             }
155             case daily {
156                 leaf daily {
157                     type empty;
158                 }
159                 leaf time-of-day {
160                     type string;
161                     units 24-hour-clock;
162                     default 1am;
163                 }
164             }
165         }
166         leaf address {
167             type string;
168             description "Target IP address";
169             mandatory true;
170         }
171         container port {
172             description "Target port container";
173         }
174         list addresses {
175             key "id";
176             leaf id {
177                 type int8;
178             }
179         }
180         grouping target-inner {
181             description "target-inner default description";
182             leaf inner-grouping-id {
183                 type int8;
184             }
185         }
186         typedef group-type {
187             type br:my-decimal-type;
188         }
189
190         br:opendaylight awesome;
191     }
192 }