CORD-2476 Migrate VTN to dynamic load

Change-Id: I4e7b9b9df66a33e3d375ffdc6b5f85cd38e788f3
diff --git a/xos/attic/header.py b/xos/attic/header.py
deleted file mode 100644
index 803d477..0000000
--- a/xos/attic/header.py
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from django.db import models
-from django.db.models import *
-from core.models import Service
-from core.models.xosbase import StrippedCharField
-import os
-from django.db import models, transaction
-from django.forms.models import model_to_dict
-import traceback
-from xos.exceptions import *
-
-class ConfigurationError(Exception):
-    pass
-
-VTN_KIND = "VTN"
diff --git a/xos/header.py b/xos/header.py
deleted file mode 100644
index 803d477..0000000
--- a/xos/header.py
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from django.db import models
-from django.db.models import *
-from core.models import Service
-from core.models.xosbase import StrippedCharField
-import os
-from django.db import models, transaction
-from django.forms.models import model_to_dict
-import traceback
-from xos.exceptions import *
-
-class ConfigurationError(Exception):
-    pass
-
-VTN_KIND = "VTN"
diff --git a/xos/vtn.xproto b/xos/synchronizer/models/vtn.xproto
similarity index 100%
rename from xos/vtn.xproto
rename to xos/synchronizer/models/vtn.xproto
diff --git a/xos/synchronizer/vtn_config.yaml b/xos/synchronizer/vtn_config.yaml
index 5a799de..490b79e 100644
--- a/xos/synchronizer/vtn_config.yaml
+++ b/xos/synchronizer/vtn_config.yaml
@@ -14,10 +14,21 @@
 # limitations under the License.
 
 
-name: vtn-synchronizer
+name: vtn
 accessor:
   username: xosadmin@opencord.org
   password: "@/opt/xos/services/vtn/credentials/xosadmin@opencord.org"
+required_models:
+  - AddressPool
+  - Controller
+  - Network
+  - Node
+  - Port
+  - Service
+  - ServiceInstance
+  - Tag
+  - VTNService
 dependency_graph: "/opt/xos/synchronizers/vtn/model-deps"
 steps_dir: "/opt/xos/synchronizers/vtn/steps"
-sys_dir: "/opt/xos/synchronizers/vtn/sys"
\ No newline at end of file
+sys_dir: "/opt/xos/synchronizers/vtn/sys"
+models_dir: "/opt/xos/synchronizers/vtn/models"
diff --git a/xos/templates/vtnadmin.html b/xos/templates/vtnadmin.html
deleted file mode 100644
index d9a5d75..0000000
--- a/xos/templates/vtnadmin.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-<!--
-Copyright 2017-present Open Networking Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-
-<div class = "row text-center">
-    <div class="col-xs-12">
-        <a href="/admin/vtn/vnrtenant/">vTN Tenants</a>
-    </div>
-</div>
diff --git a/xos/tosca/resources/vtnservice.py b/xos/tosca/resources/vtnservice.py
deleted file mode 100644
index 7c57f09..0000000
--- a/xos/tosca/resources/vtnservice.py
+++ /dev/null
@@ -1,23 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from services.vtn.models import VTNService
-from service import XOSService
-
-class XOSVTNService(XOSService):
-    provides = "tosca.nodes.VTNService"
-    xos_model = VTNService
-    copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "versionNumber", 'privateGatewayMac', 'localManagementIp', 'ovsdbPort', 'sshPort', 'sshUser', 'sshKeyFile', 'mgmtSubnetBits', 'xosEndpoint', 'xosUser', 'xosPassword', 'vtnAPIVersion', 'controllerPort']
diff --git a/xos/vtn-onboard.yaml b/xos/vtn-onboard.yaml
index c4d8a56..bc9b48e 100644
--- a/xos/vtn-onboard.yaml
+++ b/xos/vtn-onboard.yaml
@@ -29,9 +29,5 @@
           base_url: file:///opt/xos_services/vtn-service/xos/
           # The following will concatenate with base_url automatically, if
           # base_url is non-null.
-          xproto: ./
-          admin_template: templates/vtnadmin.html
-          tosca_resource: tosca/resources/vtnservice.py
-          #private_key: file:///opt/xos/key_import/vsg_rsa
-          #public_key: file:///opt/xos/key_import/vsg_rsa.pub
+