Пример #1
0
 def setUp(self):
     if not self.__class__._setuponce_done:
         self.__class__._setuponce_done = True
         # self.__class__.rwr = risWhois(type="ipv4", local_file="tmp/ris-whois-short")
         if self.__class__._use_local_test_data:
             self.__class__.rwr = risWhois(local_file="tmp/ris-whois-short", db_filename="tmp/riswhois.db")
         else:
             self.__class__.rwr = risWhois(db_filename="tmp/riswhois2.db")
             # self.__class__.rwr = risWhois(db_filename=":memory:")
     else:
         # print "Tests already set up!"
         pass
"""
Generates daily delegated db dump for lacnic

:author: Carlos M. Martinez, [email protected]
:date: 20151228
:date: 20160523

"""

import sys
import lacniclabs.netdata.delegated as dlg
import lacniclabs.netdata.riswhois as rwh

## Import delegated stats files
d = dlg.delegatedStats(rir='lacnic', date='latest', db_filename='var/netdata-latest.db')
d = dlg.delegatedStats(rir='arin', date='latest', db_filename='var/netdata-latest.db', as_cache=True)
d = dlg.delegatedStats(rir='ripencc', date='latest', db_filename='var/netdata-latest.db', as_cache=True)
d = dlg.delegatedStats(rir='afrinic', date='latest', db_filename='var/netdata-latest.db', as_cache=True)
d = dlg.delegatedStats(rir='apnic', date='latest', db_filename='var/netdata-latest.db', as_cache=True)

## Import RISWHOIS
r = rwh.risWhois(date='latest', db_filename='var/netdata-latest.db')

sys.exit()
Пример #3
0
def import_riswhois(rir, date):
    ## Import RISWHOIS
    print "====>> RUNNING: Import RISWHOIS origin AS stats"
    r = rwh.risWhois(date='latest', db_filename=fname_base)
    print " "
    print "============================================="
Пример #4
0
                       db_filename=fname_base,
                       as_cache=True)
d = dlg.delegatedStats(rir='ripencc',
                       date='latest',
                       db_filename=fname_base,
                       as_cache=True)
d = dlg.delegatedStats(rir='afrinic',
                       date='latest',
                       db_filename=fname_base,
                       as_cache=True)
d = dlg.delegatedStats(rir='apnic',
                       date='latest',
                       db_filename=fname_base,
                       as_cache=True)
print " "
print "============================================="

## Import RISWHOIS
print "====>> RUNNING: Import RISWHOIS origin AS stats"
r = rwh.risWhois(date='latest', db_filename=fname_base)
print " "
print "============================================="

## Import ROADATA
print "====>> RUNNING: Import RPKI validator ROA data"
k = rpki.ripevalRoaData(db_filename=fname_base)
print " "
print "============================================="

sys.exit()