Fixed conflict, rename vSGW to vSGWC

Change-Id: I68405395edeedd305b43c0dfd9a85f46f582122d
diff --git a/xos/models.py b/xos/models.py
index 48a9911..fac349b 100644
--- a/xos/models.py
+++ b/xos/models.py
@@ -1,6 +1,6 @@
 from core.models.plcorebase import *
-from models_decl import VSGWService_decl
-from models_decl import VSGWTenant_decl
+from models_decl import VSGWCService_decl
+from models_decl import VSGWCTenant_decl
 
 from django.db import models
 from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
@@ -18,49 +18,49 @@
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes.fields import GenericForeignKey
 
-class VSGWService(VSGWService_decl):
+class VSGWCService(VSGWCService_decl):
    class Meta:
         proxy = True 
 
-   def create_tenant(self, **kwargs):
-       t = VSGWTenant(kind="vEPC", provider_service=self, connect_method="na", tenant_message="vsgw tenant in service chain", **kwargs)
+   def VSGWC_tenant(self, **kwargs):
+       t = VSGWCTenant(kind="vEPC", provider_service=self, connect_method="na", tenant_message="vsgwc tenant in service chain", **kwargs)
        t.save()
        return t
 
-class VSGWTenant(VSGWTenant_decl):
+class VSGWCTenant(VSGWCTenant_decl):
    class Meta:
         proxy = True 
         
    def __init__(self, *args, **kwargs):
-       vsgwservice = VSGWService.get_service_objects().all()
-       if vsgwservice:
+       vsgwcservice = VSGWCService.get_service_objects().all()
+       if vsgwcservice:
            self._meta.get_field(
-                   "provider_service").default = vsgwservice[0].id
-       super(VSGWTenant, self).__init__(*args, **kwargs)
+                   "provider_service").default = vsgwcservice[0].id
+       super(VSGWCTenant, self).__init__(*args, **kwargs)
 
    def save(self, *args, **kwargs):
        if not self.creator:
            if not getattr(self, "caller", None):
-               raise XOSProgrammingError("VSGWTenant's self.caller was not set")
+               raise XOSProgrammingError("VSGWCTenant's self.caller was not set")
            self.creator = self.caller
            if not self.creator:
-               raise XOSProgrammingError("VSGWTenant's self.creator was not set")
+               raise XOSProgrammingError("VSGWCTenant's self.creator was not set")
 
-       super(VSGWTenant, self).save(*args, **kwargs)
+       super(VSGWCTenant, self).save(*args, **kwargs)
        # This call needs to happen so that an instance is created for this
        # tenant is created in the slice. One instance is created per tenant.
-       model_policy_vsgwtenant(self.pk)
+       model_policy_vsgwctenant(self.pk)
 
    def delete(self, *args, **kwargs):
        # Delete the instance that was created for this tenant
        self.cleanup_container()
-       super(VSGWTenant, self).delete(*args, **kwargs)
+       super(VSGWCTenant, self).delete(*args, **kwargs)
 
-def model_policy_vsgwtenant(pk):
+def model_policy_vsgwctenant(pk):
     # This section of code is atomic to prevent race conditions
     with transaction.atomic():
         # We find all of the tenants that are waiting to update
-        tenant = VSGWTenant.objects.select_for_update().filter(pk=pk)
+        tenant = VSGWCTenant.objects.select_for_update().filter(pk=pk)
         if not tenant:
             return
         # Since this code is atomic it is safe to always use the first tenant
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
index f6607ac..859575e 100644
--- a/xos/synchronizer/Dockerfile.synchronizer
+++ b/xos/synchronizer/Dockerfile.synchronizer
@@ -1,15 +1,15 @@
-# xosproject/vsgw-synchronizer
+# xosproject/vsgwc-synchronizer
 FROM xosproject/xos-synchronizer-base:candidate
 
-COPY . /opt/xos/synchronizers/vsgw
+COPY . /opt/xos/synchronizers/vsgwc
 
 ENTRYPOINT []
 
-WORKDIR "/opt/xos/synchronizers/vsgw"
+WORKDIR "/opt/xos/synchronizers/vsgwc"
 
 # Label image
 ARG org_label_schema_schema_version=1.0
-ARG org_label_schema_name=vsgw-synchronizer
+ARG org_label_schema_name=vsgwc-synchronizer
 ARG org_label_schema_version=unknown
 ARG org_label_schema_vcs_url=unknown
 ARG org_label_schema_vcs_ref=unknown
@@ -36,4 +36,4 @@
       org.opencord.component.xos.vcs-url=$org_opencord_component_xos_vcs_url \
       org.opencord.component.xos.vcs-ref=$org_opencord_component_xos_vcs_ref
 
-CMD bash -c "cd /opt/xos/synchronizers/vsgw; ./run-from-api.sh"
\ No newline at end of file
+CMD bash -c "cd /opt/xos/synchronizers/vsgwc; ./run-from-api.sh"
\ No newline at end of file
diff --git a/xos/synchronizer/manifest b/xos/synchronizer/manifest
index 04700fd..42602f4 100644
--- a/xos/synchronizer/manifest
+++ b/xos/synchronizer/manifest
@@ -2,7 +2,7 @@
 manifest
 run.sh
 stop.sh
-vsgw-synchronizer.py
-vsgw_config
-steps/sync_vsgw.py
-steps/sync_vsgw.yaml
+vsgwc-synchronizer.py
+vsgwc_config
+steps/sync_vsgwc.py
+steps/sync_vsgwc.yaml
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
index bcbc374..3b4b9f9 100755
--- a/xos/synchronizer/run-from-api.sh
+++ b/xos/synchronizer/run-from-api.sh
@@ -1,2 +1,2 @@
 export XOS_DIR=/opt/xos
-python vsgw-synchronizer.py  -C $XOS_DIR/synchronizers/vsgw/vsgw_from_api_config
\ No newline at end of file
+python vsgwc-synchronizer.py  -C $XOS_DIR/synchronizers/vsgwc/vsgwc_from_api_config
\ No newline at end of file
diff --git a/xos/synchronizer/steps/sync_vsgwtenant.py b/xos/synchronizer/steps/sync_vsgwctenant.py
similarity index 71%
rename from xos/synchronizer/steps/sync_vsgwtenant.py
rename to xos/synchronizer/steps/sync_vsgwctenant.py
index 4d7e3b4..31583f2 100644
--- a/xos/synchronizer/steps/sync_vsgwtenant.py
+++ b/xos/synchronizer/steps/sync_vsgwctenant.py
@@ -7,29 +7,29 @@
 parentdir = os.path.join(os.path.dirname(__file__), "..")
 sys.path.insert(0, parentdir)
 
-class SyncVSGWTenant(SyncInstanceUsingAnsible):
+class SyncVSGWCTenant(SyncInstanceUsingAnsible):
 
-    provides = [VSGWTenant]
+    provides = [VSGWCTenant]
 
-    observes = VSGWTenant
+    observes = VSGWCTenant
 
     requested_interval = 0
 
-    template_name = "vsgwtenant_playbook.yaml"
+    template_name = "vsgwctenant_playbook.yaml"
 
     service_key_name = "/opt/xos/configurations/mcord/mcord_private_key"
 
     def __init__(self, *args, **kwargs):
-        super(SyncVSGWTenant, self).__init__(*args, **kwargs)
+        super(SyncVSGWCTenant, self).__init__(*args, **kwargs)
 
     def fetch_pending(self, deleted):
 
         if (not deleted):
-            objs = VSGWTenant.get_tenant_objects().filter(
+            objs = VSGWCTenant.get_tenant_objects().filter(
                 Q(enacted__lt=F('updated')) | Q(enacted=None), Q(lazy_blocked=False))
         else:
             # If this is a deletion we get all of the deleted tenants..
-            objs = VSGWTenant.get_deleted_tenant_objects()
+            objs = VSGWCTenant.get_deleted_tenant_objects()
 
         return objs
 
diff --git a/xos/synchronizer/steps/vsgwtenant_playbook.yaml b/xos/synchronizer/steps/vsgwctenant_playbook.yaml
similarity index 100%
rename from xos/synchronizer/steps/vsgwtenant_playbook.yaml
rename to xos/synchronizer/steps/vsgwctenant_playbook.yaml
diff --git a/xos/synchronizer/stop.sh b/xos/synchronizer/stop.sh
index 4444370..68fe7c4 100644
--- a/xos/synchronizer/stop.sh
+++ b/xos/synchronizer/stop.sh
@@ -1,2 +1,2 @@
 # Kill the observer
-pkill -9 -f vsgw-synchronizer.py
+pkill -9 -f vsgwc-synchronizer.py
diff --git a/xos/synchronizer/vsgw_from_api_config b/xos/synchronizer/vsgw_from_api_config
deleted file mode 100644
index d0f23fd..0000000
--- a/xos/synchronizer/vsgw_from_api_config
+++ /dev/null
@@ -1,20 +0,0 @@
-# Sets options for the synchronizer
-[observer]
-name=vsgw
-dependency_graph=/opt/xos/synchronizers/vsgw/model-deps
-steps_dir=/opt/xos/synchronizers/vsgw/steps
-sys_dir=/opt/xos/synchronizers/vsgw/sys
-#logfile=/var/log/xos_backend.log
-log_file=console
-log_level=debug
-pretend=False
-backoff_disabled=True
-save_ansible_output=True
-proxy_ssh=True
-proxy_ssh_key=/opt/cord_profile/node_key
-proxy_ssh_user=root
-accessor_kind=api
-accessor_password=@/opt/xos/services/vsgw/credentials/xosadmin@opencord.org
-
-[networking]
-use_vtn=True
\ No newline at end of file
diff --git a/xos/synchronizer/vsgw-synchronizer.py b/xos/synchronizer/vsgwc-synchronizer.py
similarity index 100%
rename from xos/synchronizer/vsgw-synchronizer.py
rename to xos/synchronizer/vsgwc-synchronizer.py
diff --git a/xos/synchronizer/vsgwc_from_api_config b/xos/synchronizer/vsgwc_from_api_config
new file mode 100644
index 0000000..fcd8bd3
--- /dev/null
+++ b/xos/synchronizer/vsgwc_from_api_config
@@ -0,0 +1,20 @@
+# Sets options for the synchronizer
+[observer]
+name=vsgwc
+dependency_graph=/opt/xos/synchronizers/vsgwc/model-deps
+steps_dir=/opt/xos/synchronizers/vsgwc/steps
+sys_dir=/opt/xos/synchronizers/vsgwc/sys
+#logfile=/var/log/xos_backend.log
+log_file=console
+log_level=debug
+pretend=False
+backoff_disabled=True
+save_ansible_output=True
+proxy_ssh=True
+proxy_ssh_key=/opt/cord_profile/node_key
+proxy_ssh_user=root
+accessor_kind=api
+accessor_password=@/opt/xos/services/vsgwc/credentials/xosadmin@opencord.org
+
+[networking]
+use_vtn=True
\ No newline at end of file
diff --git a/xos/tosca/custom_types/vsgw.m4 b/xos/tosca/custom_types/vsgwc.m4
similarity index 76%
rename from xos/tosca/custom_types/vsgw.m4
rename to xos/tosca/custom_types/vsgwc.m4
index 45c35e4..144921a 100644
--- a/xos/tosca/custom_types/vsgw.m4
+++ b/xos/tosca/custom_types/vsgwc.m4
@@ -1,25 +1,25 @@
 tosca_definitions_version: tosca_simple_yaml_1_0
 
-# compile this with "m4 vbbu.m4 > vsgw.yaml"
+# compile this with "m4 vsgwc.m4 > vsgwc.yaml"
 
 # include macros
 include(macros.m4)
 
 node_types:
-    tosca.nodes.VSGWService:
+    tosca.nodes.VSGWCService:
         derived_from: tosca.nodes.Root
         description: >
-            VSGW Service
+            VSGWC Service
         capabilities:
             xos_base_service_caps
         properties:
             xos_base_props
             xos_base_service_props
 
-    tosca.nodes.VSGWTenant:
+    tosca.nodes.VSGWCTenant:
         derived_from: tosca.nodes.Root
         description: >
-            VSGW Tenant
+            VSGWC Tenant
         properties:
             xos_base_tenant_props
             tenant_message:
diff --git a/xos/tosca/custom_types/vsgw.yaml b/xos/tosca/custom_types/vsgwc.yaml
similarity index 94%
rename from xos/tosca/custom_types/vsgw.yaml
rename to xos/tosca/custom_types/vsgwc.yaml
index c4da998..bedc21f 100644
--- a/xos/tosca/custom_types/vsgw.yaml
+++ b/xos/tosca/custom_types/vsgwc.yaml
@@ -1,6 +1,6 @@
 tosca_definitions_version: tosca_simple_yaml_1_0
 
-# compile this with "m4 vbbu.m4 > vsgw.yaml"
+# compile this with "m4 vsgwc.m4 > vsgwc.yaml"
 
 # include macros
 # Note: Tosca derived_from isn't working the way I think it should, it's not
@@ -21,10 +21,10 @@
 
 
 node_types:
-    tosca.nodes.VSGWService:
+    tosca.nodes.VSGWCService:
         derived_from: tosca.nodes.Root
         description: >
-            VSGW Service
+            VSGWC Service
         capabilities:
             scalable:
                 type: tosca.capabilities.Scalable
@@ -79,10 +79,10 @@
                 required: false
                 description: Version number of Service.
 
-    tosca.nodes.VSGWTenant:
+    tosca.nodes.VSGWCTenant:
         derived_from: tosca.nodes.Root
         description: >
-            VSGW Tenant
+            VSGWC Tenant
         properties:
             kind:
                 type: string
diff --git a/xos/tosca/resources/vsgwcservice.py b/xos/tosca/resources/vsgwcservice.py
new file mode 100644
index 0000000..5eb211d
--- /dev/null
+++ b/xos/tosca/resources/vsgwcservice.py
@@ -0,0 +1,9 @@
+# from services.vsgwc.models import VSGWService
+from service import XOSService
+from services.vsgwc.models import VSGWCService
+
+class XOSVSGWCService(XOSService):
+    provides = "tosca.nodes.VSGWCService"
+    xos_model = VSGWCService
+    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "private_key_fn", "versionNumber"]
+
diff --git a/xos/tosca/resources/vsgwtenant.py b/xos/tosca/resources/vsgwctenant.py
similarity index 62%
rename from xos/tosca/resources/vsgwtenant.py
rename to xos/tosca/resources/vsgwctenant.py
index 5f6c3bb..6b1d46c 100644
--- a/xos/tosca/resources/vsgwtenant.py
+++ b/xos/tosca/resources/vsgwctenant.py
@@ -1,15 +1,15 @@
 from xosresource import XOSResource
 from core.models import Service, Tenant
-from services.vsgw.models import VSGWTenant
+from services.vsgwc.models import VSGWCTenant
 
-class XOSVSGWTenant(XOSResource):
-    provides = "tosca.nodes.VSGWTenant"
-    xos_model = VSGWTenant
+class XOSVSGWCTenant(XOSResource):
+    provides = "tosca.nodes.VSGWCTenant"
+    xos_model = VSGWCTenant
     name_field = "service_specific_id"
     copyin_props = ("tenant_message",)
 
     def get_xos_args(self, throw_exception=True):
-        args = super(XOSVSGWTenant, self).get_xos_args()
+        args = super(XOSVSGWCTenant, self).get_xos_args()
 
         # ExampleTenant must always have a provider_service
         provider_name = self.get_requirement("tosca.relationships.TenantOfService", throw_exception=throw_exception)
@@ -20,9 +20,9 @@
 
     def get_existing_objs(self):
         args = self.get_xos_args(throw_exception=False)
-        return VSGWTenant.get_tenant_objects().filter(provider_service=args["provider_service"], service_specific_id=args["service_specific_id"])
+        return VSGWCTenant.get_tenant_objects().filter(provider_service=args["provider_service"], service_specific_id=args["service_specific_id"])
         return []
 
     def can_delete(self, obj):
-        return super(XOSVSGWTenant, self).can_delete(obj)
+        return super(XOSVSGWCTenant, self).can_delete(obj)
 
diff --git a/xos/tosca/resources/vsgwservice.py b/xos/tosca/resources/vsgwservice.py
deleted file mode 100644
index 3826425..0000000
--- a/xos/tosca/resources/vsgwservice.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# from services.vsgw.models import VSGWService
-from service import XOSService
-from services.vsgw.models import VSGWService
-
-class XOSVSGWService(XOSService):
-    provides = "tosca.nodes.VSGWService"
-    xos_model = VSGWService
-    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "private_key_fn", "versionNumber"]
-
diff --git a/xos/vsgw.xproto b/xos/vsgw.xproto
deleted file mode 100644
index cefcc3a..0000000
--- a/xos/vsgw.xproto
+++ /dev/null
@@ -1,16 +0,0 @@
-option name = "vSGW";
-option verbose_name = "Virtual Serving Gateway";
-option app_label = "vsgw";
-option kind = "vEPC";
-option legacy = "True";
-
-message VSGWService (Service){
-    option name = "VSGWService";
-    option verbose_name = "Virtual Serving Gateway Service";
-}
-
-message VSGWTenant (TenantWithContainer){
-     option name = "VSGWTenant";
-     option verbose_name = "Virtual Serving Gateway Tenant";
-     required string tenant_message = 1 [help_text = "Tenant Message to Display", max_length = 254, null = False, db_index = False, blank = False];
-}
diff --git a/xos/vsgw-onboard.yaml b/xos/vsgwc-onboard.yaml
similarity index 60%
rename from xos/vsgw-onboard.yaml
rename to xos/vsgwc-onboard.yaml
index 549a6fc..fb01bf6 100644
--- a/xos/vsgw-onboard.yaml
+++ b/xos/vsgwc-onboard.yaml
@@ -1,23 +1,23 @@
 tosca_definitions_version: tosca_simple_yaml_1_0
 
-description: Onboard the vsgw
+description: Onboard the vsgwc
 
 imports:
    - custom_types/xos.yaml
 
 topology_template:
   node_templates:
-    servicecontroller#vsgw:
+    servicecontroller#vsgwc:
       type: tosca.nodes.ServiceController
       properties:
-          base_url: file:///opt/xos_services/vsgw/xos/
+          base_url: file:///opt/xos_services/vsgwc/xos/
           # The following will concatenate with base_url automatically, if
           # base_url is non-null.
           xproto: ./
           synchronizer: synchronizer/manifest
-          synchronizer_run: vsgw-synchronizer.py
-          tosca_custom_types: tosca/custom_types/vsgw.yaml
-          tosca_resource: tosca/resources/vsgwtenant.py, tosca/resources/vsgwservice.py
+          synchronizer_run: vsgwc-synchronizer.py
+          tosca_custom_types: tosca/custom_types/vsgwc.yaml
+          tosca_resource: tosca/resources/vsgwctenant.py, tosca/resources/vsgwcservice.py
           private_key: file:///opt/xos/key_import/mcord_rsa
           public_key: file:///opt/xos/key_import/mcord_rsa.pub
 
diff --git a/xos/vsgwc.xproto b/xos/vsgwc.xproto
new file mode 100644
index 0000000..b84985e
--- /dev/null
+++ b/xos/vsgwc.xproto
@@ -0,0 +1,16 @@
+option name = "vSGWC";
+option verbose_name = "Virtual Serving Gateway Control Plane";
+option app_label = "vsgwc";
+option kind = "vEPC";
+option legacy = "True";
+
+message VSGWCService (Service){
+    option name = "VSGWCService";
+    option verbose_name = "Virtual Serving Gateway Control Plane Service";
+}
+
+message VSGWCTenant (TenantWithContainer){
+     option name = "VSGWCTenant";
+     option verbose_name = "Virtual Serving Gateway Control Plane Tenant";
+     required string tenant_message = 1 [help_text = "Tenant Message to Display", max_length = 254, null = False, db_index = False, blank = False];
+}