+ # It must be deleted
+ if session["force"]:
+ self.db.del_one(self.topic, {"_id": _id})
+ op_id = None
+ self._send_msg("deleted", {"_id": _id, "op_id": op_id}, not_send_msg=not_send_msg)
+ else:
+ update_dict["_admin.to_delete"] = True
+ self.db.set_one(self.topic, {"_id": _id},
+ update_dict=update_dict,
+ push={"_admin.operations": self._create_operation("delete")}
+ )
+ # the number of operations is the operation_id. db_content does not contains the new operation inserted,
+ # so the -1 is not needed
+ op_id = "{}:{}".format(db_content["_id"], len(db_content["_admin"]["operations"]))
+ self._send_msg("delete", {"_id": _id, "op_id": op_id}, not_send_msg=not_send_msg)
+ return op_id
+
+
+class VimAccountTopic(CommonVimWimSdn):
+ topic = "vim_accounts"
+ topic_msg = "vim_account"
+ schema_new = vim_account_new_schema
+ schema_edit = vim_account_edit_schema
+ multiproject = True
+ password_to_encrypt = "vim_password"
+ config_to_encrypt = {"1.1": ("admin_password", "nsx_password", "vcenter_password"),
+ "default": ("admin_password", "nsx_password", "vcenter_password", "vrops_password")}