Added validation of range and length constraints.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / model / testfile3.yang
1 module types3 {
2     yang-version 1;
3     namespace "urn:simple.container.demo.test";
4     prefix "t3";
5
6     import types2 {
7         prefix "data";
8         revision-date 2013-02-27;
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 data:nested-union2;
26         }
27     }
28
29     augment "/data:interfaces/data:ifEntry" {
30         when "if:ifType='ds0'";
31         container augment-holder {
32             description "Description for augment holder";
33         }
34     }
35     
36     augment "/data:interfaces/data:ifEntry" {
37         when "if:ifType='ds2'";
38         container augment-holder2 {
39             description "Description for augment holder";
40         }
41     }
42     
43     augment "/data:interfaces/data:ifEntry/t3:augment-holder/t1:schemas" {
44         when "if:leafType='ds1'";
45         leaf linkleaf {
46             type binary;
47         }
48     }
49
50     container network {
51         mnt:mountpoint point {
52             mnt:target-ref target;
53         }
54         
55         description "network-description";
56         reference "network-reference";
57         status obsolete;
58         config true;
59         presence "some presence text";
60     }
61
62     feature local-storage {
63         description
64             "This feature means the device supports local
65              storage (memory, flash or disk) that can be used to
66              store syslog messages.";
67     }
68     
69     extension c-define {
70         description
71             "Takes as argument a name string.
72              Makes the code generator use the given name in the
73              #define.";
74         argument "name";
75     }
76     
77     notification event {
78         leaf event-class {
79             type string;
80         }
81         anyxml reporting-entity;
82         leaf severity {
83             type string;
84         }
85     }
86     
87     rpc get-config {
88         description
89           "Retrieve all or part of a specified configuration.";
90
91         reference "RFC 6241, Section 7.1";
92
93         input {
94             container source {
95                 description
96                   "Particular configuration to retrieve.";
97
98                 choice config-source {
99                     mandatory true;
100                     description
101                       "The configuration to retrieve.";
102                     case a {
103                         leaf candidate {
104                             if-feature candidate;
105                             type empty;
106                             description
107                               "The candidate configuration is the config source.";
108                         }
109                     }
110                     case b {
111                         leaf running {
112                             type empty;
113                             description
114                               "The running configuration is the config source.";
115                         }
116                     }
117                     case c {
118                         leaf startup {
119                             if-feature startup;
120                             type empty;
121                             description
122                               "The startup configuration is the config source.
123                                This is optional-to-implement on the server because
124                                not all servers will support filtering for this
125                                datastore.";
126                         }
127                     }
128                 }
129             }
130
131             anyxml filter {
132                 description
133                   "Subtree or XPath filter to use.";
134                    nc:get-filter-element-attributes;
135             }
136         }
137
138         output {
139             anyxml data {
140                 description
141                   "Copy of the source datastore subset that matched
142                    the filter criteria (if any).  An empty data container
143                    indicates that the request did not produce any results.";
144             }
145         }
146     }
147
148 }