CORD-2476 migrate vtr service to dynamic load

Change-Id: I77d8363f0d789e923d63ecf3295b6da209bf49c3
diff --git a/xos/synchronizer/models/attic/header.py b/xos/synchronizer/models/attic/header.py
new file mode 100644
index 0000000..1320bf7
--- /dev/null
+++ b/xos/synchronizer/models/attic/header.py
@@ -0,0 +1,34 @@
+
+# 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 core.models import Service, XOSBase, Slice, Instance, ServiceInstance, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
+from core.models.xosbase import StrippedCharField
+import os
+from django.db import models, transaction
+from django.forms.models import model_to_dict
+from django.db.models import *
+from operator import itemgetter, attrgetter, methodcaller
+import traceback
+from xos.exceptions import *
+from django.contrib.contenttypes.models import ContentType
+from django.contrib.contenttypes.fields import GenericForeignKey
+
+class ConfigurationError(Exception):
+    # FIXME log the error
+    pass
+
+VTR_KIND = "vTR"
diff --git a/xos/synchronizer/models/attic/vtrtenant_model.py b/xos/synchronizer/models/attic/vtrtenant_model.py
new file mode 100644
index 0000000..b64fc49
--- /dev/null
+++ b/xos/synchronizer/models/attic/vtrtenant_model.py
@@ -0,0 +1,27 @@
+
+# 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.
+
+
+sync_attributes = ( 'test', 'argument', "scope" )
+
+def __init__(self, *args, **kwargs):
+    vtr_services = VTRService.objects.all()
+    if vtr_services:
+        self._meta.get_field("owner").default = vtr_services[0].id
+    super(VTRTenant, self).__init__(*args, **kwargs)
+
+def delete(self, *args, **kwargs):
+    super(VTRTenant, self).delete(*args, **kwargs)
+
diff --git a/xos/synchronizer/models/vtr.xproto b/xos/synchronizer/models/vtr.xproto
new file mode 100644
index 0000000..8628e0f
--- /dev/null
+++ b/xos/synchronizer/models/vtr.xproto
@@ -0,0 +1,20 @@
+option kind="vTR";
+option app_label = "vtr";
+option name="vtr";
+
+message VTRTenant (ServiceInstance){
+    option verbose_name="Virtual Truck Roll Tenant";
+
+    required string test = 1 [choices = "(('ping', 'Ping'), ('traceroute', 'Trace Route'), ('tcpdump', 'Tcp Dump'), ('memory', 'Memory'), ('bandwidth', 'Bandwidth'))", max_length = 30, content_type = "stripped", blank = False, help_text = "type of test", null = False, db_index = False];
+    required string scope = 2 [choices = "(('container', 'Container'), ('vm', 'VM'))", max_length = 30, content_type = "stripped", blank = False, help_text = "scope of test", null = False, db_index = False];
+    optional string argument = 3 [db_index = False, max_length = 40, null = True, content_type = "stripped", blank = True];
+    optional string result = 4 [db_index = False, null = True, blank = True];
+    optional string result_code = 5 [db_index = False, max_length = 32, null = True, content_type = "stripped", blank = True];
+    required string target_type = 6 [max_length = 1024, content_type = "stripped", blank = False, help_text = "Target type id linked to this vtrtenant", null = False, db_index = False];
+    required uint32 target_id = 7 [db_index = False, null = False, blank = False];
+}
+
+
+message VTRService (Service){
+    option verbose_name="Virtual Truck Roll Service";
+}
diff --git a/xos/synchronizer/vtr_config.yaml b/xos/synchronizer/vtr_config.yaml
index fc95df3..e954487 100644
--- a/xos/synchronizer/vtr_config.yaml
+++ b/xos/synchronizer/vtr_config.yaml
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 
-name: vtr-synchronizer
+name: vtr
 accessor:
   username: xosadmin@opencord.org
   password: "@/opt/xos/services/vtr/credentials/xosadmin@opencord.org"
@@ -25,4 +25,5 @@
   - CordSubscriberRoot
 dependency_graph: "/opt/xos/synchronizers/vtr/model-deps"
 steps_dir: "/opt/xos/synchronizers/vtr/steps"
-sys_dir: "/opt/xos/synchronizers/vtr/sys"
\ No newline at end of file
+sys_dir: "/opt/xos/synchronizers/vtr/sys"
+models_dir: "/opt/xos/synchronizers/vtr/models"