Initial implementation of vEE service
Change-Id: I774d7266220163cf2afd00cfc2161b04aec32d1e
diff --git a/xos/synchronizer/manifest b/xos/synchronizer/manifest
new file mode 100644
index 0000000..821e76b
--- /dev/null
+++ b/xos/synchronizer/manifest
@@ -0,0 +1,7 @@
+manifest
+vee_synchronizer_config
+start.sh
+stop.sh
+model-deps
+run.sh
+vee-synchronizer.py
diff --git a/xos/synchronizer/model-deps b/xos/synchronizer/model-deps
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/xos/synchronizer/model-deps
@@ -0,0 +1 @@
+{}
diff --git a/xos/synchronizer/run.sh b/xos/synchronizer/run.sh
new file mode 100755
index 0000000..808590b
--- /dev/null
+++ b/xos/synchronizer/run.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+python vee-synchronizer.py -C $XOS_DIR/synchronizers/vee/vee_synchronizer_config
diff --git a/xos/synchronizer/start.sh b/xos/synchronizer/start.sh
new file mode 100755
index 0000000..c33b48a
--- /dev/null
+++ b/xos/synchronizer/start.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+nohup python vee-synchronizer.py -C $XOS_DIR/synchronizers/vee/vee_synchronizer_config > /dev/null 2>&1 &
diff --git a/xos/synchronizer/steps/sync_host.yaml b/xos/synchronizer/steps/sync_host.yaml
new file mode 100644
index 0000000..0484675
--- /dev/null
+++ b/xos/synchronizer/steps/sync_host.yaml
@@ -0,0 +1,13 @@
+---
+- hosts: 127.0.0.1
+ connection: local
+
+ tasks:
+ - name: Add host entry for fabric
+ uri:
+ url: http://{{ rest_hostname }}:{{ rest_port }}/{{ rest_endpoint }}
+ method: POST
+ user: onos
+ password: rocks
+ body: '{{ rest_body }}'
+ body_format: json
\ No newline at end of file
diff --git a/xos/synchronizer/steps/sync_vee.py b/xos/synchronizer/steps/sync_vee.py
new file mode 100644
index 0000000..c9182fe
--- /dev/null
+++ b/xos/synchronizer/steps/sync_vee.py
@@ -0,0 +1,26 @@
+from synchronizers.base.syncstep import *
+from synchronizers.base.ansible_helper import *
+from services.vee.models import VEEService
+
+class SyncVEEService(SyncStep):
+ provides=[VRouterTenant]
+ observes = VEEService
+ requested_interval=30
+ playbook='sync_host.yaml'
+
+ def get_vee_onos_service(self):
+ return None
+
+ def get_node_tag(self, node, tagname):
+ return None
+
+ def fetch_pending(self, deleted):
+
+ return []
+
+ def map_sync_inputs(self, vroutertenant):
+
+ return []
+
+ def map_sync_outputs(self, controller_image, res):
+ pass
diff --git a/xos/synchronizer/stop.sh b/xos/synchronizer/stop.sh
new file mode 100755
index 0000000..6823b10
--- /dev/null
+++ b/xos/synchronizer/stop.sh
@@ -0,0 +1 @@
+pkill -9 -f vee-synchronizer.py
diff --git a/xos/synchronizer/vee-synchronizer.py b/xos/synchronizer/vee-synchronizer.py
new file mode 100644
index 0000000..84bec4f
--- /dev/null
+++ b/xos/synchronizer/vee-synchronizer.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+# This imports and runs ../../xos-observer.py
+
+import importlib
+import os
+import sys
+observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/base")
+sys.path.append(observer_path)
+mod = importlib.import_module("xos-synchronizer")
+mod.main()
diff --git a/xos/synchronizer/vee_synchronizer_config b/xos/synchronizer/vee_synchronizer_config
new file mode 100644
index 0000000..82e3b97
--- /dev/null
+++ b/xos/synchronizer/vee_synchronizer_config
@@ -0,0 +1,23 @@
+# Required by XOS
+[db]
+name=xos
+user=postgres
+password=password
+host=xos_db
+port=5432
+
+# Required by XOS
+[api]
+nova_enabled=True
+
+# Sets options for the synchronizer
+[observer]
+name=vee
+dependency_graph=/opt/xos/synchronizers/vee/model-deps
+steps_dir=/opt/xos/synchronizers/vee/steps
+sys_dir=/opt/xos/synchronizers/vee/sys
+logfile=console
+pretend=False
+backoff_disabled=True
+save_ansible_output=True
+proxy_ssh=False