X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fservice%2Fauditor%2Focloud_handler.py;h=d1e2fa77714735123eb2adfa9cd22d890cdda4e3;hb=a9840e41848cbbffcedf76f0a53ffc5d9bc87c01;hp=7548d58596904f5d7fbaf2c684afd677c79084df;hpb=3da89330f3837ac6cffd2cad4c4018c9f8c3327d;p=pti%2Fo2.git diff --git a/o2ims/service/auditor/ocloud_handler.py b/o2ims/service/auditor/ocloud_handler.py index 7548d58..d1e2fa7 100644 --- a/o2ims/service/auditor/ocloud_handler.py +++ b/o2ims/service/auditor/ocloud_handler.py @@ -20,7 +20,7 @@ from __future__ import annotations # from typing import List, Dict, Callable, Type # TYPE_CHECKING -from o2common.config import config +from o2common.config import config, conf # from o2common.service.messagebus import MessageBus from o2common.service.unit_of_work import AbstractUnitOfWork from o2ims.domain import events, commands @@ -81,14 +81,19 @@ def is_outdated(ocloud: Ocloud, stxobj: StxGenericModel): def create_by(stxobj: StxGenericModel) -> Ocloud: - imsendpoint = config.get_api_url() + config.get_o2ims_api_base() - globalcloudId = stxobj.id # to be updated + imsendpoint = config.get_api_url() + config.get_o2ims_api_base() + '/' + globalcloudId = conf.DEFAULT.ocloud_global_id description = "An ocloud" ocloud = Ocloud(stxobj.id, stxobj.name, imsendpoint, globalcloudId, description, 1) ocloud.createtime = stxobj.createtime ocloud.updatetime = stxobj.updatetime ocloud.hash = stxobj.hash + ocloud.events.append(events.OcloudChanged( + id=stxobj.id, + notificationEventType=NotificationEventEnum.CREATE, + updatetime=stxobj.updatetime + )) return ocloud