API wrapper for the netcup DNS api
Project description
nc_dnsapi
A simple API wrapper for the netcup DNS API
import nc_dnsapi
customer = 123456
api_key = "your-personal-api-key"
api_password = "your-private-api-password"
with nc_dnsapi.Client(customer, api_key, api_password) as api:
# fetch records
records = api.dns_records("example.com")
print(records)
# 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.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for nc_dnsapi-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d06ac9e4d5914dc284810dd70a24e1a9f4688504b085af441b2be011d3cf056d |
|
MD5 | d58967642f221159706d3b430d637739 |
|
BLAKE2b-256 | 2a5fd0ffd183e95cc6f1f6aa7c695b4342d77ab614ada5d766acb3f71bad81bf |