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