Browse Source

update

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
master 0.0.2
Nico Schottelius 3 years ago
parent
commit
cf21ec33a9
  1. 4
      README.md
  2. 16
      ungleich_ripe.py

4
README.md

@ -2,6 +2,10 @@
A python package to set reverse dns in ungleich vm.
## Requirements
You need at least python 3.
## Usage
installing the package via pip (python3 required)

16
ungleich_ripe.py

@ -41,19 +41,9 @@ class ungleichRIPE(object):
ripe_object['descr'] = args.description
ripe_object['mnt-by'] = "mnt-ungleich"
# ripe_attributes = []
ripe_attributes = [{ "name": key, "value": value } for key, value in ripe_object.items() ]
# for key, value in ripe_object.items():
# ripe_attributes.append( { "name": key,
# "value": value
# }
# )
# "source": {
# "id": "RIPE"
# },
# Format according to API layout
ripe_element = {}
ripe_element['objects'] = []
ripe_element['objects'].append(
@ -69,6 +59,8 @@ class ungleichRIPE(object):
)
data = json.dumps(ripe_element).encode('utf-8')
# debug
pprint.pprint(ripe_element)
method = 'POST'
@ -81,8 +73,6 @@ class ungleichRIPE(object):
"Accept": "application/json"
})
pprint.pprint(req)
print("Adding a v6 route object at {} for {} with {} req={}".format(url, args.network, data, str(req)))
with urllib.request.urlopen(req) as f:

Loading…
Cancel
Save