Merge "HostTracker StaticHost changes"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / model / testfile1.yang
index 9e779c2ce58e675bc67544b3d4e8e3642a446949..f6bc34d1b609eea9c9616d7f3e2585a0b757a098 100644 (file)
-module types1 {\r
-    yang-version 1;\r
-    namespace "urn:simple.container.demo";\r
-    prefix "t1";\r
-    \r
-    import types2 {\r
-         prefix "data";\r
-         revision-date 2013-02-27;\r
-     }\r
-    \r
-    organization "Cisco";\r
-    contact "WILL-BE-DEFINED-LATER";\r
-    \r
-    revision "2013-02-27" {\r
-        reference " WILL BE DEFINED LATER";\r
-    }\r
-    \r
-    container interfaces {\r
-         list ifEntry {\r
-             key "ifIndex";\r
-\r
-             leaf ifIndex {\r
-                 type uint32;\r
-                 units minutes;\r
-             }\r
-             \r
-             leaf ifMtu {\r
-                 type int32;\r
-             }\r
-         }\r
-    }\r
-     \r
-    leaf testleaf {\r
-        type data:my-type1 {\r
-            range "min..max";\r
-        }\r
-    }\r
-    \r
-    leaf test-string-leaf {\r
-        type data:my-string-type-ext;\r
-    }\r
-    \r
-    leaf leaf-with-length {\r
-       type data:my-string-type {\r
-               length "7..max";\r
-       }\r
-    }\r
-    \r
-    leaf test-int-leaf {\r
-        type data:my-int-type-ext;\r
-    }\r
-    \r
-    leaf test-decimal-leaf {\r
-        type data:my-decimal-type {\r
-            fraction-digits 4;\r
-        }\r
-    }\r
-    \r
-    leaf test-decimal-leaf2 {\r
-        type data:my-decimal-type-ext;\r
-    }\r
-    \r
-    container ext {\r
-        data:c-define "MY_INTERFACES";\r
-    }\r
-\r
-}\r
+module types1 {
+    yang-version 1;
+    namespace "urn:simple.container.demo";
+    prefix "t1";
+
+    import types2 {
+        prefix "data";
+        revision-date 2013-02-27;
+    }
+
+   import types3 {
+        prefix "t3";
+        revision-date 2013-02-27;
+    }
+
+    organization "opendaylight";
+    contact "http://www.opendaylight.org/";
+
+    revision "2013-02-27" {
+        reference " WILL BE DEFINED LATER";
+    }
+
+    leaf testleaf {
+        type data:my-type1 {
+            range "12..max";
+        }
+    }
+
+    leaf test-string-leaf {
+        type data:my-string-type-ext;
+    }
+
+    leaf leaf-with-length {
+        type data:my-string-type {
+            length "7..max";
+        }
+    }
+
+    leaf test-int-leaf {
+        type data:my-int-type-ext;
+    }
+
+    leaf test-decimal-leaf {
+        type data:my-decimal-type {
+            fraction-digits 4;
+        }
+    }
+
+    leaf test-decimal-leaf2 {
+        type data:my-decimal-type-ext;
+    }
+
+    container ext {
+        data:c-define "MY_INTERFACES";
+    }
+
+    leaf union-leaf {
+        type data:my-union-ext;
+    }
+
+    deviation /data:system/data:user {
+        deviate add {
+            default "admin"; // new users are 'admin' by default
+            config "true";
+        }
+    }
+
+    leaf nested-union-leaf {
+        type data:nested-union1;
+    }
+
+    leaf custom-union-leaf {
+        type t3:union1;
+    }
+
+    container transfer {
+        choice how {
+            default interval;
+            case interval {
+                leaf interval {
+                    type uint16;
+                    default 30;
+                    units minutes;
+                }
+            }
+            case daily {
+                leaf daily {
+                    type empty;
+                }
+                leaf time-of-day {
+                    type string;
+                    units 24-hour-clock;
+                    default 1am;
+                }
+            }
+            case manual {
+                leaf manual {
+                    type empty;
+                }
+            }
+        }
+    }
+
+    anyxml data {
+        description
+          "Copy of the source datastore subset that matched
+           the filter criteria (if any).  An empty data container
+           indicates that the request did not produce any results.";
+    }
+
+    augment "/data:interfaces/data:ifEntry/t3:augment-holder" {
+        when "if:ifType='ds0'";
+        leaf ds0ChannelNumber {
+            type string;
+        }
+        leaf interface-id {
+            type leafref {
+                path "/if:interfaces/if:interface/if:name";
+            }
+        }
+        leaf-list higher-layer-if {
+            type leafref {
+                path "/if:interfaces/if:interface/if:higher-layer-if";
+            }
+        }
+        leaf my-type {
+            type data:my-type1;
+        }
+        container schemas {
+        }
+    }
+    
+    container mycont {
+        container innercont {
+            typedef mytype {
+                type string;
+            }
+        
+            leaf myleaf {
+                type mytype;
+            }
+        }
+    }
+    
+}