X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fservice%2Fauditor%2Fpserver_handler.py;h=f8ad40cf73eb997bcc8abf0853f74c736894b502;hb=8d6c2f135ee103b9a94ea6c29986a608069b6982;hp=1ab1189ea9691eb0cd2811094ba026a524579712;hpb=46d810e671d23449e36f1c5d78e5e725ff06a7ac;p=pti%2Fo2.git diff --git a/o2ims/service/auditor/pserver_handler.py b/o2ims/service/auditor/pserver_handler.py index 1ab1189..f8ad40c 100644 --- a/o2ims/service/auditor/pserver_handler.py +++ b/o2ims/service/auditor/pserver_handler.py @@ -67,6 +67,10 @@ def update_pserver( alarm_dictionary = uow.alarm_dictionaries.get(dict_id) if alarm_dictionary: res_type.alarmDictionary = alarm_dictionary + res_type.events.append(events.ResourceTypeChanged( + id=res_type.resourceTypeId, + notificationEventType=NotificationEventEnum.CREATE, + updatetime=stxobj.updatetime)) uow.resource_types.add(res_type) else: resourcetype_id = first['resourceTypeId'] @@ -116,7 +120,7 @@ def create_by(stxobj: StxGenericModel, parentid: str, resourcetype_id: str) \ "operational", "availability", "administrative", "boot_device", "rootfs_device", "install_state", "subfunctions", "clock_synchronization", "max_cpu_mhz_allowed" - ] + ] filtered = dict( filter(lambda item: item[0] in selected_keys, content.items())) extensions = json.dumps(filtered) @@ -128,6 +132,13 @@ def create_by(stxobj: StxGenericModel, parentid: str, resourcetype_id: str) \ resource.updatetime = stxobj.updatetime resource.hash = stxobj.hash + resource.events.append(events.ResourceChanged( + id=stxobj.id, + resourcePoolId=resource.resourcePoolId, + notificationEventType=NotificationEventEnum.CREATE, + updatetime=stxobj.updatetime + )) + return resource