Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-generator-impl / src / test / resources / demo-topology.yang
1 module demo-topology {
2         yang-version 1;
3     namespace "";
4     prefix "tp";
5
6     organization "Cisco";
7
8     contact "WILL-BE-DEFINED-LATER";
9
10     description "
11                 This module contains the definitions of elements that creates network 
12                 topology i.e. definition of network nodes and links. This module is
13                 not designed to be used solely for network representation. This module
14                 SHOULD be used as base module in defining the network topology.
15         ";
16
17     revision "2013-02-08"{
18                 reference " WILL BE DEFINED LATER";
19         }
20
21         container topology {
22         description "
23                         This is the model of abstract topology which contains only Network
24                         Nodes and Network Links. Each topology MUST be identified by
25                         unique topology-id for reason that the store could contain many
26                         topologies.
27                 ";
28
29         leaf topology-id {
30             type string;
31             description "
32                                 It is presumed that datastore will contain many topologies. To
33                                 distinguish between topologies it is vital to have UNIQUE
34                                 topology identifier.
35                         ";
36         }
37
38         container network-nodes {
39                 list network-node {
40                     description "The list of network nodes defined for topology.";
41
42                         key "node-id";
43
44                         leaf node-id {
45                                 type string;
46                                 description "The Topology identifier of network-node.";
47                         }
48                 
49                 list network-interface {
50                     key "interface-id";
51                     
52                     leaf interface-id {
53                         type uint8;
54                     }
55                     
56                     leaf interface-address {
57                         type string;
58                     }
59                 }
60                 
61                     container node-attributes {
62                                         description "
63                                                 Additional attributes that can Network Node contains.
64                                         ";
65
66                                         leaf geo-latitude {
67                                                 type decimal64 {
68                                                         fraction-digits 2;
69                                                 }
70                                                 config true;
71                                         }
72
73                                         leaf geo-longitude {
74                                                 type decimal64 {
75                                                         fraction-digits 2;
76                                                 }
77                                                 config true;
78                                         }
79                                 }
80                 }
81         }
82         
83         container network-links {
84                 list network-link {
85                     description "
86                                         The Network Link which is defined by Local (Source) and
87                                         Remote (Destination) Network Nodes. Every link MUST be
88                                         defined either by identifier and his local and remote
89                                         Network Nodes (in real applications it is common that many
90                                         links are originated from one node and end up in same
91                                         remote node). To ensure that we would always know to
92                                         distinguish between links, every link SHOULD have
93                                         identifier.
94                                 ";
95                         key "link-id";
96
97                         leaf link-id {
98                                 type string;
99                                 description "";
100                         }
101
102                     container source {
103                                         leaf node-id {
104                                                 type string;
105                                                 description "Source node identifier.";
106                                         }
107                                 }
108
109                                 container destination {
110                                         leaf node-id {
111                                                 type string;
112                                                 description "Destination node identifier.";
113                                         }
114                                 }
115
116                                 container link-attributes {
117                                         description "Aditional attributes that can Network Link contains.";
118                                 }
119                     }
120         }
121     }
122 }