Populate parser/ hierarchy
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / resources / rfc7950 / model / bar.yang
1 module bar {
2     yang-version 1.1;
3     namespace "urn:opendaylight.bar";
4     prefix "bar";
5
6     organization "opendaylight";
7     contact "http://www.opendaylight.org/";
8     description "This model define custom type definitions";
9
10     revision "2013-07-03" {
11         reference " WILL BE DEFINED LATER";
12     }
13
14     typedef int32-ext1 {
15         type int32 {
16             range "2..20";
17         }
18     }
19
20     typedef int32-ext2 {
21         type int32-ext1 {
22             range "3..9|11..max";
23         }
24         units "mile";
25         default "11";
26     }
27
28     typedef string-ext1 {
29         type string {
30             pattern "[a-k]*";
31             length "5..11";
32         }
33     }
34
35     typedef string-ext2 {
36         type string-ext1 {
37             length "6..10";
38         }
39     }
40
41     typedef string-ext3 {
42         type string-ext2 {
43             pattern "[b-u]*";
44         }
45     }
46
47     typedef string-ext4 {
48         type string-ext3 {
49             pattern "[e-z]*";
50         }
51     }
52
53     typedef multiple-pattern-string {
54         type string {
55             pattern "[A-Z]*-%22!^^";
56             pattern "[e-z]*";
57         }
58     }
59
60     typedef my-decimal-type {
61         type decimal64 {
62             fraction-digits 6;
63         }
64     }
65
66     typedef my-union {
67         type union {
68             type int16 {
69                 range "1..100";
70             }
71             type int32;
72         }
73     }
74
75     typedef my-union-ext {
76         type my-union;
77     }
78
79     typedef nested-union2 {
80         type union {
81             type my-union-ext;
82             type string;
83         }
84     }
85
86     container interfaces {
87         grouping ifEntry {
88             container augment-holder;
89         }
90         list ifEntry {
91             key "ifIndex";
92
93             leaf ifIndex {
94                 type uint32;
95                 units minutes;
96             }
97
98             leaf ifMtu {
99                 type int32;
100             }
101
102             min-elements 1;
103             max-elements 11;
104         }
105     }
106
107     extension opendaylight {
108         argument "name" {
109             yin-element "true";
110         }
111     }
112
113 }