Refactor vsgw from cord-2.0 to cord-3.0

Change-Id: Ib01e0cf23be3d5bff5fbf730fc758412b2ee1c11
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
new file mode 100644
index 0000000..f6607ac
--- /dev/null
+++ b/xos/synchronizer/Dockerfile.synchronizer
@@ -0,0 +1,39 @@
+# xosproject/vsgw-synchronizer
+FROM xosproject/xos-synchronizer-base:candidate
+
+COPY . /opt/xos/synchronizers/vsgw
+
+ENTRYPOINT []
+
+WORKDIR "/opt/xos/synchronizers/vsgw"
+
+# Label image
+ARG org_label_schema_schema_version=1.0
+ARG org_label_schema_name=vsgw-synchronizer
+ARG org_label_schema_version=unknown
+ARG org_label_schema_vcs_url=unknown
+ARG org_label_schema_vcs_ref=unknown
+ARG org_label_schema_build_date=unknown
+ARG org_opencord_vcs_commit_date=unknown
+ARG org_opencord_component_chameleon_version=unknown
+ARG org_opencord_component_chameleon_vcs_url=unknown
+ARG org_opencord_component_chameleon_vcs_ref=unknown
+ARG org_opencord_component_xos_version=unknown
+ARG org_opencord_component_xos_vcs_url=unknown
+ARG org_opencord_component_xos_vcs_ref=unknown
+
+LABEL org.label-schema.schema-version=$org_label_schema_schema_version \
+      org.label-schema.name=$org_label_schema_name \
+      org.label-schema.version=$org_label_schema_version \
+      org.label-schema.vcs-url=$org_label_schema_vcs_url \
+      org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
+      org.label-schema.build-date=$org_label_schema_build_date \
+      org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
+      org.opencord.component.chameleon.version=$org_opencord_component_chameleon_version \
+      org.opencord.component.chameleon.vcs-url=$org_opencord_component_chameleon_vcs_url \
+      org.opencord.component.chameleon.vcs-ref=$org_opencord_component_chameleon_vcs_ref \
+      org.opencord.component.xos.version=$org_opencord_component_xos_version \
+      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
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
new file mode 100644
index 0000000..5cb8831
--- /dev/null
+++ b/xos/synchronizer/run-from-api.sh
@@ -0,0 +1 @@
+python vsgw-synchronizer.py
\ No newline at end of file
diff --git a/xos/synchronizer/steps/sync_vsgw.py b/xos/synchronizer/steps/sync_vsgw.py
index 375c3a1..552bdc1 100644
--- a/xos/synchronizer/steps/sync_vsgw.py
+++ b/xos/synchronizer/steps/sync_vsgw.py
@@ -1,8 +1,9 @@
 import os
 import sys
 from django.db.models import Q, F
-from services.vsgw.models import VSGWService, VSGWTenant
-from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+# from services.vsgw.models import VSGWService, VSGWTenant
+from synchronizers.new_base.modelaccessor import *
+from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
 
 parentdir = os.path.join(os.path.dirname(__file__), "..")
 sys.path.insert(0, parentdir)
diff --git a/xos/synchronizer/vsgw-synchronizer.py b/xos/synchronizer/vsgw-synchronizer.py
index 90d2c98..aafdb44 100644
--- a/xos/synchronizer/vsgw-synchronizer.py
+++ b/xos/synchronizer/vsgw-synchronizer.py
@@ -7,7 +7,7 @@
 import sys
 
 synchronizer_path = os.path.join(os.path.dirname(
-    os.path.realpath(__file__)), "../../synchronizers/base")
+    os.path.realpath(__file__)), "../../synchronizers/new_base")
 sys.path.append(synchronizer_path)
 mod = importlib.import_module("xos-synchronizer")
 mod.main()
diff --git a/xos/synchronizer/vsgw_from_api_config b/xos/synchronizer/vsgw_from_api_config
new file mode 100644
index 0000000..2fbd561
--- /dev/null
+++ b/xos/synchronizer/vsgw_from_api_config
@@ -0,0 +1,9 @@
+# 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
+accessor:
+  username: xosadmin@opencord.org
+  password: "@/opt/xos/services/vmme/credentials/xosadmin@opencord.org"
\ No newline at end of file
diff --git a/xos/vSGW-onboard.yaml b/xos/vsgw-onboard.yaml
similarity index 78%
rename from xos/vSGW-onboard.yaml
rename to xos/vsgw-onboard.yaml
index 01d8786..4354f8d 100644
--- a/xos/vSGW-onboard.yaml
+++ b/xos/vsgw-onboard.yaml
@@ -1,6 +1,6 @@
 tosca_definitions_version: tosca_simple_yaml_1_0
 
-description: Onboard the vSGW
+description: Onboard the vsgw
 
 imports:
    - custom_types/xos.yaml
@@ -10,7 +10,7 @@
     servicecontroller#vsgw:
       type: tosca.nodes.ServiceController
       properties:
-          base_url: file:///opt/xos_services/vSGW/xos/
+          base_url: file:///opt/xos_services/vsgw/xos/
           # The following will concatenate with base_url automatically, if
           # base_url is non-null.
           models: models.py
@@ -22,6 +22,6 @@
           tosca_resource: tosca/resources/vsgwtenant.py, tosca/resources/vsgwservice.py
           #rest_service: api/service/vsgwservice.py
           #rest_tenant: api/tenant/vsgwtenant.py
-          private_key: file:///opt/xos/key_import/vSGW_rsa
-          public_key: file:///opt/xos/key_import/vSGW_rsa.pub
+          private_key: file:///opt/xos/key_import/mcord_rsa
+          public_key: file:///opt/xos/key_import/mcord_rsa.pub