X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fengine.py;fp=osm_nbi%2Fengine.py;h=3f83557453b7e79db5e088b9fef3f6e2a27e201d;hp=5bdbb7e021a23b0be5bd7b106bfde7af84de3afe;hb=bee3bad8d15fe0893855d0dff92cef4351629edb;hpb=35c998bd4ba1218c67b7c89f709b63f5268ed83c diff --git a/osm_nbi/engine.py b/osm_nbi/engine.py index 5bdbb7e..3f83557 100644 --- a/osm_nbi/engine.py +++ b/osm_nbi/engine.py @@ -264,18 +264,21 @@ class Engine(object): with self.write_lock: return self.map_topic[topic].delete_list(session, _filter) - def del_item(self, session, topic, _id): + def del_item(self, session, topic, _id, not_send_msg=None): """ Delete item by its internal id :param session: contains the used login username and working project :param topic: it can be: users, projects, vnfds, nsds, ... :param _id: server id of the item + :param not_send_msg: If False, message will not be sent to kafka. + If a list, message is not sent, but content is stored in this variable so that the caller can send this + message using its own loop. If None, message is sent :return: dictionary with deleted item _id. It raises exception if not found. """ if topic not in self.map_topic: raise EngineException("Unknown topic {}!!!".format(topic), HTTPStatus.INTERNAL_SERVER_ERROR) with self.write_lock: - return self.map_topic[topic].delete(session, _id) + return self.map_topic[topic].delete(session, _id, not_send_msg=not_send_msg) def edit_item(self, session, topic, _id, indata=None, kwargs=None): """