Add the PATCH method for the monitoring API
[pti/o2.git] / o2app / entrypoints / redis_eventconsumer.py
index 439619b..db39daa 100644 (file)
 
 import redis
 import json
+
 from o2app import bootstrap
-from o2common.config import config
 from o2common.adapter.notifications import SmoNotifications
+from o2common.config import config
+from o2common.helper import o2logging
 from o2dms.domain import commands
 from o2ims.domain import commands as imscmd
 from o2ims.domain.subscription_obj import Message2SMO, RegistrationMessage
 from o2ims.domain.alarm_obj import AlarmEvent2SMO
 
-from o2common.helper import o2logging
 logger = o2logging.get_logger(__name__)
 
 r = redis.Redis(**config.get_redis_host_and_port())
@@ -143,11 +144,8 @@ def handle_changed(m, bus):
         datastr = m['data']
         data = json.loads(datastr)
         logger.info('AlarmEventPurged with cmd:{}'.format(data))
-        ref = api_monitoring_base + \
-            monitor_api_version + '/alarms/' + data['id']
         cmd = imscmd.PurgeAlarmEvent(data=AlarmEvent2SMO(
-            id=data['id'], ref=ref,
-            eventtype=data['notificationEventType'],
+            id=data['id'], eventtype=data['notificationEventType'],
             updatetime=data['updatetime']))
         bus.handle(cmd)
     else: