🎉 initial commit
This commit is contained in:
parent
42cf74aaea
commit
34e9f4605a
2 changed files with 31 additions and 0 deletions
4
config.ini.example
Normal file
4
config.ini.example
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[Re2o]
|
||||||
|
hostname = 10.128.0.67
|
||||||
|
username = service-user
|
||||||
|
password = !Ch@ng3Me?
|
27
main.py
Normal file
27
main.py
Normal 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")
|
Loading…
Reference in a new issue