2019-04-27 04:56:57 +00:00
|
|
|
import requests
|
2019-04-29 06:07:40 +00:00
|
|
|
import argparse
|
2019-04-27 04:56:57 +00:00
|
|
|
|
|
|
|
|
2019-04-29 06:07:40 +00:00
|
|
|
def msg(name=None):
|
|
|
|
return '''ungleich-cli --set-reverse <ipv6adrress> --user <username> --token <token> --name <hostname>'''
|
2019-04-27 04:56:57 +00:00
|
|
|
|
|
|
|
|
2019-04-29 06:07:40 +00:00
|
|
|
parser = argparse.ArgumentParser(description="This script set the reverse dns for your VM", usage=msg())
|
2019-04-27 04:56:57 +00:00
|
|
|
|
2019-04-29 06:07:40 +00:00
|
|
|
parser.add_argument('--set-reverse', help='REQUIRED: IPv6 Address of your VM', metavar='', required=True)
|
|
|
|
parser.add_argument('--user', help='Your ungleich username', metavar='', required=True)
|
|
|
|
parser.add_argument('--token', help='Your ungleich 6 digit OTP generated token', metavar='', type=int, required=True)
|
|
|
|
parser.add_argument('--name', help='Hostname', metavar='', required=True)
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
|
def cli():
|
|
|
|
"""A dummy endpoint, to check what endpoint will be reverse-dns service."""
|
|
|
|
r = requests.post(
|
|
|
|
'https://en53kfc0hydpg.x.pipedream.net',
|
|
|
|
json={'username': args.user, 'token': args.token, 'ipaddress': args.set_reverse, 'name': args.name})
|
|
|
|
return r.text
|