5ba1cbcf9a3b2097ec8401954e50030dbaae72f3
[mdsal.git] / binding / mdsal-binding-test-model / src / main / yang / opendaylight-yangtools-binding-test.yang
1 module opendaylight-yangtools-binding-test {
2
3     namespace "urn:opendaylight:params:xml:ns:yang:yangtools:test:binding";
4     prefix list-test;
5
6
7     description
8         "This module contains a collection of YANG definitions used for
9         some test cases.";
10
11     revision 2014-07-01 {
12         description
13         "Test model for testing data broker with nested lists.";
14     }
15
16     typedef int32-string-union {
17         type union {
18             type int32;
19             type string;
20         }
21     }
22
23     identity test-root;
24
25     identity test-one {
26         base test-root;
27     }
28
29     identity test-two {
30         base test-root;
31     }
32
33     typedef test-identityref {
34         type identityref {
35             base test-root;
36         }
37     }
38
39     grouping two-level-list {
40         list top-level-list {
41             description
42                 "Top Level List";
43             key "name";
44             leaf name {
45                 type string;
46             }
47
48             choice choice-in-list {
49                 case simple-case {
50                     leaf simple {
51                         type string;
52                     }
53                 }
54             }
55
56             list nested-list {
57                 key "name";
58                 leaf name {
59                     type string;
60                 }
61                 leaf type {
62                     type string;
63                     mandatory true;
64                     description
65                         "Mandatory type of list.";
66                 }
67                 ordered-by user;
68                 description
69                     "A list of service functions that compose the service chain";
70             }
71         }
72         leaf-list top-level-leaf-list {
73             type string;
74         }
75     }
76
77     grouping choice {
78         choice identifier {
79             case simple {
80                 container simple-id {
81                     leaf id {
82                         type int32;
83                     }
84                 }
85             }
86             case extended {
87                 container extended-id {
88                     leaf id {
89                         type string;
90                     }
91                 }
92             }
93         }
94     }
95
96     container top {
97         uses two-level-list;
98     }
99
100     container choice-container {
101         uses choice;
102     }
103
104     rpc put-top {
105         input {
106             uses two-level-list;
107         }
108     }
109
110     notification two-level-list-changed {
111         uses two-level-list;
112     }
113
114     rpc get-top {
115         output {
116             uses two-level-list;
117         }
118     }
119 }