IOvisor policy processing
[groupbasedpolicy.git] / renderers / iovisor / src / main / yang / iovisor.yang
index 28d612f79971e77b5897e201ac833b5b61757259..725cd89a53c91fa761d9b9903a5f9af5fb1558d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -15,6 +15,7 @@ module iovisor {
     import yang-ext {prefix ext; revision-date "2013-07-09";}
     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
     import endpoint { prefix endpoint; }
+    import gbp-common { prefix gbp-common; }
 
     description
         "This module defines the group-based policy iovisor renderer model.";
@@ -25,11 +26,19 @@ module iovisor {
     }
 
     typedef iovisor-module-id {
+        /*
+        * TODO Either convert this to URI or allow String but expect name:port where name will
+        * resolved into ip:port (see iovisor-module grouping)
+        */
         description "Uniquely identifies the IOVisor module";
         type string;
     }
 
     grouping iovisor-module {
+        /*
+        * TODO Convert this to leafs of IP(v4|v6) and port - easier to validate
+        * For now assuming format "ip:port"
+        */
         leaf uri {
             type inet:uri;
             description "IOVisor module uniform resource identifier.";
@@ -51,9 +60,41 @@ module iovisor {
         }
     }
 
-    augment "/endpoint:endpoints/endpoint:endpoint" {
+    container iovisor-resolved-endpoints {
+        description "IOvisor validated Endpoints";
+        config false;
+        list iovisor-resolved-endpoint {
+            key "l3-context ip-address";
+            uses endpoint:l3-key;
+        }
+    }
+
+    container iovisor-resolved-endpoints-by-tenant-by-endpointgroup-id {
+        config false;
+        list iovisor-resolved-endpoint-by-tenant-by-endpointgroup-id {
+            key "tenant-id endpointgroup-id";
+            leaf tenant-id {
+                type gbp-common:tenant-id;
+            }
+            leaf endpointgroup-id {
+                type gbp-common:endpoint-group-id;
+            }
+            list iovisor-endpoint {
+                key "l3-context ip-address";
+                uses endpoint:l3-key;
+            }
+        }
+    }
+
+    augment "/endpoint:endpoints/endpoint:endpoint-l3" {
         description "Augmentation adding the IOVisor module location";
         ext:augment-identifier "iovisor-module-augmentation";
         uses iovisor-module;
     }
+
+    augment "/endpoint:register-endpoint/endpoint:input" {
+        description "Augmentation adding the IOVisor module location";
+        ext:augment-identifier "iovisor-module-augmentation-input";
+        uses iovisor-module;
+    }
 }