CORD-1289 event step demo

Change-Id: If0730e95be34658a0c3e1618568c5d06165e15e1
diff --git a/xos/synchronizer/event_steps/simpleexampleevent.py b/xos/synchronizer/event_steps/simpleexampleevent.py
new file mode 100644
index 0000000..a0b1ec4
--- /dev/null
+++ b/xos/synchronizer/event_steps/simpleexampleevent.py
@@ -0,0 +1,45 @@
+
+# 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.
+
+
+import json
+import os
+import sys
+from synchronizers.new_base.eventstep import EventStep
+from synchronizers.new_base.modelaccessor import *
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
+
+class SimpleExampleEventStep(EventStep):
+    topics = ["SimpleExampleEvent"]
+    technology = "kafka"
+
+    def __init__(self, *args, **kwargs):
+        super(SimpleExampleEventStep, self).__init__(*args, **kwargs)
+
+    def process_event(self, event):
+        value = json.loads(event.value)
+        service_instance_name = value["service_instance"]
+        tenant_message = value["tenant_message"]
+
+        objs = SimpleExampleServiceInstance.objects.filter(name=service_instance_name)
+        if not objs:
+            raise Exception("failed to find %s" % service_instance_name)
+
+        for obj in objs:
+            obj.tenant_message = tenant_message
+            obj.save(always_update_timestamp = True)
diff --git a/xos/synchronizer/simpleexampleservice_config.yaml b/xos/synchronizer/simpleexampleservice_config.yaml
index a43d5e4..9f80c69 100644
--- a/xos/synchronizer/simpleexampleservice_config.yaml
+++ b/xos/synchronizer/simpleexampleservice_config.yaml
@@ -30,6 +30,7 @@
   - KubernetesSecretVolumeMount
 dependency_graph: "/opt/xos/synchronizers/simpleexampleservice/model-deps"
 steps_dir: "/opt/xos/synchronizers/simpleexampleservice/steps"
+event_steps_dir: "/opt/xos/synchronizers/simpleexampleservice/event_steps"
 sys_dir: "/opt/xos/synchronizers/simpleexampleservice/sys"
 model_policies_dir: "/opt/xos/synchronizers/simpleexampleservice/model_policies"
 models_dir: "/opt/xos/synchronizers/simpleexampleservice/models"