diff mbox

[ovs-dev,RFC,5/8] ovn-nb: Add Load-balancer table to schema.

Message ID 1456727604-15784-6-git-send-email-guru@ovn.org
State Changes Requested
Headers show

Commit Message

Gurucharan Shetty Feb. 29, 2016, 6:33 a.m. UTC
Also add the ability to run database commands on the
new schema using ovn-nbctl.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
---
 ovn/ovn-nb.ovsschema      | 18 ++++++++++++++++--
 ovn/ovn-nb.xml            | 24 ++++++++++++++++++++++++
 ovn/utilities/ovn-nbctl.c |  4 ++++
 3 files changed, 44 insertions(+), 2 deletions(-)

Comments

Ben Pfaff March 15, 2016, 5:24 p.m. UTC | #1
On Sun, Feb 28, 2016 at 10:33:21PM -0800, Gurucharan Shetty wrote:
> Also add the ability to run database commands on the
> new schema using ovn-nbctl.
> 
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>

Some of the indentation in ovn/ovn-nb.xml looked a bit funny.  I think
that it might use tabs in some places, whereas that file generally uses
spaces only.

I see that "loadbalancer" is run together into one word in the
documentation in some places.  It looks funny to me like that; I would
prefer to include a space.  It also looks like we usually include an
underscore in the schema for multiple words, so load_balancer might be a
more consistent name there.  (Outside the schema it doesn't bother me
nearly as much, since it's easy to change internal identifiers later.)

I think that it would be helpful for the .xml to give a little more
information on the expected behavior of a load balancer.  It is probably
obvious to people who know load balancers well, but an extra sentence or
two would help the rest of us a bit.

Thanks,

Ben.
diff mbox

Patch

diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
index 9fb8cd1..9505935 100644
--- a/ovn/ovn-nb.ovsschema
+++ b/ovn/ovn-nb.ovsschema
@@ -1,7 +1,7 @@ 
 {
     "name": "OVN_Northbound",
-    "version": "2.0.1",
-    "cksum": "660370796 4618",
+    "version": "2.0.2",
+    "cksum": "3019970937 5337",
     "tables": {
         "Logical_Switch": {
             "columns": {
@@ -16,6 +16,11 @@ 
                                           "refType": "strong"},
                                   "min": 0,
                                   "max": "unlimited"}},
+                "loadbalancer": {"type": {"key": {"type": "uuid",
+                                                  "refTable": "Load_Balancer",
+                                                  "refType": "strong"},
+                                           "min": 0,
+                                           "max": 1}},
                 "external_ids": {
                     "type": {"key": "string", "value": "string",
                              "min": 0, "max": "unlimited"}}},
@@ -48,6 +53,15 @@ 
                              "min": 0, "max": "unlimited"}}},
             "indexes": [["name"]],
             "isRoot": false},
+        "Load_Balancer": {
+            "columns": {
+                "vips": {
+                    "type": {"key": "string", "value": "string",
+                             "min": 0, "max": "unlimited"}},
+                "external_ids": {
+                    "type": {"key": "string", "value": "string",
+                             "min": 0, "max": "unlimited"}}},
+            "isRoot": true},
         "ACL": {
             "columns": {
                 "priority": {"type": {"key": {"type": "integer",
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index ef34c9b..d2673ae 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -59,6 +59,11 @@ 
       Access control rules that apply to packets within the logical switch.
     </column>
 
+    <column name="loadbalancer">
+      Loadbalance a virtual ipv4 address to a set of logical port endpoint
+	  ipv4 addresses
+    </column>
+
     <group title="Common Columns">
       <column name="external_ids">
         See <em>External IDs</em> at the beginning of this document.
@@ -326,6 +331,25 @@ 
     </group>
   </table>
 
+  <table name="Load_Balancer" title="loadbalancer">
+    <p>
+      Each row represents one loadbalancer
+    </p>
+
+    <column name="vips">
+      <p>
+        A map of virtual ipv4 addresses associated with this load balancer and
+		their corresponding endpoint ipv4 addresses separated by commas.
+      </p>
+    </column>
+
+    <group title="Common Columns">
+      <column name="external_ids">
+        See <em>External IDs</em> at the beginning of this document.
+      </column>
+    </group>
+  </table>
+
   <table name="ACL" title="Access Control List (ACL) rule">
     <p>
       Each row in this table represents one ACL rule for a logical switch
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 2303f31..5b3f081 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1073,6 +1073,10 @@  static const struct ctl_table_class tables[] = {
      {{NULL, NULL, NULL},
       {NULL, NULL, NULL}}},
 
+    {&nbrec_table_load_balancer,
+     {{NULL, NULL, NULL},
+      {NULL, NULL, NULL}}},
+
     {&nbrec_table_logical_router,
      {{&nbrec_table_logical_router, &nbrec_logical_router_col_name, NULL},
       {NULL, NULL, NULL}}},