From 34e9f4605ad41acfb889eebd2f2f299f6fafa6aa Mon Sep 17 00:00:00 2001 From: otthorn Date: Sun, 4 Apr 2021 13:13:30 +0200 Subject: [PATCH] :tada: initial commit --- config.ini.example | 4 ++++ main.py | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 config.ini.example create mode 100644 main.py diff --git a/config.ini.example b/config.ini.example new file mode 100644 index 0000000..5391a6c --- /dev/null +++ b/config.ini.example @@ -0,0 +1,4 @@ +[Re2o] +hostname = 10.128.0.67 +username = service-user +password = !Ch@ng3Me? diff --git a/main.py b/main.py new file mode 100644 index 0000000..7f7137c --- /dev/null +++ b/main.py @@ -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")