X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2app%2Fservice%2Fhandlers.py;h=ad75098159849b9dc81c661f768e80b084e9a081;hb=e0f9e545f020276f022ead2f00e36457e6bfc36c;hp=deef1a429bc581441e451b3434db5cf2eb3b4af2;hpb=3da89330f3837ac6cffd2cad4c4018c9f8c3327d;p=pti%2Fo2.git diff --git a/o2app/service/handlers.py b/o2app/service/handlers.py index deef1a4..ad75098 100644 --- a/o2app/service/handlers.py +++ b/o2app/service/handlers.py @@ -17,7 +17,7 @@ from __future__ import annotations from o2dms.service import nfdeployment_handler # from dataclasses import asdict -from typing import List, Dict, Callable, Type +from typing import Dict, Callable, Type # TYPE_CHECKING from o2ims.domain import commands, events @@ -26,10 +26,12 @@ from o2dms.domain import events as o2dms_events from o2ims.service.auditor import ocloud_handler, dms_handler, \ resourcepool_handler, pserver_handler, pserver_cpu_handler, \ pserver_mem_handler, pserver_port_handler, pserver_if_handler,\ - pserver_eth_handler -from o2ims.service.command import notify_handler, registration_handler + pserver_eth_handler, pserver_acc_handler, alarm_handler, \ + pserver_dev_handler +from o2ims.service.command import notify_handler, registration_handler,\ + notify_alarm_handler from o2ims.service.event import ocloud_event, resource_event, \ - resource_pool_event, registration_event + resource_pool_event, alarm_event # if TYPE_CHECKING: # from . import unit_of_work @@ -55,14 +57,15 @@ EVENT_HANDLERS = { events.ResourceChanged: [resource_event.notify_resource_change], events.ResourcePoolChanged: [resource_pool_event.\ notify_resourcepool_change], - events.RegistrationChanged: [registration_event.\ - notify_registration_change], + events.AlarmEventChanged: [alarm_event.\ + notify_alarm_event_change], } # type: Dict[Type[events.Event], Callable] COMMAND_HANDLERS = { commands.UpdateOCloud: ocloud_handler.update_ocloud, commands.UpdateDms: dms_handler.update_dms, + commands.UpdateAlarm: alarm_handler.update_alarm, commands.UpdateResourcePool: resourcepool_handler.update_resourcepool, commands.UpdatePserver: pserver_handler.update_pserver, commands.UpdatePserverCpu: pserver_cpu_handler.update_pserver_cpu, @@ -70,6 +73,8 @@ COMMAND_HANDLERS = { commands.UpdatePserverIf: pserver_if_handler.update_pserver_if, commands.UpdatePserverIfPort: pserver_port_handler.update_pserver_port, commands.UpdatePserverEth: pserver_eth_handler.update_pserver_eth, + commands.UpdatePserverDev: pserver_dev_handler.update_pserver_dev, + commands.UpdatePserverAcc: pserver_acc_handler.update_pserver_acc, o2dms_cmmands.HandleNfDeploymentStateChanged: nfdeployment_handler.handle_nfdeployment_statechanged, o2dms_cmmands.InstallNfDeployment: @@ -79,5 +84,6 @@ COMMAND_HANDLERS = { o2dms_cmmands.DeleteNfDeployment: nfdeployment_handler.delete_nfdeployment, commands.PubMessage2SMO: notify_handler.notify_change_to_smo, + commands.PubAlarm2SMO: notify_alarm_handler.notify_alarm_to_smo, commands.Register2SMO: registration_handler.registry_to_smo, } # type: Dict[Type[commands.Command], Callable]