a2c485d84f41e041d8d496d1a560b7e44cba4806
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / test-model.yang
1 module test-model {
2         yang-version 1;
3         namespace "urn:cisco:params:xml:ns:yang:controller:network";
4         prefix "topos";
5
6         import ietf-inet-types { prefix "inet"; }
7         import iana-if-type {prefix "if-type";}
8         import mount {prefix "mnt";} 
9
10         organization "Cisco";
11
12         contact "WILL-BE-DEFINED-LATER";
13
14         description "module description";
15         reference "module reference";
16         
17         typedef topology-id {
18                 type inet:uri;
19         }
20
21         typedef node-id {
22                 type inet:uri;
23         }
24
25         typedef link-id {
26                 type inet:uri;
27         }
28
29         typedef tp-id {
30                 type inet:uri;
31                 description "identifier for termination points on a port";
32         }
33
34         typedef tp-ref {
35                 type leafref {
36                         path "/network/topologies/topology/nodes/node/termination-points/termination-point/tp-id";
37                 }
38         }
39         typedef topology-ref {
40                 type leafref {
41                         path "/network/topologies/topology/topology-id";
42                 }
43                 description "This type is used for leafs that reference topology identifier instance.";
44                 // currently not used
45         }
46
47         typedef node-ref {
48                 type leafref {
49                         path "/network/topologies/topology/nodes/node/node-id";
50                 }
51                 description "This type is used for leafs that reference a node instance.";
52         }
53
54         typedef link-ref {
55                 type leafref {
56                         path "/network/topologies/topology/links/link/link-id";
57                 }
58                 description "This type is used for leafs that reference a link instance.";
59                 // currently not used
60         }
61         
62         typedef network-element-ref {
63                 type leafref {
64                         path "/network/network-elements/network-element/element-id";
65                 }
66         }
67
68
69         typedef element-id {
70                 type string;
71         }
72         
73         
74         container network {
75                 description "network-description";
76                 reference "network-reference";
77                 status obsolete;
78                 config true;
79                 presence "some presence text";
80                 
81                 mnt:mountpoint point  {
82                 mnt:target-ref target;
83                 }
84                 
85                 leaf-list locked-node {
86                 type instance-identifier;
87                 min-elements 1;
88                 when "a/b/c";
89                 description "List of locked nodes in the running datastore";
90         }
91         
92         leaf locked-test {
93                 mandatory true;
94         }
95         
96                 container topologies {
97                         list topology {
98                                 description "Test description of list 'topology'.";
99                                 key "topology-id";
100                                 leaf topology-id {
101                                         type topology-id; 
102                                         description "Test description of leaf 'topology-id'";
103                                 }
104
105                                 container nodes {
106                                         list node {
107                                                 description "The list of network nodes defined for topology.";
108
109                                                 key "node-id";
110                                                 leaf node-id {
111                                                         type node-id;
112                                                         description "The Topology identifier of network-node.";
113                                                 }
114
115                                                 leaf supporting-ne {
116                                                         type network-element-ref;
117                                                 }
118                                                 
119                                                 container termination-points {
120                                                         list termination-point {
121                                                                 key "tp-id";
122                                                                 leaf tp-id {
123                                                                         type tp-id;
124                                                                 }
125                                                         }
126                                                 }
127                                         }
128                                 }
129                 
130                                 container links {
131                                         list link {
132                                                 description "Test description of list 'link'.";
133                                                 key "link-id";
134                                                 leaf link-id {
135                                                         type link-id;
136                                                         description "";
137                                                 }
138
139                                                 container source { 
140                                                         leaf source-node {
141                                                                 type node-ref;
142                                                                 description "Source node identifier.";
143                                                         }
144                                                         leaf source-tp {
145                                                                 type tp-ref;
146                                                         }
147                                                 }
148                                         
149                                                 container destination { 
150                                                         leaf dest-node {
151                                                                 type node-ref;
152                                                                 description "Destination node identifier.";
153                                                         }
154                                                         leaf dest-tp {
155                                                                 type tp-ref;
156                                                         }
157                                                 }
158                                         }
159                                 }
160                         }
161                 }
162         }
163         
164 }