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