Merge "Add Accelerator resource watcher; fix bug of the alarm dictionary"
[pti/o2.git] / o2app / entrypoints / resource_watcher.py
index 98145dc..909e86c 100644 (file)
@@ -21,9 +21,12 @@ from o2common.service.watcher.worker import PollWorker
 from o2ims.service.watcher.ocloud_watcher import OcloudWatcher
 from o2ims.service.watcher.ocloud_watcher import DmsWatcher
 from o2ims.service.watcher.resourcepool_watcher import ResourcePoolWatcher
+from o2ims.service.watcher.alarm_watcher import AlarmWatcher
+
 from o2ims.adapter.clients.ocloud_client import StxDmsClient
 from o2ims.adapter.clients.ocloud_client import StxOcloudClient
 from o2ims.adapter.clients.ocloud_client import StxResourcePoolClient
+from o2ims.adapter.clients.fault_client import StxAlarmClient
 
 from o2ims.service.watcher.pserver_watcher import PServerWatcher
 from o2ims.adapter.clients.ocloud_client import StxPserverClient
@@ -37,12 +40,17 @@ from o2ims.adapter.clients.ocloud_client import StxMemClient
 from o2ims.service.watcher.pserver_if_watcher import PServerIfWatcher
 from o2ims.adapter.clients.ocloud_client import StxIfClient
 
-from o2ims.service.watcher.pserver_port_watcher import PServerIfPortWatcher
-from o2ims.adapter.clients.ocloud_client import StxIfPortClient
+from o2ims.service.watcher.pserver_port_watcher import PServerIfPortWatcher
+from o2ims.adapter.clients.ocloud_client import StxIfPortClient
 
 from o2ims.service.watcher.pserver_eth_watcher import PServerEthWatcher
 from o2ims.adapter.clients.ocloud_client import StxEthClient
 
+# from o2ims.service.watcher.pserver_dev_watcher import PServerDevWatcher
+# from o2ims.adapter.clients.ocloud_client import StxDevClient
+from o2ims.service.watcher.pserver_acc_watcher import PServerAccWatcher
+from o2ims.adapter.clients.ocloud_client import StxAccClient
+
 from o2common.helper import o2logging
 logger = o2logging.get_logger(__name__)
 
@@ -62,6 +70,8 @@ class WatcherService(cotyledon.Service):
                 StxOcloudClient(), self.bus))
             root.addchild(
                 DmsWatcher(StxDmsClient(), self.bus))
+            # root.addchild(
+            #     AlarmWatcher(StxFaultClient(), self.bus))
 
             child_respool = root.addchild(
                 ResourcePoolWatcher(StxResourcePoolClient(),
@@ -74,11 +84,20 @@ class WatcherService(cotyledon.Service):
                 PServerMemWatcher(StxMemClient(), self.bus))
             child_pserver.addchild(
                 PServerEthWatcher(StxEthClient(), self.bus))
-            child_if = child_pserver.addchild(
+            child_pserver.addchild(
                 PServerIfWatcher(StxIfClient(), self.bus))
             # child_if.addchild(
             #     PServerIfPortWatcher(StxIfPortClient(), self.bus))
+            # child_pserver.addchild(
+            #     PServerDevWatcher(StxDevClient(), self.bus))
+            child_pserver.addchild(
+                PServerAccWatcher(StxAccClient(), self.bus))
+
+            self.worker.add_watcher(root)
 
+            # Add Alarm watch
+            root = WatcherTree(
+                AlarmWatcher(StxAlarmClient(self.bus.uow), self.bus))
             self.worker.add_watcher(root)
 
             self.worker.start()