示例#1
0
 def deleteConnectionLogsForUsersQuery(self, user_ids):
     condition = " or ".join(
         map(lambda user_id: "user_id=%s" % user_id, user_ids))
     details_query = ibs_db.createDeleteQuery(
         "connection_log_details",
         "connection_log_id in (select connection_log_id from connection_log where %s)"
         % condition)
     connection_query = ibs_db.createDeleteQuery("connection_log",
                                                 condition)
     return details_query + connection_query
示例#2
0
    def __deleteAddUserSaveQuery(self, add_user_save_id, admin_restricted,
                                 admin_id):
        cond = "add_user_save_id=%s" % add_user_save_id
        if admin_restricted:
            cond += " and admin_id=%s" % admin_id
            details_cond = "add_user_save_id in (select add_user_save_id from add_user_saves where %s)" % cond
        else:
            details_cond = cond

        return ibs_db.createDeleteQuery("add_user_save_details",details_cond) + \
                ibs_db.createDeleteQuery("add_user_saves",details_cond)
示例#3
0
    def deleteUserAttrQuery(self,user_id,attr_name):
	"""
	    XXX:change to use stored procedures
	"""
	return ibs_db.createDeleteQuery("user_attrs","user_id=%s and attr_name=%s"%
						      (user_id,dbText(attr_name))
					)
示例#4
0
 def __delVoIPChargeRuleQuery(self, charge_rule_id):
     """
         return query needed to delete rule only from charge_rules table
         it won't delete ports
     """
     return ibs_db.createDeleteQuery("voip_charge_rules",
                                     "charge_rule_id=%s" % charge_rule_id)
示例#5
0
 def deleteAuditLogsForUsersQuery(self, user_ids):
     """
         return query for deleting audit logs of users with ids in user_ids
         user_ids(iterable object of user_ids)
     """
     condition = " or ".join(
         map(lambda user_id: "object_id=%s" % user_id, user_ids))
     return ibs_db.createDeleteQuery("user_audit_log",
                                     "is_user = '******' and (%s)" % condition)
示例#6
0
    def __delAttributesQuery(self,ras_id):
	return ibs_db.createDeleteQuery("ras_attrs","ras_id=%s"%ras_id)
示例#7
0
    def __deleteRasQuery(self,ras_id):
	return ibs_db.createDeleteQuery("ras","ras_id=%s"%ras_id)	
示例#8
0
    def __delUserNormalAttrsQuery(self,user_id_conds):
	return ibs_db.createDeleteQuery("normal_users",user_id_conds)
示例#9
0
 def __deletePlanUserAttrsQuery(self,user_id):
     return ibs_db.createDeleteQuery("persistent_lan_users","user_id=%s"%user_id)
示例#10
0
 def __delAllAdminPermsQuery(self, admin_id):
     return ibs_db.createDeleteQuery("admin_perms",
                                     "admin_id=%s" % admin_id)
示例#11
0
    def __delAllAdminPermsQuery(self,admin_id):
	return ibs_db.createDeleteQuery("admin_perms","admin_id=%s"%admin_id)
示例#12
0
    def __delIPfromPoolQuery(self,ippool_id,ip):
	return ibs_db.createDeleteQuery("ippool_ips","ippool_id=%s and ip=%s"%(ippool_id,dbText(ip)))
示例#13
0
    def __delChargeQuery(self,charge_id):
	"""
	    return query to delete the charge itself from charges table
	"""
	return ibs_db.createDeleteQuery("charges","charge_id=%s"%charge_id)
示例#14
0
 def __unlockAdminQuery(self, admin_id, lock_id):
     return ibs_db.createDeleteQuery(
         "admin_locks", "admin_id=%s and lock_id=%s" % (admin_id, lock_id))
示例#15
0
    def __deletePoolIPsQuery(self,ippool_id):
	return ibs_db.createDeleteQuery("ippool_ips","ippool_id=%s"%ippool_id)
示例#16
0
 def __deleteAddUserSavesQuery(self, admin_id):
     return   ibs_db.createDeleteQuery("add_user_save_details","add_user_save_id in \
                 (select add_user_save_id from add_user_saves where admin_id = %s)"                                                                                      %admin_id) + \
              ibs_db.createDeleteQuery("add_user_saves","admin_id = %s"%admin_id)
示例#17
0
 def __deleteAdminDepositChangesQuery(self, admin_id):
     return ibs_db.createDeleteQuery("admin_deposit_change",
                                     "to_admin_id = %s" % admin_id)
示例#18
0
 def __deleteAdminLocksQuery(self, admin_id):
     return ibs_db.createDeleteQuery("admin_locks",
                                     "admin_id = %s" % admin_id)
示例#19
0
 def deleteVoIPUserAttrsQuery(self, user_id):
     """
         delete user voip attributes from "voip_users" table
     """
     return ibs_db.createDeleteQuery("voip_users", "user_id=%s" % user_id)
示例#20
0
 def __delChargeRulePortsQuery(self, rule_id):
     return ibs_db.createDeleteQuery("charge_rule_ports",
                                     "charge_rule_id=%s" % rule_id)
示例#21
0
    def __delChargeRuleDowsQuery(self,rule_id):
	return ibs_db.createDeleteQuery("charge_rule_day_of_weeks","charge_rule_id=%s"%rule_id)
示例#22
0
 def __delChargeRuleDowsQuery(self, rule_id):
     return ibs_db.createDeleteQuery("charge_rule_day_of_weeks",
                                     "charge_rule_id=%s" % rule_id)
示例#23
0
    def __deleteGroupAttrsQuery(self,group_id):
	return ibs_db.createDeleteQuery("group_attrs","group_id=%s"%group_id)
示例#24
0
 def __deleteUserCallerIDsQuery(self, user_id):
     return ibs_db.createDeleteQuery("caller_id_users","user_id=%s"%user_id)
示例#25
0
 def __deletePermTemplateQuery(self, template_name):
     return ibs_db.createDeleteQuery(
         "admin_perm_templates", "template_name=%s" % dbText(template_name))
示例#26
0
 def __delChargeQuery(self, charge_id):
     """
         return query to delete the charge itself from charges table
     """
     return ibs_db.createDeleteQuery("charges", "charge_id=%s" % charge_id)
示例#27
0
    def __deletePermTemplateQuery(self,template_name):
	return ibs_db.createDeleteQuery("admin_perm_templates","template_name=%s"%dbText(template_name))
示例#28
0
    def __delPrefixQuery(self,tariff_id,prefix_codes):
	return ibs_db.createDeleteQuery("tariff_prefix_list","%s"%" or ".join(map(lambda code:"prefix_code=%s"%dbText(code),prefix_codes)))
    ################################################
示例#29
0
    def __delUserPLanAttrsQuery(self,user_id_conds):
	return ibs_db.createDeleteQuery("persistent_lan_users",user_id_conds)
示例#30
0
    def __deleteTariffQuery(self,tariff_id):
	return ibs_db.createDeleteQuery("voip_charge_rule_tariff","tariff_id=%s"%tariff_id)
示例#31
0
 def __deleteMessageQuery(self, table_name, message_id):
     return ibs_db.createDeleteQuery(table_name,
                                     "message_id = %s" % message_id)
示例#32
0
    def __deleteTariffPrefixesQuery(self,tariff_id):
	return ibs_db.createDeleteQuery("tariff_prefix_list","tariff_id=%s"%tariff_id)
示例#33
0
    def __delIPpoolFromRasQuery(self,ras_id,ippool_id):
	return ibs_db.createDeleteQuery("ras_ippools","ras_id=%s and ippool_id=%s"%(ras_id,ippool_id))
示例#34
0
 def __deleteGroupAttrsQuery(self, group_id):
     return ibs_db.createDeleteQuery("group_attrs",
                                     "group_id=%s" % group_id)
示例#35
0
    def deleteNormalUserAttrsQuery(self, user_id):
        """
	    delete user normal attributes from "normal_users" table
	"""
        return ibs_db.createDeleteQuery("normal_users", "user_id=%s" % user_id)
示例#36
0
    def deleteVoIPUserAttrsQuery(self,user_id):
	"""
	    delete user voip attributes from "voip_users" table
	"""
	return ibs_db.createDeleteQuery("voip_users","user_id=%s"%user_id)
示例#37
0
    def __delChargeRulePortsQuery(self,rule_id):
	return ibs_db.createDeleteQuery("charge_rule_ports","charge_rule_id=%s"%rule_id)
示例#38
0
    def deleteConnectionLogsForUsersQuery(self,user_ids):
	condition=" or ".join(map(lambda user_id:"user_id=%s"%user_id,user_ids))
	details_query=ibs_db.createDeleteQuery("connection_log_details","connection_log_id in (select connection_log_id from connection_log where %s)"%condition)
	connection_query=ibs_db.createDeleteQuery("connection_log",condition)
	return details_query+connection_query
示例#39
0
    def __delInternetChargeRuleQuery(self,charge_rule_id):
	"""
	    return query needed to delete rule only from charge_rules table
	    it won't delete ports
	"""
	return ibs_db.createDeleteQuery("internet_charge_rules","charge_rule_id=%s"%charge_rule_id)
示例#40
0
 def __deleteEventQuery(self, event_id):
     return ibs_db.createDeleteQuery("ias_event", "event_id=%s" % event_id)
示例#41
0
    def deleteGroupAttrQuery(self,group_id,attr_name):
	return ibs_db.createDeleteQuery("group_attrs","attr_name=%s and group_id=%s"%
					    (dbText(attr_name),to_int(group_id,"group id")))
示例#42
0
 def __delLeafServiceQuery(self, leaf_service_id):
     return ibs_db.createDeleteQuery("bw_leaf_services",
                                     "leaf_service_id=%s" % leaf_service_id)
示例#43
0
 def __deletePermissionQuery(self, admin_id, perm_name):
     return ibs_db.createDeleteQuery(
         "admin_perms",
         "admin_id=%s and perm_name=%s" % (admin_id, dbText(perm_name)))
示例#44
0
 def __delNodeQuery(self, node_id):
     return ibs_db.createDeleteQuery("bw_node", "node_id=%s" % node_id)
示例#45
0
 def __deletePermTemplateDetailsQuery(self, template_name):
     return ibs_db.createDeleteQuery(
         "admin_perm_templates_detail", "template_id = (%s)" %
         (self.__templateNameToIDQuery(template_name)))
示例#46
0
 def __delLeafQuery(self, leaf_id):
     return ibs_db.createDeleteQuery("bw_leaf", "leaf_id=%s" % leaf_id)
示例#47
0
    def __deletePermissionQuery(self,admin_id,perm_name):
	return ibs_db.createDeleteQuery("admin_perms","admin_id=%s and perm_name=%s"%
							  (admin_id,dbText(perm_name)))
示例#48
0
 def __delInterfaceQuery(self, int_id):
     return ibs_db.createDeleteQuery("bw_interface",
                                     "interface_id=%s" % int_id)
示例#49
0
    def __deletePermTemplateDetailsQuery(self,template_name):
	return ibs_db.createDeleteQuery("admin_perm_templates_detail","template_id = (%s)"%(self.__templateNameToIDQuery(template_name)))
示例#50
0
 def __delBwStaticIPQuery(self, ip_addr):
     return ibs_db.createDeleteQuery("bw_static_ip",
                                     "ip=%s" % dbText(ip_addr))
示例#51
0
    def __delUserAttrsQuery(self,user_id_conds):
	"""
	    user_ids_conds: condition of user_ids
	"""
	return ibs_db.createDeleteQuery("user_attrs",user_id_conds)
示例#52
0
 def __delPrefixQuery(self,tariff_id,prefix_codes):
     prefix_code_cond = " or ".join(map(lambda code:"prefix_code=%s"%dbText(code),prefix_codes))
     return ibs_db.createDeleteQuery("tariff_prefix_list","(%s) and tariff_id = %s"%(prefix_code_cond, tariff_id))
 ################################################
示例#53
0
    def __delUserVoIPAttrsQuery(self,user_id_conds):
	return ibs_db.createDeleteQuery("voip_users",user_id_conds)
示例#54
0
    def __delBwStaticIPQuery(self,ip_addr):
	return ibs_db.createDeleteQuery("bw_static_ip","ip=%s"%dbText(ip_addr))
	
示例#55
0
    def __delUserFromUsersTableQuery(self,user_id_conds):
	return ibs_db.createDeleteQuery("users",user_id_conds)
示例#56
0
    def __delPortQuery(self,ras_id,port_name):
	return ibs_db.createDeleteQuery("ras_ports","ras_id=%s and port_name=%s"%(ras_id,dbText(port_name)))
示例#57
0
 def __deleteTariffPrefixesQuery(self,tariff_id):
     return ibs_db.createDeleteQuery("tariff_prefix_list","tariff_id=%s"%tariff_id)
示例#58
0
 def __deleteUserMessagesQuery(self, message_ids, user_id):
     cond = "( %s ) and user_id = %s" % (" or ".join(
         map(lambda message_id: "message_id=%s" % message_id,
             message_ids)), user_id)
     return ibs_db.createDeleteQuery("user_messages", cond)
示例#59
0
 def __deleteTariffQuery(self,tariff_id):
     return ibs_db.createDeleteQuery("voip_charge_rule_tariff","tariff_id=%s"%tariff_id)
示例#60
0
    def __delInterfaceQuery(self,int_id):
	return ibs_db.createDeleteQuery("bw_interface","interface_id=%s"%int_id)