Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
1 changed files with 15 additions and 3 deletions
Showing only changes of commit f3f717e693 - Show all commits

View File

@ -409,13 +409,25 @@ class API(object):
@app.route("/irc/auto/<net>/", methods=["POST"]) @app.route("/irc/auto/<net>/", methods=["POST"])
@login_required @login_required
def irc_auto_network(self, request, net): def irc_auto_network(self, request, net):
print(repr(main.network[net].relays.keys()))
if net not in main.network.keys(): if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."}) return dumps({"success": False, "reason": "no such net."})
if 1 in main.network[net].relays.keys(): if 1 in main.network[net].relays.keys():
return dumps({"success": False, "reason": f"First relay exists on {net}"}) return dumps({"success": False, "reason": f"first relay exists on {net}"})
num, alias = main.network[net].add_relay(1) num, alias = main.network[net].add_relay(1)
provision.provisionRelay(num, net) provision.provisionRelay(num, net)
main.saveConf("network") main.saveConf("network")
return dumps({"success": True, f"message": "Created relay {num} with alias {alias} on {net}"}) return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"})
@app.route("/irc/list/<net>/", methods=["POST"])
@login_required
def irc_list_network(self, request, net):
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
if 1 not in main.network[net].relays.keys():
return dumps({"success": False, "reason": f"no first relay on {net}"})
num, alias = main.network[net].add_relay(1)
provision.provisionRelay(num, net)
main.saveConf("network")
return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"})