noc.commands.wipe

Module Contents

class noc.commands.wipe.Command

Bases: noc.core.management.base.BaseCommand

args = <model> <object id> [.. <object id>]. Model is managed_object or user
help = Completely wipe object and related data
models = ['managed_object', 'user']
add_arguments(self, parser)
handle(self, *args, **options)
log(self, message, newline=False)

Progress log wrapper. Usage: with self.log(message):

do something
Parameters:
  • message
  • newline – Add newline
Returns:

get_managed_object(self, o_id)

Get ManagedObject by id or name :param o_id: Object’s id or name :return: ManagedObject :rtype: ManagedObject

wipe_managed_object(self, o)

Wipe Managed Object :param o: Managed Object :type o: Managed Object :return: None

get_user(self, u_id)

Get User by id or name :param u_id: Object’s id or name :return: ManagedObject :rtype: ManagedObject

wipe_user(self, o)

Wipe User :param o: User :type o: User :return: None