Fixed address domain to match documentation. 52/2052/1
authorSuchi Raman <suchi.raman@plexxi.com>
Mon, 21 Oct 2013 14:59:26 +0000 (10:59 -0400)
committerSuchi Raman <suchi.raman@plexxi.com>
Mon, 21 Oct 2013 14:59:26 +0000 (10:59 -0400)
Signed-off-by: Suchi Raman <suchi.raman@plexxi.com>
affinity/yang/pom.xml
affinity/yang/src/main/yang/affinity-config-all.yang

index 527d17e03e837c1ffeb23c3f360d160c303890ac..4073c100b4ef21a9bd1e189f578a3863e503d712 100644 (file)
@@ -14,7 +14,7 @@
 
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.opendaylight.affinity</groupId>
-    <artifactId>model-parent</artifactId>
+    <artifactId>model</artifactId>
     <version>1.0-SNAPSHOT</version>
     <packaging>jar</packaging>
 
index f17fc59026943e3964dfd39dbcb41321d13afe95..fdabdfcbf6fb79fa6ded0442e542ec7c49f7fa71 100644 (file)
@@ -9,92 +9,106 @@ module affinity-config-all {
     import opendaylight-l2-types { prefix l2types; }
 
     revision "2013-09-25" {
-        description "Initial revision of affinity model to be reviewed";
+       description "Initial revision of affinity model to be reviewed";
     }
 
 
   //**************************************************
-  // Stationary location -- switch + port, includes physical or virtual 
-  // ports for example within a hypervisor representing a virtual switch. 
+  // Stationary location within the network -- switch + port, including physical switch port 
+  // or virtual switch port within a hypervisor virtual switch. 
   //**************************************************
   grouping affinity-endpoint {
       leaf switch-port {
-          type inv:node-connector-id;
+         type inv:node-connector-id;
       }
   }
 
-
   //**************************************************
   // Affinity address domain: This represents a domain (i.e, set) of one or
-  // more addresses. An affinity address may not have a corresponding
-  // endpoint on the network, for example, for traffic from a set of
-  // external addresses (north-south traffic in a data center), the source
-  // IP address domain is not required to map exactly to endpoints or node
-  // connectors on the network. We assume that there will be a resolution 
-  // service that resolves one of these into an endpoint, when the address 
-  // is present on the network. 
+  // more addresses. An affinity address may not always have a corresponding
+  // endpoint on the network, for example, an address domain representing 
+  // external addresses, or north-south traffic in a data center). Here the 
+  // IP address domain representing such external addresses does not map to 
+  // endpoints or node connectors on the network. 
+  // Whenever possible, the affinity service must resolve the address domain
+  // into a list of endpoints especially when the address is present on the network. 
+  // 
+  // Affinity address domains specify one or more of the following: 
+  // layer 2 address (vlan + mac range)
+  // layer 3 address (IP prefix)
+  // layer 4 address (tcp or udp port number)
   //**************************************************
+
    grouping affinity-address-domain {
-        leaf id {
-            type string;
-        }
-        // Address is either an IP address, IP prefix, IP range, or
-        // MAC address, or MAC range. Address may also be a transport
-        // protocol layer address.
-
-        leaf address {
-            description "Mac or Inet address";
-            type union {
-                type inet:ip-address;
-                type inet:ip-prefix; 
-                type l2types:vlan-id; // tbd
-                type yang:mac-address;
-//                type yang:mac-address-range;
-//                type yang:tp-address; // tbd
-            }
-        }
-    }
+       // l2-domain-address is vlan + MAC address range
+       container l2-address {
+          leaf vlan-id {
+              type l2types:vlan-id; 
+          }
+          container mac-address-range {
+              uses mac-address-range;
+          }
+       }
 
-    typedef affinity-group-ref {
-        type instance-identifier;
-    }
-    
-    typedef affinity-link-ref {
-        type instance-identifier;
-    }
-    
-    typedef network-service-chain-ref {
-        type instance-identifier;
-    }
+       // l3-domain-address is IPv4 prefix
+       leaf l3-address {
+          type inet:ipv4-prefix;
+       }
 
+       // l4 port number 
+       container l4-address {
+           leaf proto {
+               type string; // "tcp" or "udp"
+           }
+           leaf port-number {   
+               type inet:port-number;
+           }
+       }        
+   }       
 
-    grouping affinity-element {
-        leaf id {
-            type string;
-        }
-        choice element {
-            description "affinity element";
-            case affinity-endpoint {
-                 uses affinity-endpoint;
-                }
-                
-            // Apply waypoint routing to the selected flows and send it through service chain. 
-            case affinity-address-domain {
-                 uses affinity-address-domain;
-            }
-        }
-    }       
-  //**************************************************
-  // Affinity group
-  //**************************************************
+   grouping mac-address-range {
+       leaf start-address {
+          type yang:mac-address;
+       }
+       leaf end-address {
+          type yang:mac-address;
+       }
+   }
+
+   typedef affinity-group-ref {
+       type instance-identifier;
+   }
+   
+   typedef affinity-link-ref {
+       type instance-identifier;
+   }
+   
+   grouping affinity-element {
+       leaf id {
+          type string;
+       }
+       choice element {
+          description "affinity element";
+          case affinity-endpoint {
+                  uses affinity-endpoint;
+              }
+              
+              case affinity-address-domain {
+                      uses affinity-address-domain;
+                  }
+       }
+   }      
+   //**************************************************
+   // Affinity group
+   //**************************************************
     grouping affinity-group {
-        leaf id {
-            type string;
-        }   
-        list affinity-element {
-            key id;
-            uses affinity-element;
-        }
+       leaf id {
+           type string;
+       }   
+       list affinity-element {
+           key id;
+           uses affinity-element;
+       }
     }
 
     //**************************************************
@@ -107,63 +121,67 @@ module affinity-config-all {
     // affinity links, one in each direction.
     //**************************************************
     grouping affinity-link {
-        leaf id {
-            type string;
-        }
-        leaf from-affinity-group {
-            type affinity-group-ref;
-        }
-        leaf to-affinity-group {
-            type affinity-group-ref;
-        }
-        container attribute {
-            uses affinity-attribute; 
-        }
+       leaf id {
+           type string;
+       }
+       leaf from-affinity-group {
+           type affinity-group-ref;
+       }
+       leaf to-affinity-group {
+           type affinity-group-ref;
+       }
+       container attribute {
+           uses affinity-attribute; 
+       }
     }
 
     typedef affinity-access-control-type {
-              type enumeration {
-                  enum permit;
-                  enum deny;
-              }
+             type enumeration {
+                 enum permit;
+                 enum deny;
+             }
     }
 
     //**************************************************
     // Affinity attribute. Each is expanded in their own grouping construct below. 
     //**************************************************
     grouping affinity-attribute {
-        leaf id {
-            type string;
-        }
-        choice attribute-type {
-            description "affinity attribute";
-            // Apply access control to selected flows. 
-            case affinity-access-control {
-                    leaf affinity-access-control {
-                        type  affinity-access-control-type;
-                    }
-                }
-                
-                // Apply waypoint routing to the selected flows and send it through service chain. 
-            case network-service-chain {
-                    leaf network-service-chain  {
-                        type network-service-chain-ref;
-                    }
-            }
-        }
+       leaf id {
+           type string;
+       }
+       choice attribute-type {
+           description "affinity attribute";
+           // Apply access control to selected flows. 
+           case affinity-access-control {
+                   leaf affinity-access-control {
+                       type  affinity-access-control-type;
+                   }
+               }
+               
+               // Apply waypoint routing to the selected flows and send it through service chain. 
+           case network-service-chain {
+                   leaf network-service-chain  {
+                       type network-service-chain-ref;
+                   }
+           }
+       }
     }
 
     //**************************************************
     // Network service chain configuration. 
     //**************************************************
+    typedef network-service-chain-ref {
+        type instance-identifier;
+    }
+    
     grouping network-service-chain {
-        leaf id {
-            type string;
-        }   
-        list service-chain {
-            key id;
-            uses network-service-function;
-        }
+       leaf id {
+           type string;
+       }   
+       list service-chain {
+           key id;
+           uses network-service-function;
+       }
     }
 
     //**************************************************
@@ -171,18 +189,18 @@ module affinity-config-all {
     // types of addresses.
     //**************************************************
     grouping network-service-function {
-        leaf id {
-            type string;
-        }
-        // Address is either an IP address, MAC address, or switch/port. 
-        leaf location {
-            description "Mac or Inet address";
-            type union {
-                type inv:node-connector-id;
-                type yang:mac-address;
-                type inet:ip-address;
-            }
-        }
+       leaf id {
+           type string;
+       }
+       // Address is either an IP address, MAC address, or switch/port. 
+       leaf location {
+           description "Mac or Inet address";
+           type union {
+               type inv:node-connector-id;
+               type yang:mac-address;
+               type inet:ip-address;
+           }
+       }
     }
 
     // Main container that represents the complete set of affinity
@@ -190,18 +208,79 @@ module affinity-config-all {
     // as the key. List contains affinity group and affinity link objects
     // defined above.
     container affinity-config {
-        list affinity-group {
-            key id;
-            ext:context-instance "affinity-group-context";
-            uses affinity-group;
-        }
-        list affinity-link {
-            key id;
-            ext:context-instance "affinity-link-context";
-            uses affinity-link;
-        }
+       list affinity-group {
+           key id;
+           ext:context-instance "affinity-group-context";
+           uses affinity-group;
+       }
+       list affinity-link {
+           key id;
+           ext:context-instance "affinity-link-context";
+           uses affinity-link;
+       }
+    }
+
+    //******************************
+    // RPCs to create affinity groups, add endpoints and address domains. 
+    //******************************
+    rpc create-affinity-group {
+       input {
+           uses affinity-group;
+       }
+       output {
+           leaf status {
+               type string;
+           }
+       }
+    }
+
+    rpc add-affinity-endpoint {
+       input {
+           leaf affinity-endpoint {
+               type inv:node-connector-id;
+           }
+       }
+       output {
+           leaf status {
+               type string;
+           }
+       }
     }
 
+    rpc add-affinity-domain {
+       input {
+           container affinity-domain {
+               uses affinity-address-domain;
+           }
+       }    
+       output {
+           leaf status {
+               type string;
+           }
+       }
+    }
+
+    rpc get-affinity-groups {
+       output {
+           list affinity-group {
+           key id;
+           uses affinity-group;
+           }
+       }
+    }
+    rpc get-affinity-links;
+    rpc get-affinity-group;
+    rpc get-affinity-link;
+
+    rpc get-stats-per-affinity-link;
+
+    //**************************************************
+    // Notifications 
+    //**************************************************
+    notification new-affinity-endpoint;
+    notification new-affinity-domain;
+    notification modify-affinity-attribute;
+
 }