Fixed some major sonar issues in yang-validation-tool
[yangtools.git] / code-generator / binding-generator-impl / src / test / resources / enum-test-models / abstract-topology@2013-02-08.yang
1 module abstract-topology {
2     yang-version 1;
3     namespace "urn:model:abstract:topology";
4     prefix "tp";
5
6     import ietf-interfaces {
7         prefix "if";
8         revision-date 2012-11-15;
9     }
10
11     organization "OPEN DAYLIGHT";
12     contact "http://www.opendaylight.org/";
13
14     description
15         "This module contains the definitions of elements that creates network 
16     topology i.e. definition of network nodes and links. This module is not designed to be used solely for network representation. This module SHOULD be used as base module in defining the network topology.";
17
18     revision "2013-02-08" {
19         reference "~~~ WILL BE DEFINED LATER";
20     }
21     
22     revision "2013-01-01" {
23         reference "~~~ WILL BE DEFINED LATER";
24     }
25     
26     typedef node-id-ref {
27         type leafref {
28             path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
29         }
30         description "This type is used for leafs that reference network node instance.";
31     }
32
33     typedef link-id-ref {
34         type leafref {
35             path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
36         }
37         description "This type is used for leafs that reference network link instance.";
38     }
39
40     typedef interface-id-ref {
41         type leafref {
42             path "/tp:topology/tp:interfaces/tp:interface/tp:interface-id";
43         }
44     }
45
46     container topology {
47         description "This is the model of abstract topology which contains only Network Nodes and Network Links. Each topology MUST be identified by unique topology-id for reason that the store could contain many topologies.";
48
49         leaf topology-id {
50             type string;
51             description "It is presumed that datastore will contain many topologies. To distinguish between topologies it is vital to have
52             UNIQUE topology identifier.";
53         }
54
55         container network-nodes {
56             list network-node {
57                 key "node-id";
58
59                 leaf node-id {
60                     type string;
61                     description "The Topology identifier of network-node.";
62                 }
63
64                 container attributes {
65                     description "Aditional attributes that can Network Node contains.";
66                 }
67                 description "The list of network nodes defined for topology.";
68             }
69         }
70
71         container interfaces {
72             list interface {
73                 key "interface-id";
74
75                 leaf interface-id {
76                     type leafref {
77                         path "/if:interfaces/if:interface/if:name";
78                     }
79                 }
80
81                 leaf-list higher-layer-if {
82                     type leafref {
83                         path "/if:interfaces/if:interface/if:higher-layer-if";
84                     }
85                 }
86
87                 leaf oper-status {
88                     type leafref {
89                         path "/if:interfaces/if:interface/if:oper-status";
90                     }
91                 }
92
93                 leaf link-up-down-trap-enable {
94                     type leafref {
95                         path "/if:interfaces/if:interface/if:link-up-down-trap-enable";
96                     }
97                 }
98             }
99         }
100         
101         container network-links {
102             list network-link {
103                 key "link-id";
104
105                 leaf link-id {
106                     type string;
107                     description "";
108                 }
109
110                 container source-node {
111                     leaf id {
112                         type node-id-ref;
113                         description "Source node identifier.";
114                     }
115                 }
116
117                 container destination-node {
118                     leaf id {
119                         type node-id-ref;
120                         description "Destination node identifier.";
121                     }
122                 }
123
124                 container tunnels {
125                     list tunnel {
126                         key "tunnel-id";
127
128                         leaf tunnel-id {
129                             type leafref {
130                                 path "../../../link-id";
131                             }
132                         }
133                     }
134                 }
135
136                 leaf interface {
137                     type interface-id-ref;
138                 }
139
140                 container attributes {
141                     description "Aditional attributes that can Network Link contains.";
142                 }
143                 description "The Network Link which is defined by Local (Source) and Remote (Destination) Network Nodes. Every link MUST be defined either by identifier and
144                 his local and remote Network Nodes (In real applications it is common that many links are originated from one node and end up in same remote node). To ensure that we would always know to distinguish between links, every link SHOULD have identifier.";
145             }
146         }
147     }
148 }