Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-java-api-generator / src / test / resources / abstract-topology.yang
1 // vi: set smarttab sw=4 tabstop=4:
2 module abstract-topology {
3         yang-version 1;
4     namespace "";
5     prefix "tp";
6
7         import ietf-inet-types { prefix "inet"; }
8     import abstract-prefixes { prefix "abs-pref"; }
9     
10         organization "Cisco";
11
12     contact "WILL-BE-DEFINED-LATER";
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
17                 not designed to be used solely for network representation. This module
18                 SHOULD be used as base module in defining the network topology.
19         ";
20
21     revision "2013-02-08" {
22                 reference " WILL BE DEFINED LATER";
23         }
24
25     revision "2013-03-08" {
26         reference " WILL BE DEFINED LATER";
27     }
28     
29     revision "2012-02-08" {
30         reference " WILL BE DEFINED LATER";
31     }
32
33     typedef topology-id-ref {
34         type leafref {
35                 path "/tp:topology/tp:topology-id";
36         }
37         description "This type is used for leafs that reference topology identifier instance.";
38     }
39
40         typedef network-node-id-ref {
41                 type leafref {
42                         path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
43                 }
44                 description "This type is used for leafs that reference network node instance.";
45         }
46
47         typedef link-id-ref {
48                 type leafref {
49                         path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
50                 }
51                 description "This type is used for leafs that reference network link instance.";
52         }
53
54         container topology {
55         description "
56                         This is the model of abstract topology which contains only Network
57                         Nodes and Network Links. Each topology MUST be identified by
58                         unique topology-id for reason that the store could contain many
59                         topologies.
60                 ";
61
62         leaf topology-id {
63             type inet:uri;
64             description "
65                                 It is presumed that datastore will contain many topologies. To
66                                 distinguish between topologies it is vital to have UNIQUE
67                                 topology identifier.
68                         ";
69         }
70
71         container network-nodes {
72                 list network-node {
73                     description "The list of network nodes defined for topology.";
74
75                         key "node-id";
76
77                         leaf node-id {
78                                 type inet:uri;
79                                 description "The Topology identifier of network-node.";
80                         }
81
82                     container attributes {
83                                         description "
84                                                 Additional attributes that can Network Node contains.
85                                         ";
86                                 }
87                 }
88         }
89         
90         container network-links {
91                 list network-link {
92                     description "
93                                         The Network Link which is defined by Local (Source) and
94                                         Remote (Destination) Network Nodes. Every link MUST be
95                                         defined either by identifier and his local and remote
96                                         Network Nodes (in real applications it is common that many
97                                         links are originated from one node and end up in same
98                                         remote node). To ensure that we would always know to
99                                         distinguish between links, every link SHOULD have
100                                         identifier.
101                                 ";
102                         key "link-id";
103
104                         leaf link-id {
105                                 type inet:uri;
106                                 description "";
107                         }
108
109                     container source {
110                                         leaf node-id {
111                                                 type node-id-ref;
112                                                 description "Source node identifier.";
113                                         }
114                                 }
115
116                                 container destination {
117                                         leaf node-id {
118                                                 type node-id-ref;
119                                                 description "Destination node identifier.";
120                                         }
121                                 }
122
123                                 container attributes {
124                                         description "Aditional attributes that can Network Link contains.";
125                                 }
126                     }
127         }
128     }
129
130     //TODO: add base operations
131 }