Simplified renderer API 46/38946/1
authorMartin Sunal <msunal@cisco.com>
Mon, 16 May 2016 20:03:40 +0000 (22:03 +0200)
committerMartin Sunal <msunal@cisco.com>
Mon, 16 May 2016 20:03:40 +0000 (22:03 +0200)
Pros
- renderer API is more clear
- easy to process config by renderer
- fixes cases which were not possible to have eg.:
  EP1--EPG_BLUE---SUBJECT_1---(P)EPG_PURPLE--EP2
  EP3--EPG_RED----SUBJECT_1---(P)EPG_GREY--EP4
Cons
- repeated data for endpoints with same policy

This commit also depricates domain specific endpoint contstraints
in policy.yang

Signed-off-by: Martin Sunal <msunal@cisco.com>
groupbasedpolicy/src/main/yang/model/policy.yang
groupbasedpolicy/src/main/yang/model/renderer.yang

index fce531f99e6e21a74ee59f1bc7723c67d6afd2aa..4335eee413941aac87b841b4c231c231f495b490 100755 (executable)
@@ -238,6 +238,9 @@ module policy {
     }
 
     grouping has-endpoint-identification-constraints {
+
+        status deprecated;
+
         container endpoint-identification-constraints {
             description
                 "Identify endpoints via other attributes other than conditions.
index 2c5cda0824b9a73e9e75bd218e0c03dd48f6088a..2b15e8487c5ceff3b2c19efd0ab4f891569e0268 100755 (executable)
@@ -107,13 +107,6 @@ module renderer {
         }
     }
 
-    grouping has-peer-containment-endpoints {
-        list peer-containment-endpoint {
-            key "context-type context-id";
-            uses forwarding:context-key;
-        }
-    }
-
     grouping has-peer-external-endpoints {
         list peer-external-endpoint {
             key "context-type context-id address-type address";
@@ -135,6 +128,18 @@ module renderer {
         }
     }
 
+    grouping has-rule-group-with-renderer-endpoint-participation {
+        list rule-group-with-renderer-endpoint-participation {
+            description "A specific policy rule group that apply to pair of endpoints.
+                Entire rule-group is located on /renderers/renderer/renderer-policy/configuration/rule-groups/rule-group";
+            key "tenant-id contract-id subject-name renderer-endpoint-participation";
+            uses resolved-policy:has-subject-key;
+            leaf renderer-endpoint-participation {
+                type endpoint-policy-participation;
+            }
+        }
+    }
+
     container renderers {
         description
             "Leaf containing all renderers' description.";
@@ -179,45 +184,29 @@ module renderer {
 
                 container configuration {
                     description "Renderer tries to apply given policy on devices.";
-                    container endpoint-resolved-policies {
-                        list endpoint-resolved-policy {
-                            description "Policy between renderer-endpoints and peer-endpoints.";
-                            key policy-name;
-                            leaf policy-name {
-                                description "Key is here only as workaround for bugs around unkeyed list. It can be removed anytime.";
-                                type policy-name;
-                            }
+                    container renderer-endpoints {
+                        list renderer-endpoint {
+                            description "Policy between renderer-endpoint and peer-endpoints (peers).
+                                Renderer configures policy for renderer endpoints.";
+                            key "context-type context-id address-type address";
+                            uses base-endpoint:address-endpoint-key;
 
-                            container provided-resolved-policy {
-                                list provided-rule-group {
-                                    description "A specific policy rule group that apply to pair of endpoints.
-                                        Renderer Endpoint is a provider of the rule group.
-                                        Entire rule-group is located on /renderers/renderer/renderer-policy/configuration/rule-groups/rule-group";
-                                    key "tenant-id contract-id subject-name";
-                                    uses resolved-policy:has-subject-key;
-                                }
+                            list peer-endpoint-with-policy {
+                                key "context-type context-id address-type address";
+                                uses base-endpoint:address-endpoint-key;
+                                uses has-rule-group-with-renderer-endpoint-participation;
                             }
 
-                            container consumed-resolved-policy {
-                                list consumed-rule-group {
-                                    description "A specific policy rule group that apply to pair of endpoints.
-                                        Renderer Endpoint is a consumer of the rule group.
-                                        Entire rule-group is located on /renderers/renderer/renderer-policy/configuration/rule-groups/rule-group";
-                                    key "tenant-id contract-id subject-name";
-                                    uses resolved-policy:has-subject-key;
-                                }
+                            list peer-external-endpoint-with-policy {
+                                key "context-type context-id address-type address";
+                                uses base-endpoint:address-endpoint-key;
+                                uses has-rule-group-with-renderer-endpoint-participation;
                             }
 
-                            container renderer-endpoints-and-peers {
-                                description "Every renderer-endpoint has the same set of peer-endpoints.
-                                    A renderer should not configure a policy when renderer-endpoint is peer-endpoint.";
-                                list renderer-endpoint {
-                                    key "context-type context-id address-type address";
-                                    uses base-endpoint:address-endpoint-key;
-                                }
-                                uses has-peer-endpoints;
-                                uses has-peer-external-endpoints;
-                                uses has-peer-external-containment-endpoints;
+                            list peer-external-containment-endpoint-with-policy {
+                                key "context-type context-id";
+                                uses forwarding:context-key;
+                                uses has-rule-group-with-renderer-endpoint-participation;
                             }
                         }
                     }