Fixed resolving of schema path and qname for nodes added by augmentation.
[yangtools.git] / yang / yang-parser-impl / src / test / resources / model / custom.yang
1 module custom {
2     yang-version 1;
3     namespace "urn:custom.nodes.test";
4     prefix "c";
5
6     import types {
7         prefix "types";
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 types:nested-union2;
26         }
27     }
28
29     augment "/types:interfaces/types:ifEntry" {
30         when "if:ifType='ds0'";
31         container augment-holder {
32             description "Description for augment holder";
33         }
34     }
35
36     augment "/types:interfaces/types:ifEntry" {
37         when "if:ifType='ds2'";
38         container augment-holder2 {
39             description "Description for augment holder";
40         }
41     }
42
43     container network {
44         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
63         "Takes as argument a name string. Makes the code generator use the given name in the #define.";
64         argument "name" {
65             yin-element "true";
66         }
67     }
68
69     notification event {
70         leaf event-class {
71             type string;
72         }
73         anyxml reporting-entity;
74         leaf severity {
75             type string;
76         }
77     }
78
79     rpc get-config {
80         description
81           "Retrieve all or part of a specified configuration.";
82
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
125                   "Subtree or XPath filter to use.";
126                    c:c-define element-attributes;
127             }
128         }
129
130         output {
131             anyxml data {
132                 description
133                   "Copy of the source datastore subset that matched
134                    the filter criteria (if any).  An empty data container
135                    indicates that the request did not produce any results.";
136             }
137         }
138     }
139
140     grouping target {
141         anyxml data {
142             config true;
143             description "Copy of the source datastore subset.";
144             mandatory false;
145             must "test-condition-text";
146             reference "test-no-reference";
147             status "obsolete";
148             when "test-when-text";
149         }
150         choice how {
151             description "test choice description";
152             default interval;
153             case interval {
154                 leaf interval {
155                     type uint16;
156                     default 30;
157                     units minutes;
158                 }
159             }
160             case daily {
161                 leaf daily {
162                     type empty;
163                 }
164                 leaf time-of-day {
165                     type string;
166                     units 24-hour-clock;
167                     default 1am;
168                 }
169             }
170         }
171         leaf address {
172             type string;
173             description "Target IP address";
174             mandatory true;
175         }
176         container port {
177             description "Target port container";
178         }
179         list addresses {
180             key "id";
181             leaf id {
182                 type int8;
183             }
184         }
185         grouping target-inner {
186             description "target-inner default description";
187             leaf inner-grouping-id {
188                 type int8;
189             }
190         }
191         typedef group-type {
192             type types:my-decimal-type;
193         }
194
195         opendaylight;
196     }
197
198 }