peeringdb-mirror/peeringdb_api/management/commands/sync_peeringdb.py

14 lines
399 B
Python
Raw Normal View History

2024-04-12 21:06:08 -04:00
from django.conf import settings
from django.core.management.base import BaseCommand
from peeringdb import resource
from peeringdb_api.pdb_client import client
class Command(BaseCommand):
help = 'Syncs the PeeringDB database.'
def handle(self, *args, **options):
rs = resource.all_resources()
client.updater.update_all(rs, fetch_private=bool(settings.PEERINGDB_API_KEY))