with self.write_lock:
return self.map_topic[topic].edit(session, _id, indata, kwargs)
+ def cancel_item(
+ self, rollback, session, topic, indata=None, kwargs=None, headers=None
+ ):
+ """
+ Cancels an item
+ :param rollback: list to append created items at database in case a rollback must to be done
+ :param session: contains the used login username and working project, force to avoid checkins, public
+ :param topic: it can be: users, projects, vim_accounts, sdns, nsrs, nsds, vnfds
+ :param indata: data to be inserted
+ :param kwargs: used to override the indata descriptor
+ :param headers: http request headers
+ :return: _id: identity of the inserted data.
+ """
+ if topic not in self.map_topic:
+ raise EngineException(
+ "Unknown topic {}!!!".format(topic), HTTPStatus.INTERNAL_SERVER_ERROR
+ )
+ with self.write_lock:
+ self.map_topic[topic].cancel(rollback, session, indata, kwargs, headers)
+
def upgrade_db(self, current_version, target_version):
if target_version not in self.map_target_version_to_int.keys():
raise EngineException(