Exemple #1
0
 def get(self, vserver):
     username = request.authorization.username
     password = request.authorization.password
     tn = api.connectToTelnet(HOST, PORT, vserver, username, password, '')
     clientlist = api.getClientList(tn)
     content = {'total': len(clientlist), 'items': clientlist}
     return jsonify(content)
Exemple #2
0
 def get(self, vserver, command):
     username = request.authorization.username
     password = request.authorization.password
     tn = api.connectToTelnet(HOST, PORT, vserver, username, password, '')
     response = {
         'response': api.sendCommand(command, request.args, tn, True)
     }
     return jsonify(response)
Exemple #3
0
 def get(self, clid, vserver):
     username = request.authorization.username
     password = request.authorization.password
     message = ''
     nickname = ''
     if hasattr(request, 'args'):
         if 'msg' in request.args:
             message = request.args['msg']
         if 'nickname' in request.args:
             nickname = request.args['nickname']
     tn = api.connectToTelnet(HOST, PORT, vserver, username, password,
                              nickname)
     return jsonify(api.pokeClient(clid, tn, message))
def main():

    HOST = 'host'
    PORT = '10011'
    USER = '******'
    PASS = '******'
    
    tn = api.connectToTelnet(HOST, PORT, USER, PASS)
    list_of_channels = api.getChannelList(tn)
    print api.getChannelByCid(8, list_of_channels)['channel_name']
    for client in api.getClientList(tn):
        if client['client_type'] != '0':
            continue
        print (str(client['client_nickname']) + ' - ' + str(api.getChannelByCid(client['cid'], list_of_channels)['channel_name']))
Exemple #5
0
 def get(self, clid, vserver):
     username = request.authorization.username
     password = request.authorization.password
     tn = api.connectToTelnet(HOST, PORT, vserver, username, password, '')
     return jsonify(api.getClientByClid(clid, api.getClientList(tn)))