X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_nbi%2Fnotifications.py;h=22413d0b4f97a5481e2dd415242bddf7770a4e78;hb=refs%2Fchanges%2F93%2F13993%2F3;hp=63d4ce832f61e21066c30159579efe1eddc5cf45;hpb=375aeb2647d733ac894b2408f66d36d55217c92d;p=osm%2FNBI.git diff --git a/osm_nbi/notifications.py b/osm_nbi/notifications.py index 63d4ce83..22413d0b 100644 --- a/osm_nbi/notifications.py +++ b/osm_nbi/notifications.py @@ -235,6 +235,14 @@ class NotificationBase: class NsLcmNotification(NotificationBase): + # maps kafka commands of completed operations to the original operation type + completed_operation_map = { + "INSTANTIATED": "INSTANTIATE", + "SCALED": "SCALE", + "TERMINATED": "TERMINATE", + "UPDATED": "UPDATE", + "HEALED": "HEAL", + } # SOL005 response model for nslcm notifications response_models = { "NsLcmOperationOccurrenceNotification": { @@ -358,7 +366,8 @@ class NsLcmNotification(NotificationBase): if op_state: filter_q["operationStates"].append(op_state) if command: - filter_q["operationTypes"].append(command) + op_type = self.completed_operation_map.get(command, command) + filter_q["operationTypes"].append(op_type) # self.logger.debug("Db query is: {}".format(filter_q)) subscribers = [] try: