🎉 initial commit

This commit is contained in:
otthorn 2021-04-04 13:13:30 +02:00 committed by root
parent 42cf74aaea
commit 34e9f4605a
2 changed files with 31 additions and 0 deletions

4
config.ini.example Normal file
View file

@ -0,0 +1,4 @@
[Re2o]
hostname = 10.128.0.67
username = service-user
password = !Ch@ng3Me?

27
main.py Normal file
View file

@ -0,0 +1,27 @@
#! /bin/env python3
import argparse
import configparser
import dns.name
import dns.rdataset
import dns.rdatatype
import collections
from re2oapi import Re2oAPIClient
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", help="Path to the config file", type=str,
default="config.ini")
args = parser.parse_args()
config = configparser.ConfigParser()
config.read(args.config)
api_client = Re2oAPIClient(config['Re2o']['hostname'], config['Re2o']['username'], config['Re2o']['password'],
use_tls=False)
zones = api_client.list("dns/zones")