Introduced DomainSpecificRegistry service
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / model / base-endpoint.yang
index 6936a2978f69126ba13fd860260bec923ea05ce0..b92657d9908721ca5db085b73686419af18b9d92 100644 (file)
@@ -9,7 +9,7 @@
 module base-endpoint {
     yang-version 1;
 
-    namespace "urn:opendaylight:groupbasedpolicy:endpoints";
+    namespace "urn:opendaylight:groupbasedpolicy:base_endpoint";
     prefix "base-endpoint";
 
     import gbp-common { prefix gbp-common; revision-date 2014-04-21; }
@@ -21,6 +21,7 @@ module base-endpoint {
     }
 
     grouping address-endpoint-key {
+        uses forwarding:context-key;
         uses forwarding:has-address-type;
         leaf address {
             type string;
@@ -28,15 +29,10 @@ module base-endpoint {
         }
     }
 
-    grouping endpoint-key {
-        uses forwarding:context-key;
-        uses address-endpoint-key;
-    }
-
     grouping has-child-endpoints {
         list child-endpoint {
             key "context-type context-id address-type address";
-            uses endpoint-key;
+            uses address-endpoint-key;
         }
     }
 
@@ -51,7 +47,7 @@ module base-endpoint {
             case parent-endpoint-case {
                 list parent-endpoint {
                     key "context-type context-id address-type address";
-                    uses endpoint-key;
+                    uses address-endpoint-key;
                 }
             }
         }
@@ -66,10 +62,17 @@ module base-endpoint {
                         "The tenant with which this endpoint is associated";
         }
         container network-containment {
-            description
-                        "The network domain associated with this endpoint's fowarding
-                        context.";
-            uses forwarding:network-domain-key;
+            choice containment {
+                description
+                            "The network domain associated with this endpoint's fowarding
+                            context.";
+                case network-domain-containment {
+                    uses forwarding:network-domain-key;
+                }
+                case forwarding-context-containment {
+                    uses forwarding:context-key;
+                }
+            }
         }
         leaf-list endpoint-group {
             type gbp-common:endpoint-group-id;
@@ -91,6 +94,18 @@ module base-endpoint {
         }
     }
 
+    grouping address-endpoint-fields {
+        uses address-endpoint-key;
+        uses parent-child-endpoints;
+        uses common-endpoint-fields;
+    }
+
+    grouping containment-endpoint-fields {
+        uses forwarding:context-key;
+        uses has-child-endpoints;
+        uses common-endpoint-fields;
+    }
+
     grouping has-endpoint-group-conditions {
         description
                 "Base type for object with endpoint group to condition mappings.";
@@ -110,22 +125,27 @@ module base-endpoint {
         }
     }
 
-    grouping has-regular-location {
-        leaf node {
+    grouping internal-location-fields {
+        description "Location inside ODL - node and node-connector
+            are represented directly in ODL.";
+        leaf internal-node {
             mandatory true;
             type instance-identifier;
         }
-        leaf node-connector {
+        leaf internal-node-connector {
             type instance-identifier;
         }
     }
 
-    grouping has-external-location {
+    grouping external-location-fields {
+        description "Location outside of ODL - node and node-connector
+            are outside of ODL. external-node-mount-point is path
+            to external system where node and node-connector are located.";
         leaf external-node-mount-point {
             mandatory true;
             type instance-identifier;
         }
-        leaf external-node-location {
+        leaf external-node {
             type string; // TODO switch to external-reference
         }
         leaf external-node-connector {
@@ -133,69 +153,71 @@ module base-endpoint {
         }
     }
 
-    grouping has-location {
-        container real-location {
+    grouping has-absolute-location {
+        container absolute-location {
             choice location-type {
-                case regular-location {
-                    uses has-regular-location;
+                case internal-location-case {
+                    uses internal-location-fields;
                 }
-                case external-location {
-                    uses has-external-location;
+                case external-location-case {
+                    uses external-location-fields;
                 }
             }
         }
-        container relative-location {
-            list location {
-                key "node node-connector";
-                uses has-regular-location;
+    }
+
+    grouping has-relative-location {
+        container relative-locations {
+            list internal-location {
+                key "internal-node internal-node-connector";
+                uses internal-location-fields;
             }
             list external-location {
                 key "external-node-mount-point external-node-connector";
-                uses has-external-location;
+                uses external-location-fields;
             }
         }
     }
 
+    grouping has-location {
+        uses has-absolute-location;
+        uses has-relative-location;
+    }
+
     container endpoints {
         description
                 "Repository for operational state data about endpoints needed
                 for policy resolution.";
         config false;
 
-        list address-endpoints-by-containment {
-            key "context-type context-id";
-            uses forwarding:context-key;
-
+        container address-endpoints {
             list address-endpoint {
-                key "address-type address";
-                uses address-endpoint-key;
-
-                uses parent-child-endpoints;
-                uses common-endpoint-fields;
-                min-elements 1;
+                key "context-type context-id address-type address";
+                uses address-endpoint-fields;
             }
         }
 
-        list containment-endpoint {
-            key "context-type context-id";
-            uses forwarding:context-key;
-
-            uses has-child-endpoints;
-            uses common-endpoint-fields;
+        container containment-endpoints {
+            list containment-endpoint {
+                key "context-type context-id";
+                uses containment-endpoint-fields;
+            }
         }
     }
 
     container endpoint-locations {
+        config false;
+
         list address-endpoint-location {
             key "context-type context-id address-type address";
-            uses endpoint-key;
+            uses address-endpoint-key;
             uses has-location;
         }
 
         list containment-endpoint-location {
             key "context-type context-id";
             uses forwarding:context-key;
-            uses has-location;
+            uses has-relative-location;
         }
     }
 
@@ -208,19 +230,13 @@ module base-endpoint {
         input {
             list address-endpoint-reg {
                 key "context-type context-id address-type address";
-                uses endpoint-key;
-
-                uses parent-child-endpoints;
-                uses common-endpoint-fields;
+                uses address-endpoint-fields;
                 uses has-location;
             }
             list containment-endpoint-reg {
                 key "context-type context-id";
-                uses forwarding:context-key;
-
-                uses has-child-endpoints;
-                uses common-endpoint-fields;
-                uses has-location;
+                uses containment-endpoint-fields;
+                uses has-relative-location;
             }
         }
     }
@@ -231,7 +247,7 @@ module base-endpoint {
         input {
             list address-endpoint-unreg {
                 key "context-type context-id address-type address";
-                uses endpoint-key;
+                uses address-endpoint-key;
             }
             list containment-endpoint-unreg {
                 key "context-type context-id";