Adds initial observer for the hello world service
diff --git a/xos/observers/helloworldservice/helloworldservice-observer.py b/xos/observers/helloworldservice/helloworldservice-observer.py
new file mode 100755
index 0000000..d6a71ff
--- /dev/null
+++ b/xos/observers/helloworldservice/helloworldservice-observer.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__)),"../..")
+sys.path.append(observer_path)
+mod = importlib.import_module("xos-observer")
+mod.main()
diff --git a/xos/observers/helloworldservice/helloworldservice_config b/xos/observers/helloworldservice/helloworldservice_config
new file mode 100644
index 0000000..39dacbe
--- /dev/null
+++ b/xos/observers/helloworldservice/helloworldservice_config
@@ -0,0 +1,47 @@
+[plc]
+name=plc
+deployment=plc
+
+[db]
+name=xos
+user=postgres
+password=password
+host=localhost
+port=5432
+
+[api]
+host=localhost
+port=8000
+ssl_key=None
+ssl_cert=None
+ca_ssl_cert=None
+ratelimit_enabled=0
+omf_enabled=0
+mail_support_address=support@localhost
+nova_enabled=True
+logfile=/var/log/xos.log
+
+[nova]
+admin_user=admin@domain.com
+admin_password=admin
+admin_tenant=admin
+url=http://localhost:5000/v2.0/
+default_image=None
+default_flavor=m1.small
+default_security_group=default
+ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
+
+[observer]
+pretend=False
+backoff_disabled=False
+images_directory=/opt/xos/images
+dependency_graph=/opt/xos/model-deps
+logfile=/var/log/xos_backend.log
+steps_dir=/opt/xos/observers/helloworldservice/steps
+save_ansible_output=True
+
+[gui]
+disable_minidashboard=True
+#branding_name=CORD
+#branding_css=/static/cord.css
+#branding_icon=/static/onos-logo.png
diff --git a/xos/observers/helloworldservice/model-deps b/xos/observers/helloworldservice/model-deps
new file mode 100644
index 0000000..63188f0
--- /dev/null
+++ b/xos/observers/helloworldservice/model-deps
@@ -0,0 +1,19 @@
+{
+ "OriginServer": [
+ "ContentProvider"
+ ],
+ "ContentProvider": [
+ "ServiceProvider"
+ ],
+ "CDNPrefix": [
+ "ContentProvider"
+ ],
+ "AccessMap": [
+ "ContentProvider"
+ ],
+ "SiteMap": [
+ "ContentProvider",
+ "ServiceProvider",
+ "CDNPrefix"
+ ]
+}
diff --git a/xos/observers/helloworldservice/run.sh b/xos/observers/helloworldservice/run.sh
new file mode 100755
index 0000000..ad83332
--- /dev/null
+++ b/xos/observers/helloworldservice/run.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+python helloworldservice-observer.py -C $XOS_DIR/observers/helloworldservice/helloworldservice_observer_config
diff --git a/xos/observers/helloworldservice/start.sh b/xos/observers/helloworldservice/start.sh
new file mode 100755
index 0000000..ad83332
--- /dev/null
+++ b/xos/observers/helloworldservice/start.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+python helloworldservice-observer.py -C $XOS_DIR/observers/helloworldservice/helloworldservice_observer_config
diff --git a/xos/observers/helloworldservice/steps/sync_helloworldtenant.py b/xos/observers/helloworldservice/steps/sync_helloworldtenant.py
new file mode 100644
index 0000000..ff6253d
--- /dev/null
+++ b/xos/observers/helloworldservice/steps/sync_helloworldtenant.py
@@ -0,0 +1,26 @@
+import os
+import sys
+import base64
+from django.db.models import F, Q
+from xos.config import Config
+from observer.syncstep import SyncStep
+from helloworldservice.models import HelloWorldService,HelloWorldTenant
+from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+from util.logger import Logger, logging
+
+parentdir = os.path.join(os.path.dirname(__file__),"..")
+sys.path.insert(0,parentdir)
+
+logger = Logger(level=logging.INFO)
+
+class SyncHelloWorldServiceTenant(SyncStep):
+ provides=[HelloWorldTenant]
+ observes=HelloWorldTenant
+ requested_interval=1
+
+ def sync_record(self, record):
+ logger.info("Syncing helloworldtenant");
+ open('log','w').write(record.name)
+
+ def delete_record(self, m):
+ return
diff --git a/xos/observers/helloworldservice/stop.sh b/xos/observers/helloworldservice/stop.sh
new file mode 100755
index 0000000..8a6f727
--- /dev/null
+++ b/xos/observers/helloworldservice/stop.sh
@@ -0,0 +1 @@
+pkill -9 -f helloworldservice-observer.py