import threading
import time

if __name__ == '__main__':

    #session.login(url='http://172.18.1.26:8082', api_key='kKphtsbQKjjfHR7amodA0001', timeout=45,
    #              beta=True)
    session.login(url='http://172.18.1.150:8082',
                  api_key='EiGpKD4QxlLJ25dbBEp20001',
                  timeout=30,
                  api_version='6.4')

    #session.login(url='https://172.18.1.151:8082', api_key='xJRo27kGja4JmPek9l3Nyxm4',
    #              verify=False)

    pprint(session._get_log_schema())

    #TODO: BLACKLISTQUERY fails when using format ID's due to CombinedFilter.

    query = BlacklistQuery('ve-1')
    query.add_in_filter(FieldValue(LogField.BLACKLISTENTRYSOURCEIP),
                        [IPValue('3.3.3.3/32')])

    for record in query.fetch_as_element(
    ):  # <-- must get as element to obtain delete() method
        #for record in query.fetch_raw():
        pprint(vars(record))
        record.delete()
    #print("Deleting!")
    #print(prepared_request(href='http://172.18.1.150:8082/6.4/elements/virtual_fw/10677/blacklist/Nzg2NDMz').delete())
Beispiel #2
0
import threading
import time



        
if __name__ == '__main__':
    
    #session.login(url='http://172.18.1.26:8082', api_key='kKphtsbQKjjfHR7amodA0001', timeout=45,
    #              beta=True)
    session.login(url='http://172.18.1.150:8082', api_key='EiGpKD4QxlLJ25dbBEp20001', timeout=30)
    
    #session.login(url='https://172.18.1.151:8082', api_key='xJRo27kGja4JmPek9l3Nyxm4',
    #              verify=False)
    
    pprint(session._get_log_schema())
    
    #TODO: BLACKLISTQUERY fails when using format ID's due to CombinedFilter.
    
    
    query = LogQuery(http_proxy_host='1.1.1.1')
    for log in query.fetch_live():
        print(log)
        
    sys.exit(1)
    websocket.enableTrace(True)
  
    
    #os.kill(os.getpid(), signal.SIGTERM)
    #print(os.getpid())