Moving VTN away from old XOS APIs onto GRPC APIs.

Instead of the VTN app pulling the ServiceNetwork and SerivcePort
info from XOS, the VTN simply sets a flag to indicate it wants a
full resync of the data. The VTN synchronizer then knows to send
all ServiceNetwork and ServicePort information on next sync.

Change-Id: I84bd1e6bb691dcbb9667c30c252921894b06bb2a
diff --git a/xos/synchronizer/steps/sync_vtn_service.py b/xos/synchronizer/steps/sync_vtn_service.py
index 7b7aedb..862b0f6 100644
--- a/xos/synchronizer/steps/sync_vtn_service.py
+++ b/xos/synchronizer/steps/sync_vtn_service.py
@@ -211,12 +211,24 @@
                     logger.error("Received error from vtn service (%d)" % r.status_code)
 
     def call(self, **args):
+        global glo_saved_networks
+        global glo_saved_ports
+
         vtn_service = VTNService.objects.all()
         if not vtn_service:
             raise Exception("No VTN Service")
 
         vtn_service = vtn_service[0]
 
+        if (vtn_service.resync):
+            # If the VTN app requested a full resync, clear our saved network
+            # so we will resync everything, then reset the 'resync' flag
+            glo_saved_networks = {}
+            glo_saved_ports = {}
+
+            vtn_service.resync = False
+            vtn_service.save()
+
         if vtn_service.vtnAPIVersion>=2:
             # version 2 means use new API
             logger.info("Using New API")
diff --git a/xos/vtn.xproto b/xos/vtn.xproto
index bd7ff54..ec98877 100644
--- a/xos/vtn.xproto
+++ b/xos/vtn.xproto
@@ -15,4 +15,5 @@
      required string xosPassword = 10 [default = "letmein", max_length = 255, content_type = "stripped", blank = False, null = False, db_index = False];
      required int32 vtnAPIVersion = 11 [default = 1, null = False, db_index = False, blank = False];
      required string controllerPort = 12 [default = "onos-cord:6653", max_length = 255, content_type = "stripped", blank = False, null = False, db_index = False];
+     required bool resync = 13 [default = False, null = False, db_index = False, blank = False];
 }