Merge "OF plugin classes must have a strict dependency on Connection Service"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-generator-impl / src / test / resources / union-test-models / abstract-topology.yang
1 module abstract-topology {
2     yang-version 1;
3     namespace "urn:model:abstract:topology";
4     prefix "tp";
5
6     import ietf-inet-types { 
7         prefix "inet"; 
8         revision-date 2010-09-24;
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 union-enum {
27         type union {
28             type int32;
29             type enumeration {
30                 enum "unbounded";
31             }
32         }
33     }
34
35     typedef link-address {
36         type union {
37             type inet:ip-address;
38             type string;
39         }
40     }
41
42     typedef node-id-ref {
43         type leafref {
44             path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
45         }
46         description "This type is used for leafs that reference network node instance.";
47     }
48
49     typedef link-id-ref {
50         type leafref {
51             path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
52         }
53         description "This type is used for leafs that reference network link instance.";
54     }
55
56     container topology {
57         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.";
58
59         leaf topology-id {
60             type inet:uri;
61             description "It is presumed that datastore will contain many topologies. To distinguish between topologies it is vital to have
62             UNIQUE topology identifier.";
63         }
64
65         container network-nodes {
66             list network-node {
67                 key "node-id";
68
69                 leaf node-id {
70                     type inet:uri;
71                     description "The Topology identifier of network-node.";
72                 }
73
74                 leaf bounding {
75                     type union-enum;
76                 }
77
78                 container attributes {
79                     description "Aditional attributes that can Network Node contains.";
80                 }
81                 description "The list of network nodes defined for topology.";
82             }
83         }
84         
85         container network-links {
86             list network-link {
87                 key "link-id";
88
89                 leaf link-id {
90                     type inet:uri;
91                     description "";
92                 }
93
94                 leaf link-address {
95                     type link-address;
96                 }
97
98                 container source-node {
99                     leaf id {
100                         type node-id-ref;
101                         description "Source node identifier.";
102                     }
103                 }
104
105                 container destination-node {
106                     leaf id {
107                         type node-id-ref;
108                         description "Destination node identifier.";
109                     }
110                 }
111
112                 container attributes {
113                     description "Aditional attributes that can Network Link contains.";
114                 }
115                 description "The Network Link which is defined by Local (Source) and Remote (Destination) Network Nodes. Every link MUST be defined either by identifier and
116                 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.";
117             }
118         }
119     }
120 }