Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
1 changed files with 22 additions and 5 deletions
Showing only changes of commit 128e005611 - Show all commits

View File

@ -325,15 +325,14 @@ class API(object):
to_append["nick"] = main.IRCPool[name].nickname
to_append["conn"] = main.IRCPool[name].isconnected
to_append["limit"] = main.IRCPool[name].chanlimit
to_append["auth"] = main.IRCPool[name].authenticated
to_append["authed"] = main.IRCPool[name].authenticated
else:
to_append["chans"] = 0
to_append["nick"] = None
to_append["conn"] = False
to_append["limit"] = None
to_append["auth"] = None
to_append["authed"] = None
relays.append(to_append)
return dumps({"relays": relays})
@app.route("/irc/network/<net>/<num>/", methods=["POST"])
@ -435,9 +434,10 @@ class API(object):
return dumps({"channels": channels})
# API version
@app.route("/irc/network/<net>/channel/", methods=["DELETE"])
@login_required
def irc_network_channel_part(self, request, net):
def irc_network_channel_part_api(self, request, net):
try:
data = loads(request.content.read())
except JSONDecodeError:
@ -447,12 +447,29 @@ class API(object):
channel = data["channel"]
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
print("ABOUT TO PART", channel)
parted = chankeep.partSingle(net, channel)
if not parted:
dumps({"success": False, "reason": "no channels matched."})
return dumps({"success": True, "relays": parted})
# API version
@app.route("/irc/network/<net>/channel/", methods=["PUT"])
@login_required
def irc_network_channel_join_api(self, request, net):
try:
data = loads(request.content.read())
except JSONDecodeError:
return "Invalid JSON"
if "channel" not in data:
return dumps({"success": False, "reason": "no channel specified."})
channel = data["channel"]
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
joined = chankeep.joinSingle(net, channel)
if not joined:
return dumps({"success": False, "reason": "could not allocate channel to relay."})
return dumps({"success": True, "relays": joined})
@app.route("/irc/network/<net>/channel/<channel>/", methods=["PUT"])
@login_required
def irc_network_channel_join(self, request, net, channel):