added endpoint-locations yang 71/37871/6
authorMatej Perina <matej.perina@pantheon.sk>
Thu, 21 Apr 2016 13:22:22 +0000 (15:22 +0200)
committerMartin Sunal <msunal@cisco.com>
Mon, 25 Apr 2016 07:39:11 +0000 (07:39 +0000)
Change-Id: Icd59ca4a7297bddc17df5592e015bad323693eb4
Signed-off-by: Matej Perina <matej.perina@pantheon.sk>
groupbasedpolicy/src/main/yang/model/endpoint-locations.yang [new file with mode: 0644]

diff --git a/groupbasedpolicy/src/main/yang/model/endpoint-locations.yang b/groupbasedpolicy/src/main/yang/model/endpoint-locations.yang
new file mode 100644 (file)
index 0000000..83449d5
--- /dev/null
@@ -0,0 +1,103 @@
+/*\r
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+module endpoint-locations {\r
+    yang-version 1;\r
+\r
+    namespace "urn:opendaylight:groupbasedpolicy:endpoint:location";\r
+    prefix "endpoints-location";\r
+\r
+    import endpoint {\r
+        prefix endpoint;\r
+        revision-date 2014-04-21;\r
+    }\r
+\r
+    description\r
+        "This module defines network element structure for location provider.";\r
+\r
+    revision "2016-04-19" {\r
+        description\r
+            "Initial revision.";\r
+    }\r
+\r
+    typedef provider-name {\r
+        type string;\r
+    }\r
+\r
+    grouping has-regular-location {\r
+        leaf node {\r
+            mandatory true;\r
+            type instance-identifier;\r
+        }\r
+        leaf node-connector {\r
+            type instance-identifier;\r
+        }\r
+    }\r
+\r
+    grouping has-external-location{\r
+        leaf external-node-mount-point {\r
+            mandatory true;\r
+            type instance-identifier;\r
+        }\r
+        leaf external-node-location {\r
+            type string;\r
+            //TODO switch to external-reference\r
+        }\r
+        leaf external-node-connector {\r
+            type string;\r
+            //TODO above\r
+        }\r
+    }\r
+\r
+    grouping has-location {\r
+        container real-location {\r
+            choice location-type {\r
+                case regular-location {\r
+                    uses has-regular-location;\r
+                }\r
+                case external-location {\r
+                    uses has-external-location;\r
+                }\r
+            }\r
+        }\r
+        container relative-location {\r
+            list location {\r
+                key "node node-connector";\r
+                uses has-regular-location;\r
+            }\r
+            list external-location {\r
+                key "external-node-mount-point external-node-connector";\r
+                uses has-external-location;\r
+            }\r
+        }\r
+    }\r
+\r
+    container endpoint-locations {\r
+        list location-provider {\r
+            key "provider";\r
+            leaf provider {\r
+                type provider-name;\r
+            }\r
+            list endpoint-location {\r
+                key "l2-context mac-address";\r
+                uses endpoint:l2-key;\r
+                uses has-location;\r
+            }\r
+            list l3-endpoint-location {\r
+                key "l3-context ip-address";\r
+                uses endpoint:l3-key;\r
+                uses has-location;\r
+            }\r
+            list l3-prefix-endpoint-location {\r
+                key "l3-context ip-prefix";\r
+                uses endpoint:l3-prefix-key;\r
+                uses has-location;\r
+            }\r
+        }\r
+    }\r
+}
\ No newline at end of file