示例#1
0
文件: main.py 项目: marczis/ESConsole
    def do_shards_show_recovery(self, args):
        try:
            parser = argparse.ArgumentParser(prog="shards_show_recovery")
            parser.add_argument(
                "-c",
                action="store_true",
                help="Do periodic query, use -t to set sleep time")
            parser.add_argument("-t",
                                type=int,
                                help="seconds between two query, use with -c",
                                default=1)
            parser.add_argument("-l",
                                type=int,
                                help="Number of lines to print",
                                default=-1)
            pargs = parser.parse_args(esc_utils.arrayArgs(args))
        except:
            return

        if pargs.c:
            esc_utils.periodic(lambda: self.shards_show_recovery(pargs.l),
                               pargs.t)
            return

        self.shards_show_recovery(pargs.l)
示例#2
0
文件: main.py 项目: marczis/ESConsole
    def do_cluster_pending_tasks(self, args=""):
        """ Ask the task list of the cluster. """
        try:
            parser = argparse.ArgumentParser(prog="cluster_pending_tasks")
            parser.add_argument(
                "-c",
                action="store_true",
                help="Do periodic query, use -t to set sleep time")
            parser.add_argument("-t",
                                type=int,
                                help="seconds between two query, use with -c",
                                default=1)
            parser.add_argument("-l",
                                type=int,
                                help="Number of lines to print",
                                default=-1)
            pargs = parser.parse_args(esc_utils.arrayArgs(args))
        except:
            return

        if pargs.c:
            esc_utils.periodic(lambda: self.cluster_pending_tasks(pargs.l),
                               pargs.t)
            return

        self.cluster_pending_tasks(pargs.l)
示例#3
0
文件: main.py 项目: marczis/ESConsole
    def do_cluster_health(self, args=""):
        """ Provide system health """
        try:
            parser = argparse.ArgumentParser(prog="cluster_health")
            parser.add_argument("-c", action="store_true", help="Do periodic query, use -t to set sleep time")
            parser.add_argument("-t", type=int, help="seconds between two query, use with -c", default=1)
            pargs = parser.parse_args(esc_utils.arrayArgs(args))
        except:
            return

        if pargs.c:
            esc_utils.periodic(self.cluster_health, pargs.t)
            return

        self.cluster_health()
示例#4
0
文件: main.py 项目: marczis/ESConsole
    def do_shards_show_recovery(self, args):
        try:
            parser = argparse.ArgumentParser(prog="shards_show_recovery")
            parser.add_argument("-c", action="store_true", help="Do periodic query, use -t to set sleep time")
            parser.add_argument("-t", type=int, help="seconds between two query, use with -c", default=1)
            parser.add_argument("-l", type=int, help="Number of lines to print", default=-1)
            pargs = parser.parse_args(esc_utils.arrayArgs(args))
        except:
            return

        if pargs.c:
            esc_utils.periodic(lambda: self.shards_show_recovery(pargs.l), pargs.t)
            return

        self.shards_show_recovery(pargs.l)
示例#5
0
文件: main.py 项目: marczis/ESConsole
    def do_cluster_pending_tasks(self, args=""):
        """ Ask the task list of the cluster. """
        try:
            parser = argparse.ArgumentParser(prog="cluster_pending_tasks")
            parser.add_argument("-c", action="store_true", help="Do periodic query, use -t to set sleep time")
            parser.add_argument("-t", type=int, help="seconds between two query, use with -c", default=1)
            parser.add_argument("-l", type=int, help="Number of lines to print", default=-1)
            pargs = parser.parse_args(esc_utils.arrayArgs(args))
        except:
            return

        if pargs.c:
            esc_utils.periodic(lambda: self.cluster_pending_tasks(pargs.l), pargs.t)
            return

        self.cluster_pending_tasks(pargs.l)
示例#6
0
文件: main.py 项目: marczis/ESConsole
    def do_cluster_health(self, args=""):
        """ Provide system health """
        try:
            parser = argparse.ArgumentParser(prog="cluster_health")
            parser.add_argument(
                "-c",
                action="store_true",
                help="Do periodic query, use -t to set sleep time")
            parser.add_argument("-t",
                                type=int,
                                help="seconds between two query, use with -c",
                                default=1)
            pargs = parser.parse_args(esc_utils.arrayArgs(args))
        except:
            return

        if pargs.c:
            esc_utils.periodic(self.cluster_health, pargs.t)
            return

        self.cluster_health()