Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / yang-prototype / code-generator / code-generator-demo / src / main / resources / test-topology.yang
diff --git a/opendaylight/sal/yang-prototype/code-generator/code-generator-demo/src/main/resources/test-topology.yang b/opendaylight/sal/yang-prototype/code-generator/code-generator-demo/src/main/resources/test-topology.yang
new file mode 100644 (file)
index 0000000..76582c7
--- /dev/null
@@ -0,0 +1,123 @@
+// vi: set smarttab sw=4 tabstop=4:
+module abstract-topology {
+       yang-version 1;
+    namespace "pre:simple.test.demo";
+    prefix "tp";
+
+       import ietf-inet-types { prefix "inet"; }
+    import abstract-prefixes { prefix "abs-pref"; }
+    
+       organization "Cisco";
+
+    contact "WILL-BE-DEFINED-LATER";
+
+    description "
+               This module contains the definitions of elements that creates network 
+               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.
+       ";
+    
+    revision "2012-02-08" {
+        reference " WILL BE DEFINED LATER";
+    }
+
+    typedef topology-id-ref {
+       type leafref {
+               path "/tp:topology/tp:topology-id";
+       }
+       description "This type is used for leafs that reference topology identifier instance.";
+    }
+
+       typedef network-node-id-ref {
+               type leafref {
+                       path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id";
+               }
+               description "This type is used for leafs that reference network node instance.";
+       }
+
+       typedef link-id-ref {
+               type leafref {
+                       path "/tp:topology/tp:network-links/tp:network-link/tp:link-id";
+               }
+               description "This type is used for leafs that reference network link instance.";
+       }
+
+       container topology {
+        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.
+               ";
+
+        leaf topology-id {
+            type inet:uri;
+            description "
+                               It is presumed that datastore will contain many topologies. To
+                               distinguish between topologies it is vital to have UNIQUE
+                               topology identifier.
+                       ";
+        }
+
+        container network-nodes {
+               list network-node {
+                   description "The list of network nodes defined for topology.";
+
+                       key "node-id";
+
+                       leaf node-id {
+                               type inet:uri;
+                               description "The Topology identifier of network-node.";
+                       }
+
+                   container attributes {
+                                       description "
+                                               Additional attributes that can Network Node contains.
+                                       ";
+                               }
+               }
+        }
+        
+        container network-links {
+               list network-link {
+                   description "
+                                       The Network Link which is defined by Local (Source) and
+                                       Remote (Destination) Network Nodes. Every link MUST be
+                                       defined either by identifier and 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.
+                               ";
+                       key "link-id";
+
+                       leaf link-id {
+                               type inet:uri;
+                               description "";
+                       }
+
+                   container source {
+                                       leaf node-id {
+                                               type node-id-ref;
+                                               description "Source node identifier.";
+                                       }
+                               }
+
+                               container destination {
+                                       leaf node-id {
+                                               type node-id-ref;
+                                               description "Destination node identifier.";
+                                       }
+                               }
+
+                               container attributes {
+                                       description "Aditional attributes that can Network Link contains.";
+                               }
+                   }
+        }
+    }
+
+    //TODO: add base operations
+}