Пример #1
0
def run():
    id = setTarget(g_subcribe_items)
    showSelectInfoByUrl(g_subcribe_items[id][0])
    setSubscribeType(g_check_subscribe_items)
    ret = setEvtType(g_subcribe_items[id][1])
    setDest(g_subcribe_items[id][2])
    msg = lstnDestData.getJsonMsg()
    print color.PURPLE + "Dest url:       " + lstnDestData.getDest() + color.END
    print color.PURPLE + "Target url:     " + lstnDestData.getTarget() + color.END
    print color.BLUE  +  "MSG:            " + msg + color.END
    ret = http_post(lstnDestData.getTarget(), msg)
    print "response: " + ret
def run():
    id = setTarget(g_subcribe_items)
    showSelectInfoByUrl(g_subcribe_items[id][0])
    setSubscribeType(g_check_subscribe_items)
    ret = setEvtType(g_subcribe_items[id][1])
    setDest(g_subcribe_items[id][2])
    msg = lstnDestData.getJsonMsg()
    print color.PURPLE + "Dest url:       " + lstnDestData.getDest() + color.END
    print color.PURPLE + "Target url:     " + lstnDestData.getTarget() + color.END
    print color.BLUE  +  "MSG:            " + msg + color.END
    ret = http_post(lstnDestData.getTarget(), msg)
    print "response: " + ret
Пример #3
0
    print color.BLUE + "MSG:            " + msg + color.END
    ret = http_post(lstnDestData.getTarget(), msg)
    print "response: " + ret


if __name__ == "__main__":
    #remoteip  = "10.239.58.107:8090"
    remoteip = "192.168.122.22:8090"
    localip = checkRMMAvailable(remoteip)
    #changeDefData("10.239.58.107", remoteip)
    changeDefData("192.168.122.22", remoteip)
    lstnDestData.setReqType(1)
    for evt in g_rfEvents:
        lstnDestData.setEvtType(evt)
        for item in g_subcribe_items:
            lstnDestData.setDest(item[2])
            for i in range(2):
                for j in range(2):
                    temp = item[0]
                    temp = temp.replace("{sid}", ('%d') % (j))
                    temp = temp.replace("{pid}", ('%d') % (i))
                    lstnDestData.setTarget(temp)
                    msg = lstnDestData.getJsonMsg()
                    print color.PURPLE + "Dest url:       " + lstnDestData.getDest(
                    ) + color.END
                    print color.PURPLE + "Target url:     " + lstnDestData.getTarget(
                    ) + color.END
                    print color.BLUE + "MSG:            " + msg + color.END
                    ret = http_post(lstnDestData.getTarget(), msg)
                    print "response: " + ret
Пример #4
0
    print "response: " + ret

if __name__ == "__main__":
    #remoteip  = "10.239.58.107:8090"
    remoteip  = "192.168.122.22:8090"
    localip = checkRMMAvailable(remoteip)
    #changeDefData("10.239.58.107", remoteip)
    changeDefData("192.168.122.22", remoteip)
    lstnDestData.setReqType(1)
    for evt in g_rfEvents:
        lstnDestData.setEvtType(evt)
        for item in g_subcribe_items:
            lstnDestData.setDest(item[2])
            for i in range(2):
                for j in range(2):
                    temp = item[0]
                    temp = temp.replace("{sid}", ('%d')%(j))
                    temp = temp.replace("{pid}", ('%d')%(i));
                    lstnDestData.setTarget(temp)
                    msg = lstnDestData.getJsonMsg()
                    print color.PURPLE + "Dest url:       " + lstnDestData.getDest() + color.END
                    print color.PURPLE + "Target url:     " + lstnDestData.getTarget() + color.END
                    print color.BLUE  +  "MSG:            " + msg + color.END
                    ret = http_post(lstnDestData.getTarget(), msg)
                    print "response: " + ret