Ejemplo n.º 1
0
def main():
    arguments = parse_arguments()
    request = rest.RepairSchedulerRequest(base_url=arguments.url)

    if arguments.id:
        result = request.get(job_id=arguments.id)
        if result.is_successful():
            print_verbose_repair_job(result.data, arguments.limit)
        else:
            print(result.format_exception())
    elif arguments.table:
        if not arguments.keyspace:
            print("Must specify keyspace")
            sys.exit(1)
        result = request.list(keyspace=arguments.keyspace,
                              table=arguments.table)
        if result.is_successful():
            print_repair_jobs(result.data, arguments.limit)
        else:
            print(result.format_exception())
    else:
        result = request.list(keyspace=arguments.keyspace)
        if result.is_successful():
            print_repair_jobs(result.data, arguments.limit)
        else:
            print(result.format_exception())
Ejemplo n.º 2
0
def trigger_repair(arguments):
    request = rest.RepairSchedulerRequest(base_url=arguments.url)
    result = request.post(keyspace=arguments.keyspace, table=arguments.table)
    if result.is_successful():
        table_printer.print_repair_job(result.data)
    else:
        print(result.format_exception())
Ejemplo n.º 3
0
def status(arguments, print_running=False):
    request = rest.RepairSchedulerRequest(base_url=arguments.url)
    result = request.list()
    if result.is_successful():
        if print_running:
            print("ecChronos is running")
    else:
        print("ecChronos is not running")
        sys.exit(1)
Ejemplo n.º 4
0
def main():
    arguments = parse_arguments()
    request = rest.RepairSchedulerRequest(base_url=arguments.url)

    if arguments.table:
        result = request.get(keyspace=arguments.keyspace, table=arguments.table)
        if result.is_successful():
            print_verbose_repair_job(result.data, arguments.limit)
        else:
            print(result.format_exception())
    else:
        result = request.list(keyspace=arguments.keyspace)
        if result.is_successful():
            print_repair_jobs(result.data, arguments.limit)
        else:
            print(result.format_exception())