neptune/core/lib/manage/threshold.py

54 lines
1.1 KiB
Python
Raw Normal View History

from core.lib.threshold import threshold_request
2022-07-25 18:08:28 +00:00
def get_irc_stats():
url = "irc/stats"
payload = {}
stats = threshold_request(url, payload)
if not stats:
return {}
return stats
2022-07-25 18:08:28 +00:00
def get_irc_networks():
url = "irc/networks"
payload = {}
networks = threshold_request(url, payload)
if not networks:
return {}
2022-07-25 18:08:28 +00:00
return networks
2022-07-26 21:15:30 +00:00
def get_irc_network(net):
url = f"irc/network/{net}"
payload = {}
network = threshold_request(url, payload)
if not network:
return {}
return network
2022-07-27 07:58:57 +00:00
def edit_irc_network(net, data):
url = f"irc/network/{net}/edit"
payload = dict(data)
network = threshold_request(url, payload)
return network
2022-07-26 21:15:30 +00:00
def get_irc_relays(net):
url = f"irc/network/{net}/relays"
payload = {}
relays = threshold_request(url, payload)
if not relays:
return []
return relays
def get_irc_channels(net):
url = f"irc/network/{net}/channels"
payload = {}
channels = threshold_request(url, payload)
if not channels:
return []
return channels