46aac7878946762d9464a0d92c08f23a13a505bd
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / abstract-topology.yang
1 module abstract-topology {
2     yang-version 1;
3     namespace "";
4     prefix "tp";
5
6     import ietf-inet-types { 
7         prefix "inet"; 
8         revision-date 2010-09-24;
9     }
10
11     organization "Cisco";
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 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     typedef node-id-ref {
23         type leafref {
24             path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
25         }
26         description "This type is used for leafs that reference network node instance.";
27     }
28
29     typedef link-id-ref {
30         type leafref {
31             path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
32         }
33         description "This type is used for leafs that reference network link instance.";
34     }
35
36     container topology {
37         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.";
38
39         leaf topology-id {
40             type inet:uri;
41             description "It is presumed that datastore will contain many topologies. To distinguish between topologies it is vital to have
42             UNIQUE topology identifier.";
43         }
44
45         container network-nodes {
46             list network-node {
47                 key "node-id";
48
49                 leaf node-id {
50                     type inet:uri;
51                     description "The Topology identifier of network-node.";
52                 }
53
54                 container attributes {
55                     description "Aditional attributes that can Network Node contains.";
56                 }
57                 description "The list of network nodes defined for topology.";
58             }
59         }
60         
61         container network-links {
62             list network-link {
63                 key "link-id";
64
65                 leaf link-id {
66                     type inet:uri;
67                     description "";
68                 }
69
70                 container source-node {
71                     leaf id {
72                         type node-id-ref;
73                         description "Source node identifier.";
74                     }
75                 }
76
77                 container destination-node {
78                     leaf id {
79                         type node-id-ref;
80                         description "Destination node identifier.";
81                     }
82                 }
83
84                 container attributes {
85                     description "Aditional attributes that can Network Link contains.";
86                 }
87                 description "The Network Link which is defined by Local (Source) and Remote (Destination) Network Nodes. Every link MUST be defined either by identifier and
88                 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.";
89             }
90         }
91     }
92 }