Fixed bug in resolving of conditional Revision Aware XPath.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / samples / maven-code-gen-sample / src / main / yang / demo-topology.yang
similarity index 66%
rename from opendaylight/sal/yang-prototype/code-generator/code-generator-demo/src/main/resources/test-topology.yang
rename to opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/demo-topology.yang
index 797ab2ced24d6d799f4c81a90da677ee27ab7a68..4fef1cddd255fd2311237595ea4211b3f9be42a5 100644 (file)
@@ -1,13 +1,9 @@
-// vi: set smarttab sw=4 tabstop=4:
-module abstract-topology {
+module demo-topology {
        yang-version 1;
-    namespace "pre:simple.test.demo";
+    namespace "urn:model.1demo-275topology.4.5.my";
     prefix "tp";
 
-       import ietf-inet-types { prefix "inet"; }
-    import abstract-prefixes { prefix "abs-pref"; }
-    
-       organization "OPEN DAYLIGHT";
+    organization "OPEN DAYLIGHT";
     contact "http://www.opendaylight.org/";
 
     description "
@@ -16,30 +12,9 @@ module abstract-topology {
                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.";
+    revision "2013-02-08"{
+               reference " WILL BE DEFINED LATER";
        }
 
        container topology {
@@ -51,7 +26,7 @@ module abstract-topology {
                ";
 
         leaf topology-id {
-            type inet:uri;
+            type string;
             description "
                                It is presumed that datastore will contain many topologies. To
                                distinguish between topologies it is vital to have UNIQUE
@@ -66,14 +41,40 @@ module abstract-topology {
                        key "node-id";
 
                        leaf node-id {
-                               type inet:uri;
+                               type string;
                                description "The Topology identifier of network-node.";
                        }
-
-                   container attributes {
+                
+                list network-interface {
+                    key "interface-id";
+                    
+                    leaf interface-id {
+                        type uint8;
+                    }
+                    
+                    leaf interface-address {
+                        type string;
+                    }
+                }
+                
+                   container node-attributes {
                                        description "
                                                Additional attributes that can Network Node contains.
                                        ";
+
+                                       leaf geo-latitude {
+                                               type decimal64 {
+                                                       fraction-digits 2;
+                                               }
+                                               config true;
+                                       }
+
+                                       leaf geo-longitude {
+                                               type decimal64 {
+                                                       fraction-digits 2;
+                                               }
+                                               config true;
+                                       }
                                }
                }
         }
@@ -93,30 +94,28 @@ module abstract-topology {
                        key "link-id";
 
                        leaf link-id {
-                               type inet:uri;
+                               type string;
                                description "";
                        }
 
                    container source {
                                        leaf node-id {
-                                               type node-id-ref;
+                                               type string;
                                                description "Source node identifier.";
                                        }
                                }
 
                                container destination {
                                        leaf node-id {
-                                               type node-id-ref;
+                                               type string;
                                                description "Destination node identifier.";
                                        }
                                }
 
-                               container attributes {
+                               container link-attributes {
                                        description "Aditional attributes that can Network Link contains.";
                                }
                    }
         }
     }
-
-    //TODO: add base operations
-}
+}
\ No newline at end of file