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