6f6de3b2a10de7a61b2cd2dab05b22455a737f59
[yangtools.git] / yang / yang-parser-impl / src / test / resources / grouping-test / uses-grouping.yang
1 module uses-grouping {
2         yang-version 1;
3         namespace "urn:opendaylight:params:xml:ns:yang:uses-grouping";
4         prefix "ug";
5
6         import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
7
8         organization "opendaylight";
9         contact "asdf";
10
11         revision "2013-07-30" {
12         }
13
14         typedef protocol-version {
15                 type uint8 {
16                         range 1..7;
17                 }
18         }
19
20         grouping bandwidth-object {
21                 uses object-header;
22
23                 container bandwidth {
24                         uses ieee754-32;
25                 }
26         }
27
28         grouping base-header {
29                 leaf delete {
30                         type uint32;
31                         mandatory true;
32                 }
33                 leaf setup {
34                         type uint32;
35                         mandatory true;
36                 }
37         }
38
39         grouping endpoints-object {
40                 uses object;
41
42                 choice address-family {
43                         case ipv4 {
44                                 leaf source-ipv4-address {
45                                         type inet:ipv4-address;
46                                         mandatory true;
47                                 }
48                         }
49                         case ipv6 {
50                                 leaf source-ipv6-address {
51                                         type inet:ipv6-address;
52                                         mandatory true;
53                                 }
54                         }
55                 }
56         }
57
58         grouping ieee754-32 {
59                 reference "IEEE 754-2008";
60                 leaf fraction {
61                         type uint32 {
62                                 range 0..1677215;
63                         }
64                         mandatory true;
65                 }
66         }
67
68         grouping lsp-attributes {
69                 container bandwidth {
70                         uses bandwidth-object;
71                 }
72         }
73
74         grouping message-header {
75                 leaf version {
76                         type protocol-version;
77                         default 1;
78                 }
79         }
80
81         grouping metric-object {
82                 uses object;
83                 leaf metric-type {
84                         type uint8;
85                         mandatory true;
86                 }
87         }
88         
89         grouping object {
90                 uses object-header;
91
92                 container box {
93                 }
94         }
95
96         grouping object-header {
97                 leaf processing-rule {
98                         type boolean;
99                 }
100                 leaf ignore {
101                         type boolean;
102                 }
103         }
104         
105         grouping path-key-object {
106                 uses object-header;
107
108                 list path-keys {
109                 }
110         }
111         
112         grouping route-object {
113                 uses object-header;
114
115                 list subobjects {
116                 }
117         }
118
119         grouping rp-object {
120                 uses object {
121                         augment "box" {
122                                 container order {
123                                         uses base-header;
124                                 }
125                         }
126                 }
127
128                 leaf priority {
129                         type uint8 {
130                                 range 1..7;
131                         }
132                 }
133         }
134         
135         grouping svec-object {
136                 uses object-header;
137
138                 leaf link-diverse {
139                         type boolean;
140                         default false;
141                 }
142         }
143
144
145         notification pcreq {
146                 uses message-header;
147
148                 list requests {
149                         container rp {
150                                 uses rp-object;
151                         }
152                         container path-key-expansion {
153                                 when "rp/path-key = true";
154                                 container path-key {
155                                         uses path-key-object {
156                                             augment path-keys {
157                                                 uses message-header;
158                                             }
159                                         }
160                                 }
161                         }
162                         container segment-computation {
163                                 when "rp/path-key = false";
164
165                                 container p2p {
166                                         when "../rp/p2mp = false";
167
168                                         container endpoints {
169                                                 uses endpoints-object;
170                                         }
171                                         container reported-route {
172                                                 uses route-object;
173
174                                                 container bandwidth {
175                                                         uses bandwidth-object;
176                                                 }
177                                         }
178
179                                         uses lsp-attributes;
180                                 }
181                         }
182                 }
183
184                 list svec {
185                         uses svec-object;
186                         list metric {
187                                 uses metric-object;
188                         }
189                 }
190         }
191
192 }