API wrapper for the netcup DNS api
Project description
nc_dnsapi
A simple API wrapper for the netcup DNS API
from nc_dnsapi import Client, DNSRecord
customer = 123456
api_key = "your-personal-api-key"
api_password = "your-private-api-password"
with Client(customer, api_key, api_password) as api:
# fetch records
records = api.dns_records("example.com")
for record in records:
print(record)
# fetch zone details
zone = api.dns_zone("example.com")
print(zone)
# update single record
api.update_dns_record("example.com", DNSRecord("my-hostname", "A", "127.0.0.2", id=108125))
# update list of records
api.update_dns_record("example.com", [ DNSRecord("my-hostname", "A", "127.0.0.2", id=108125),
DNSRecord("my-hostname2", "A", "127.0.0.2", id=108126)])
# delete record
api.delete_dns_record("example.com", DNSRecord("my-hostname", "A", "127.0.0.2", id=108125))
# add record
api.add_dns_record("example.com", DNSRecord("another-host", "AAAA", "::1"))
# update zone
zone = api.dns_zone("example.com")
zone.refresh = 3600
api.update_dns_zone("example.com", zone)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nc_dnsapi-0.1.5.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for nc_dnsapi-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34e52cd6e7a3f634bdbc0159418ee9da2f57676082027834b1a799196540083e |
|
MD5 | d8782e28e60e398e72bee62dda17b38e |
|
BLAKE2b-256 | 22f9938affd8f7006af68d51c067f69b42fef0abb0a4aa3066f2f06934a2e20b |