Correct docs declaration
[mdsal.git] / binding2 / mdsal-binding2-spec / src / test / resources / odl-test-toplevel.yang
1 module odl-test-toplevel {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:mdsal:binding2:test:toplevel";
4     prefix "ott";
5
6     description
7         "Testing for various data structures at top level of module.
8         see http://tools.ietf.org/html/rfc6020#section-7.1.1";
9
10     revision "2016-03-31" {
11         description
12             "Initial revision, for ODL Boron.";
13     }
14
15     // TODO: Create model with other non-data structures, such as rpc and notification.
16     // TODO: Test definitions at top level of submodule.
17
18     grouping config-leaf {
19         leaf config-leaf {
20             type string;
21             config true;
22         }
23     }
24
25     grouping state-leaf {
26         leaf state-leaf {
27             type string;
28             config false;
29         }
30     }
31
32     uses state-leaf;  // Top level non-config string leaf named "state-leaf".
33
34     container non-presence-container {
35         uses config-leaf;
36     }
37
38     container presence-container {
39         presence "Container is present.";
40         uses config-leaf;
41     }
42
43     leaf-list ordered-leaflist {
44         ordered-by user;
45         type string;
46     }
47
48     leaf-list unordered-leaflist {
49         ordered-by system;
50         type string;
51     }
52
53     list ordered-keyed-list {
54         ordered-by user;
55         key config-leaf;
56         uses config-leaf;
57     }
58
59     list unordered-keyed-list {
60         ordered-by system;
61         key config-leaf;
62         uses config-leaf;
63     }
64
65     list ordered-unkeyed-list {
66         config false;  // 'The "key" statement, which MUST be present if the list represents configuration'
67         ordered-by user;
68         description
69             "http://tools.ietf.org/html/rfc6020#section-7.7.5
70             says \"This statement is ignored if the list represents state data\",
71             but we are still hoping for some kind of ordering (perhaps from MD-SAL application?)
72             to be preserved.";
73         uses state-leaf;
74     }
75
76     list unordered-unkeyed-list {
77         config false;  // 'The "key" statement, which MUST be present if the list represents configuration'
78         ordered-by system;
79         description
80             "http://tools.ietf.org/html/rfc6020#section-7.7.5
81             says \"This statement is ignored if the list represents state data\",
82             but we are still hoping the system responds with a reasonable ordering.
83
84             http://tools.ietf.org/html/rfc6020#section-7.7.5.1
85             \"An implementation SHOULD use the same order for
86             the same data, regardless of how the data were created.\"";
87         uses state-leaf;
88     }
89
90     choice choice {
91         case case {
92             uses config-leaf;
93         }
94     }
95
96     anyxml anyxml {
97     }
98
99 }