Merge "Fixed validation bug of YANG import statement"
[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     container network {
37             description "network-description";
38             reference "network-reference";
39             status obsolete;
40             config true;
41             presence "some presence text";
42
43                 mnt:mountpoint point  {
44                 mnt:target-ref target;
45         }
46     }
47
48     feature local-storage {
49         description
50             "This feature means the device supports local
51              storage (memory, flash or disk) that can be used to
52              store syslog messages.";
53     }
54     
55     extension c-define {
56         description
57             "Takes as argument a name string.
58              Makes the code generator use the given name in the
59              #define.";
60         argument "name";
61     }
62     
63     notification event {
64         leaf event-class {
65             type string;
66         }
67         anyxml reporting-entity;
68         leaf severity {
69             type string;
70         }
71     }
72     
73     rpc get-config {
74         description
75           "Retrieve all or part of a specified configuration.";
76
77         reference "RFC 6241, Section 7.1";
78
79         input {
80             container source {
81                 description
82                   "Particular configuration to retrieve.";
83
84                 choice config-source {
85                     mandatory true;
86                     description
87                       "The configuration to retrieve.";
88                     case a {
89                         leaf candidate {
90                             if-feature candidate;
91                             type empty;
92                             description
93                               "The candidate configuration is the config source.";
94                         }
95                     }
96                     case b {
97                         leaf running {
98                             type empty;
99                             description
100                               "The running configuration is the config source.";
101                         }
102                     }
103                     case c {
104                         leaf startup {
105                             if-feature startup;
106                             type empty;
107                             description
108                               "The startup configuration is the config source.
109                                This is optional-to-implement on the server because
110                                not all servers will support filtering for this
111                                datastore.";
112                         }
113                     }
114                 }
115             }
116
117             anyxml filter {
118                 description
119                   "Subtree or XPath filter to use.";
120                    nc:get-filter-element-attributes;
121             }
122         }
123
124         output {
125             anyxml data {
126                 description
127                   "Copy of the source datastore subset that matched
128                    the filter criteria (if any).  An empty data container
129                    indicates that the request did not produce any results.";
130             }
131         }
132     }
133
134 }