b7085fc9d12906c7f34902fabaf01f3ae3285e5e
[yangtools.git] / yang / yang-parser-impl / src / test / resources / model-new / bar.yang
1 module bar {
2     yang-version 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 invalid-string-pattern {
54         type string ;
55     }
56
57     typedef multiple-pattern-string {
58         type string {
59             pattern "[e-z]*";
60         }
61     }
62
63     typedef my-decimal-type {
64         type decimal64 {
65             fraction-digits 6;
66         }
67     }
68
69     typedef my-union {
70         type union {
71             type int16 {
72                 range "1..100";
73             }
74             type int32;
75         }
76     }
77
78     typedef my-union-ext {
79         type my-union;
80     }
81
82     typedef nested-union2 {
83         type union {
84             type my-union-ext;
85             type string;
86         }
87     }
88
89     container interfaces {
90         grouping ifEntry {
91             container augment-holder;
92         }
93         list ifEntry {
94             key "ifIndex";
95
96             leaf ifIndex {
97                 type uint32;
98                 units minutes;
99             }
100
101             leaf ifMtu {
102                 type int32;
103             }
104
105             min-elements 1;
106             max-elements 11;
107         }
108     }
109
110     extension opendaylight {
111         argument "name" {
112             yin-element "true";
113         }
114     }
115 }