+ # Check for nslcm notification
+ if isinstance(params, dict):
+ # Check availability of operationState and command
+ if (not params.get("operationState")) or (not command) or (not params.get("operationParams")):
+ self.logger.debug("Message can not be used for notification of nslcm")
+ else:
+ nsd_id = params["operationParams"].get("nsdId")
+ ns_instance_id = params["operationParams"].get("nsInstanceId")
+ # Any one among nsd_id, ns_instance_id should be present.
+ if not (nsd_id or ns_instance_id):
+ self.logger.debug("Message can not be used for notification of nslcm")
+ else:
+ op_state = params["operationState"]
+ event_details = {"topic": topic, "command": command.upper(), "params": params}
+ subscribers = self.nslcm.get_subscribers(nsd_id, ns_instance_id, command.upper(), op_state,
+ event_details)
+ # self.logger.debug("subscribers list: ")
+ # self.logger.debug(subscribers)
+ if subscribers:
+ asyncio.ensure_future(self.nslcm.send_notifications(subscribers, loop=self.loop),
+ loop=self.loop)
+ else:
+ self.logger.debug("Message can not be used for notification of nslcm")