Unofficial Client for Hosting.de API
Unofficial Hosting.de API Client
Python3 library for accessing the hosting.de dns api.
This is a very basic unofficial client for the hosting.de API. I have only implemented very few functions that I need for another hobby project. I am not in any way connected to hosting.de other then being a paying customer.
I'd be happy to give up this library for an official and supported library.
I have built this library to use it for ddns scripts and let's encrypt wildcard certificate requests.
Validation and sanitizing of any inputs is expected to be done at higher level.
USE THIS LIBRARY AT YOUR OWN RISK, DO NOT USE IN PRODUCTION. DO NOT EXPECT SUPPORT.
I have only implemented functions and data structures for the DNS API.
The only API functions that I have implemented so far are:
- recordFind(filter, limit=25, page=1, sort=None) --> listing-records
- zoneFind(filter, limit=25, page=1, sort=None) --> listing-zones
- zoneUpdate(zoneConfig, recordsToAdd, recordsToDelete=) --> updating-zones
There are also helpers to aid with correct data structes for these functions
In addition to the API functions provided by hosting.de, I added some functions for common simple use cases. These functions are useful for operations that only affect a single hostname and record type.
Single API call
- addRecord(self, zoneConfigName, recordName, recordType, value, ttl=600)
- updateKnownRecord(self, zoneConfigName, recordName, recordType, newValue, oldValue, ttl=600)
- getRecordsToDelete(self, recordName, recordType)
- getRecordsToDeleteByFilter(self, filter)
Multiple API calls (Lookup values first)
- deleteRecords(self, zoneConfigName, recordName, recordType)
- updateRecord(self, recordName, recordType, newValue, ttl=None)
- No warning handling from responses
pip install no-hostingde-api
git clone https://github.com/DimeOne/no-hostingde-api.git cd hostingde-api python setup.py develop
Adding IPv4 IP:
from hostingde.api.dns import DnsApiClient client = DnsApiClient("MySecretLongApiKey") client.AddRecord("dev.example.org", "demo.dev.example.org", "A", "127.0.0.1", ttl=8400)
Adding IPv6 IP:
from hostingde.api.dns import DnsApiClient client = DnsApiClient("MySecretLongApiKey") client.AddRecord("dev.example.org", "demo.dev.example.org", "AAAA", "AFFE::1", ttl=8400)
Update IPv4 IP:
from hostingde.api.dns import DnsApiClient client = DnsApiClient("MySecretLongApiKey") client.UpdateRecord("demo.dev.example.org", "A", "AFFE::1")
In this case the zoneConfigName and TTL are used from the first previous record, ttl can be specified. Value is only updated if there is more than one record or the current value differs from the new value.
python setup.py sdist python setup.py bdist_wheel
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for no_hostingde_api-0.1.4-py2.py3-none-any.whl